Significant-Gravitas/AutoGPT · info · HTTPException
AutoGPT-managed credentials cannot be deleted
Error message
AutoGPT-managed credentials cannot be deleted
What it means
DELETE /integrations/{provider}/credentials/{cred_id} returns 403 'AutoGPT-managed credentials cannot be deleted' when the stored credential has is_managed == True. Managed credentials (e.g. Ayrshare provisioned by AyrshareManagedProvider) are created and lifecycle-managed by the platform itself; direct user deletion is blocked.
Source
Thrown at autogpt_platform/backend/backend/api/features/integrations/router.py:652
status_code=status.HTTP_404_NOT_FOUND, detail="Credentials not found"
)
if is_system_credential(cred_id):
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="System-managed credentials cannot be deleted",
)
creds = await creds_manager.store.get_creds_by_id(user_id, cred_id)
if not creds:
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, detail="Credentials not found"
)
if not provider_matches(creds.provider, provider):
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail="Credentials not found",
)
if creds.is_managed:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="AutoGPT-managed credentials cannot be deleted",
)
try:
await remove_all_webhooks_for_credentials(user_id, creds, force)
except NeedConfirmation as e:
return CredentialsDeletionNeedsConfirmationResponse(message=str(e))
tokens_revoked = None
if provider == ProviderName.CODEX:
tokens_revoked = await revoke_codex_credentials(creds_manager, user_id, cred_id)
else:
await creds_manager.delete(user_id, cred_id)
if isinstance(creds, OAuth2Credentials) and provider != ProviderName.CODEX:
if provider_matches(provider.value, ProviderName.MCP.value):
# MCP uses dynamic per-server OAuth — create handler from metadataView on GitHub (pinned to 9c8bb5550f)
Solutions
- Do not delete managed credentials; the platform controls their lifecycle
- If removal is truly required, disable the managed provider feature / revoke the platform-side integration so the manager retracts it
- UI: hide or disable delete on credentials flagged is_managed
Defensive patterns
Strategy: type-guard
Validate before calling
meta = next(c for c in all_credentials if c['id'] == cred_id)
if meta.get('is_managed'):
return # platform-managed; not user-deletable Type guard
const isUserDeletable = (c: { is_managed?: boolean }): boolean =>
c.is_managed !== true; Prevention
- Check the is_managed flag on listed credentials before exposing delete actions
When it happens
Trigger: DELETE against a credential whose row has is_managed=true (e.g. an auto-provisioned Ayrshare social credential).
Common situations: User tries to tidy up the automatically-created provider entry in the credentials UI; script deletes every credential it can list.
Related errors
- Cannot create credentials with a reserved ID
- System-managed credentials cannot be deleted
- Managed credentials cannot be upgraded
- Server did not return an access token for the Google Drive p
- Codex credentials must be created through ChatGPT sign-in
AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14).
Data as JSON: /api/errors/7259f02fdf1402c4.
Report an issue: GitHub.