{"record":{"id":"6e224a5d949e30ff","repo":"BerriAI/litellm","slug":"delete-operations-are-not-implemented-for-self-se","errorCode":null,"errorMessage":"Delete operations are not implemented for {self.secret_manager_name}. Override async_delete_secret() to add delete support.","messagePattern":"Delete operations are not implemented for (.+?)\\. Override async_delete_secret\\(\\) to add delete support\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/custom_secret_manager.py","lineNumber":208,"sourceCode":"        \"\"\"\n        Asynchronously delete a secret from your custom secret manager.\n\n        This is optional to implement. If your secret manager supports deleting secrets,\n        you can override this method.\n\n        Args:\n            secret_name: Name of the secret to delete\n            recovery_window_in_days: Number of days before permanent deletion (if supported)\n            optional_params: Additional parameters specific to your secret manager\n            timeout: Request timeout\n\n        Returns:\n            Response from the secret manager containing deletion details\n\n        Raises:\n            NotImplementedError: If delete operations are not supported\n        \"\"\"\n        raise NotImplementedError(\n            f\"Delete operations are not implemented for {self.secret_manager_name}. \"\n            \"Override async_delete_secret() to add delete support.\"\n        )\n\n    def validate_environment(self) -> bool:\n        \"\"\"\n        Validate that all required environment variables and configuration are present.\n\n        Override this method to validate your secret manager's configuration.\n\n        Returns:\n            True if the environment is valid\n\n        Raises:\n            ValueError: If required configuration is missing\n        \"\"\"\n        verbose_logger.debug(\"No environment validation configured for custom secret manager\")\n        return True","sourceCodeStart":190,"sourceCodeEnd":226,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/custom_secret_manager.py#L190-L226","documentation":"async_delete_secret on CustomSecretManager is the delete-path optional-capability stub: it raises NotImplementedError naming the manager and telling you to override async_delete_secret. Like the write stub, it exists so read-only managers fail loudly instead of silently pretending to delete.","triggerScenarios":"await manager.async_delete_secret(secret_name) on a subclass without a delete implementation; cleanup/rotation scripts calling delete on every configured manager regardless of capability.","commonSituations":"Secret rotation tooling that writes and deletes across managers; read-only wrappers (env, cached KV) exposed to generic lifecycle jobs.","solutions":["Override async_delete_secret in your subclass to invoke your backend's delete API (respecting recovery_window_in_days if supported)","Gate deletion flows on a capability check so read-only managers are skipped","Switch to a backend with delete support for anything under rotation policies"],"exampleFix":"# before\nawait mgr.async_delete_secret('MY_KEY')  # NotImplementedError: Override async_delete_secret()\n\n# after\nclass MyManager(CustomSecretManager):\n    async def async_delete_secret(self, secret_name, recovery_window_in_days=7, optional_params=None, timeout=None):\n        return await backend.delete_secret(secret_name, recovery_window_in_days)","handlingStrategy":"type-guard","validationCode":"from litellm.integrations.custom_secret_manager import CustomSecretManager\n\nif type(manager).async_delete_secret is CustomSecretManager.async_delete_secret:\n    raise PermissionError(f'{manager.secret_manager_name} is read-only; skipping delete')","typeGuard":"from litellm.integrations.custom_secret_manager import CustomSecretManager\n\ndef can_delete_secrets(manager) -> bool:\n    return type(manager).async_delete_secret is not CustomSecretManager.async_delete_secret","tryCatchPattern":"except NotImplementedError as e:\n    if 'async_delete_secret' in str(e):\n        skip deletion for read-only managers and log which secrets remain; never report success\n    raise","preventionTips":["Check delete capability before running rotation/cleanup jobs","Keep a capability matrix of configured secret managers","Fail rotation workflows loudly when a backend cannot delete"],"tags":["notimplementederror","secret-manager","subclass-contract","litellm"],"backgroundTag":"abstract-method-not-implemented","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}