{"record":{"id":"cc3b497f23b96d32","repo":"microsoft/autogen","slug":"provider-module-module-path-is-not-in-a-truste","errorCode":null,"errorMessage":"Provider module '{module_path}' is not in a trusted namespace. Allowed namespaces by default: autogen_core, autogen_agentchat, autogen_ext, autogen_studio, autogenstudio. To allow additional namespaces, set the AUTOGEN_ALLOWED_PROVIDER_NAMESPACES environment variable to a comma-separated list (e.g. AUTOGEN_ALLOWED_PROVIDER_NAMESPACES=mycompany_agents,mypackage).","messagePattern":"Provider module '(.+?)' is not in a trusted namespace\\. Allowed namespaces by default: autogen_core, autogen_agentchat, autogen_ext, autogen_studio, autogenstudio\\. To allow additional namespaces, set the AUTOGEN_ALLOWED_PROVIDER_NAMESPACES environment variable to a comma-separated list \\(e\\.g\\. AUTOGEN_ALLOWED_PROVIDER_NAMESPACES=mycompany_agents,mypackage\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/packages/autogen-core/src/autogen_core/_component_config.py","lineNumber":263,"sourceCode":"\n        # First, do a look up in well known providers\n        if loaded_model.provider in WELL_KNOWN_PROVIDERS:\n            loaded_model.provider = WELL_KNOWN_PROVIDERS[loaded_model.provider]\n\n        output = loaded_model.provider.rsplit(\".\", maxsplit=1)\n        if len(output) != 2:\n            raise ValueError(\"Invalid\")\n\n        module_path, class_name = output\n\n        trusted = _get_trusted_namespaces()\n        # Also allow test modules (pytest convention) to load components\n        module_name = module_path.rsplit(\".\", maxsplit=1)[-1]\n        is_test_module = module_name.startswith(\"test_\") or module_path.startswith(\"test_\")\n        if not is_test_module and not any(\n            module_path.startswith(ns) or module_path == ns.rstrip(\".\") for ns in trusted\n        ):\n            raise ValueError(\n                f\"Provider module '{module_path}' is not in a trusted namespace. \"\n                f\"Allowed namespaces by default: autogen_core, autogen_agentchat, autogen_ext, \"\n                f\"autogen_studio, autogenstudio. \"\n                f\"To allow additional namespaces, set the AUTOGEN_ALLOWED_PROVIDER_NAMESPACES \"\n                f\"environment variable to a comma-separated list \"\n                f\"(e.g. AUTOGEN_ALLOWED_PROVIDER_NAMESPACES=mycompany_agents,mypackage).\"\n            )\n\n        module = importlib.import_module(module_path)\n        component_class = module.__getattribute__(class_name)\n\n        if not is_component_class(component_class):\n            raise TypeError(\"Invalid component class\")\n\n        # We need to check the schema is valid\n        if not hasattr(component_class, \"component_config_schema\"):\n            raise AttributeError(\"component_config_schema not defined\")\n","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/python/packages/autogen-core/src/autogen_core/_component_config.py#L245-L281","documentation":"Error \"Provider module '{module_path}' is not in a trusted namespace. Allowed namespaces by default: autogen_core, autogen_agentchat, autogen_ext, autogen_studio, autogenstudio. To allow additional namespaces, set the AUTOGEN_ALLOWED_PROVIDER_NAMESPACES environment variable to a comma-separated list (e.g. AUTOGEN_ALLOWED_PROVIDER_NAMESPACES=mycompany_agents,mypackage).\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at python/packages/autogen-core/src/autogen_core/_component_config.py:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the class into an allowed namespace or extend AUTOGEN_ALLOWED_PROVIDER_NAMESPACES"],"exampleFix":"export AUTOGEN_ALLOWED_PROVIDER_NAMESPACES=mycompany_agents,mypackage","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}