{"record":{"id":"17cf8b823b4d4427","repo":"BerriAI/litellm","slug":"invalid-attachment-e","errorCode":null,"errorMessage":"Invalid attachment: {e}","messagePattern":"Invalid attachment: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/policy_engine/attachment_registry.py","lineNumber":73,"sourceCode":"        self._initialized: bool = False\n\n    def load_attachments(self, attachments_config: list[dict[str, Any]]) -> None:\n        \"\"\"\n        Load attachments from a configuration list.\n\n        Args:\n            attachments_config: List of attachment dictionaries from YAML.\n        \"\"\"\n        self._attachments = []\n\n        for attachment_data in attachments_config:\n            try:\n                attachment = self._parse_attachment(attachment_data)\n                self._attachments.append(attachment)\n                verbose_proxy_logger.debug(\"Loaded attachment for policy: %s\", attachment.policy)\n            except Exception as e:\n                verbose_proxy_logger.error(\"Error loading attachment: %s\", e)\n                raise ValueError(f\"Invalid attachment: {e}\") from e\n\n        self._config_attachments = tuple(self._attachments)\n        self._initialized = True\n        verbose_proxy_logger.info(\"Loaded %s policy attachments\", len(self._attachments))\n\n    def _parse_attachment(self, attachment_data: dict[str, Any]) -> PolicyAttachment:\n        \"\"\"\n        Parse an attachment from raw configuration data.\n\n        Args:\n            attachment_data: Raw attachment configuration\n\n        Returns:\n            Parsed PolicyAttachment object\n        \"\"\"\n        return PolicyAttachment(\n            policy=attachment_data.get(\"policy\", \"\"),\n            scope=attachment_data.get(\"scope\"),","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/attachment_registry.py#L55-L91","documentation":"Raised while loading policy attachments from YAML: _parse_attachment (Pydantic validation of one attachment dict) rejected the entry, so the malformed attachment is skipped and the parse error is logged with the cause.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/attachment_registry.py:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the attachment payload against the attachment schema (required fields, allowed types).","Check the error detail for the specific validation failure and correct the request."],"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"}