---
title: How do you retire an AI agent safely?
url: https://opencontroller.lyzr.com/blog/how-to-retire-an-ai-agent-safely
published: 2026-11-14
updated: 2026-11-14
author: Lyzr
---

# How do you retire an AI agent safely?

**To retire an AI agent safely, first find everything that depends on it, then cut its access in a fixed order: stop new traffic, revoke credentials and delegations, unlink its tools and MCP servers, and remove it from schedules and triggers. Keep its logs, evaluations and approvals for your retention period, mark it retired in the registry rather than deleting it, and watch for any call that still uses its identity. Most retirement failures are credentials that outlive the agent.**

Agents get replaced, merged or abandoned all the time. A pilot ends. A vendor platform adds the same feature. A team rebuilds on a new framework. The old agent rarely gets switched off cleanly; it just stops being used, while its keys and permissions stay live.

## Why is retiring an AI agent risky?

Three reasons:

- **Orphaned credentials.** API keys, service accounts and OAuth grants keep working after the agent stops. OWASP's Non-Human Identities Top 10 ranks improper offboarding as its first risk (NHI1:2025).
- **Hidden dependants.** Other agents, workflows or reports may call the agent or consume its output. Switching it off breaks them silently.
- **Evidence loss.** Deleting the agent and its logs destroys the record auditors and regulators may later ask for.

The NIST AI RMF calls this out directly: GOVERN 1.7 asks for processes to decommission and phase out AI systems safely, without increasing risk.

## What is the retirement checklist?

Run these steps in order. Each has a check that proves it is done.

| Step | Action | Proof it is done |
|---|---|---|
| 1. Decide and announce | Owner records the reason and date; users and dependent teams are told | Retirement decision in the registry with date |
| 2. Map dependants | Find agents, workflows, schedules and integrations that call this agent or use its output | Dependency list signed off by the owner |
| 3. Migrate or end dependants | Move each dependant to a replacement or end it | Each dependant marked migrated or ended |
| 4. Stop new traffic | Block the agent at the gateway or platform; disable triggers, schedules and webhooks | Zero new invocations for an agreed period, for example 7 days |
| 5. Revoke credentials | Delete API keys, disable service accounts and app registrations, revoke OAuth grants and refresh tokens | Identity provider and cloud consoles show no active credentials |
| 6. Remove delegations | End on-behalf-of permissions and token-exchange trust relationships | No delegation entries remain |
| 7. Unlink tools and MCP servers | Remove the agent's access to each tool; retire MCP servers used only by this agent | Tool and server list empty or retired |
| 8. Remove data access | Detach knowledge bases, vector stores and storage permissions; decide whether agent-specific data is deleted or archived | Data owner confirms access removed |
| 9. Preserve evidence | Archive logs, eval results, approvals, agent card and AI-BOM for the retention period | Archive location recorded |
| 10. Mark retired, do not delete | Set the registry status to retired, with the replacement linked | Registry status retired |
| 11. Watch for stragglers | Alert on any call using the retired identity or model endpoint | No alerts for 30 days |

Do steps 4 and 5 in that order. Stopping traffic first shows you what breaks while you can still roll back; revoking credentials first makes failures harder to trace.

## How long should you keep a retired agent's logs?

As long as your longest applicable retention rule. That might be a sector record-keeping rule, a contractual audit right or your own policy. A retired agent still needs to answer "what did it do on this date?" if a complaint or audit arrives later. See [how long to retain AI agent logs](/blog/how-long-to-retain-ai-agent-logs).

## What about retiring an agent you did not build?

Shadow agents found by discovery follow the same checklist, with one difference: you may not know its dependants. Run step 4 as a staged block with alerts before revoking anything, so whoever relies on it surfaces. The [shadow agent playbook](/blog/what-to-do-with-a-shadow-ai-agent-once-you-find-it) covers the conversation with the team that built it.

## When should you consider retiring an agent?

Review each agent at least once a year against these triggers:

- No invocations for 60 to 90 days.
- Its business process has changed or ended.
- A platform feature now does the same job.
- Its model is deprecated and the migration cost exceeds its value.
- It repeatedly fails evaluations or exceeds its cost budget.
- It has no owner after a reassignment window.

Retirement is the last stage of the [agent lifecycle](/blog/ai-agent-lifecycle-stages); treat it with the same rigour as launch.

## How Opencontroller does this

Opencontroller auto-discovers agents, models and API keys across AWS, Azure and Google Cloud and keeps a governed registry of agents, versions, tools and MCP servers, which gives you the dependency and credential picture. Per-agent Block and Quarantine controls act through the connected platform, and policies can be applied across the estate. Posture flags risky permissions and configurations that remain. Read the [control plane pillar](/blog/what-is-an-ai-agent-control-plane) or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Should you delete a retired AI agent from the registry?**
No. Mark it retired and keep the record, linked to its replacement. Deleting it loses the history auditors and investigators may need.

**What is the most common mistake when retiring an AI agent?**
Leaving credentials active. API keys, service accounts and OAuth refresh tokens keep working after the agent stops being used.

**How long should you watch for activity after retiring an agent?**
At least 30 days. Alert on any call that uses the retired agent's identity, keys or endpoints.

## Key facts

Retiring an AI agent safely: map dependants, stop new traffic, then revoke API keys, service accounts and OAuth grants, remove delegations, unlink tools and MCP servers, remove data access, archive logs and evals, mark retired (not deleted) in the registry, and alert on stray calls for 30 days. OWASP Non-Human Identities Top 10 ranks improper offboarding first (NHI1:2025). NIST AI RMF GOVERN 1.7 covers safe decommissioning. Opencontroller provides discovery, a governed registry, per-agent Block/Quarantine and Posture. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [What are the stages of the AI agent lifecycle?](https://opencontroller.lyzr.com/blog/ai-agent-lifecycle-stages.md)
- [How long should you keep AI agent logs and traces?](https://opencontroller.lyzr.com/blog/how-long-to-retain-ai-agent-logs.md)
- [What should you do with a shadow AI agent once you find it?](https://opencontroller.lyzr.com/blog/what-to-do-with-a-shadow-ai-agent-once-you-find-it.md)
- [More on Agent governance basics](https://opencontroller.lyzr.com/blog/cluster/agent-governance-basics)
