{"record":{"id":"e1930ce727c4db71","repo":"BerriAI/litellm","slug":"invalid-policy-policy-name-e","errorCode":null,"errorMessage":"Invalid policy '{policy_name}': {e}","messagePattern":"Invalid policy '(.+?)': (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/policy_engine/policy_registry.py","lineNumber":183,"sourceCode":"        Load policies from a configuration dictionary.\n\n        Args:\n            policies_config: Dictionary mapping policy names to policy definitions.\n                            This is the raw config from the YAML file.\n        \"\"\"\n        self._policies = {}\n        self._config_policies = {}\n        self._sources = {}\n        self._policies_by_id = {}\n\n        for policy_name, policy_data in policies_config.items():\n            try:\n                policy = self._parse_policy(policy_name, policy_data)\n                self._policies[policy_name] = policy\n                verbose_proxy_logger.debug(\"Loaded policy: %s\", policy_name)\n            except Exception as e:\n                verbose_proxy_logger.error(\"Error loading policy '%s': %s\", policy_name, e)\n                raise ValueError(f\"Invalid policy '{policy_name}': {e}\") from e\n\n        self._config_policies = dict(self._policies)\n        self._sources = {policy_name: \"config\" for policy_name in self._policies}\n        self._initialized = True\n        verbose_proxy_logger.info(\"Loaded %s policies\", len(self._policies))\n\n    def _parse_policy(self, policy_name: str, policy_data: dict[str, Any]) -> Policy:\n        \"\"\"\n        Parse a policy from raw configuration data.\n\n        Args:\n            policy_name: Name of the policy\n            policy_data: Raw policy configuration\n\n        Returns:\n            Parsed Policy object\n        \"\"\"\n        # Parse guardrails","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/policy_registry.py#L165-L201","documentation":"Raised while loading policies from YAML config: _parse_policy rejected the entry for the named policy (bad guardrail names, condition, or pipeline schema), so that policy is skipped and the parse error logged.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/policy_registry.py:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the policy definition per the embedded error (invalid fields, unknown guardrails, bad pipeline).","Validate the policy JSON against the documented schema before registering."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}