At retirement, after a material scope change, and immediately when behaviour no longer matches the approved task. Any agent that keeps tokens, keys, or service accounts after its purpose has ended becomes standing access waiting to be reused. Revocation has to be part of the lifecycle, not an end-of-quarter housekeeping task.
When should a homegrown agent lose access, not just be “finished”?
Access should be revoked as soon as the agent is no longer authorised to keep acting, not only when a project closes. For homegrown agents, that means retirement, a material scope change, or any point where observed behaviour no longer matches the approved task. The key test is simple: if the agent should not be able to continue operating, its credentials should not continue to work.
That decision matters because a “finished” agent often still has tokens, keys, or a service account that can be reused later. The cleaner the lifecycle, the less likely those leftovers become standing access. NHI Lifecycle Management Guide is a useful reference point for treating revocation as part of the lifecycle, not an afterthought.
What counts as a revocation trigger in practice?
The strongest triggers are lifecycle and trust triggers. Retirement is the obvious one, but scope drift is just as important: if the agent is repurposed, given a new environment, or starts handling data or actions beyond its original approval, the old access should be withdrawn and reissued under the new scope. If the agent’s behaviour no longer matches the approved task, assume the original trust boundary has broken.
This is also where credential type matters. A token, API key, certificate, or service account can all outlive the intent behind them, so the revocation rule has to cover the actual mechanism the agent uses to authenticate or act. API Key Management Guide and Guide to NHI Rotation Challenges both reinforce that lifecycle control is about the credential path as much as the entity itself.
When agents are reused, organisations should treat that as a new authorisation event, not a continuation of the old one. That is especially important for homegrown automation because informal ownership often lags behind actual technical access, which makes stale permissions easy to miss.
What breaks when revocation is delayed?
Delayed revocation turns temporary access into standing access. That creates reuse risk, because dormant credentials can be picked up later by the original agent, by another process, or by an attacker who discovers them. It also creates governance drift: teams may believe the agent is retired while the live credential still has effective authority. Guide to the Secret Sprawl Challenge helps show how unused secrets become an exposure problem when they are not cleaned up with the same discipline used to create them.
Operationally, the failure mode is simple: the more endpoints, vaults, and runtimes that remember the old credential, the harder it is to prove that revocation really happened everywhere. That is why revocation should be coupled with inventory, ownership, and confirmation that the agent no longer has an active path back into production. Guide to the Secret Sprawl Challenge and Secrets Management Guide are both relevant here because they focus on secret centralisation, rotation, and removal of leftover exposure.
Risk and Threat Considerations
Homegrown agents are particularly exposed to credential reuse and silent overreach because their access is often built quickly, then left in place after the original task ends. If a retired or repurposed agent can still authenticate, an attacker does not need a new foothold, they can abuse the already trusted path.
Failure mechanism: Access is left active after retirement or scope change, so stale tokens, keys, or service accounts remain valid and can be reused, leaked, or abused outside the intended task.
Impact: The result can be unauthorized actions, harder-to-detect lateral movement, and a larger blast radius if the agent credential is copied, shared, or discovered later.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 addresses the attack surface, NIST SP 800-53 Rev 5 sets the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 — Improper Offboarding | Revoking an agent’s access at retirement is an offboarding control for non-human identities. |
| NHI-07 — Long-Lived Secrets | Delayed revocation leaves tokens, keys, and service accounts active beyond their intended life. | |
| NHI-05 — Overprivileged NHI | Scope changes and stale access can leave an agent with more privilege than its task requires. | |
| Recommendation — Revoke the agent’s credentials and remove residual access as soon as the agent is retired. Enforce short credential lifetimes and rotate or revoke secrets when the task ends. Re-scope the agent before reuse and remove any privilege no longer needed. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | The question is about revoking and managing the credentials the agent uses to authenticate. |
| AC-2 — Account Management | Agent access lifecycle and retirement map directly to account creation, disablement, and removal. | |
| AC-6 — Least Privilege | Scope changes require reassessing whether the agent still needs its current level of access. | |
| Recommendation — Rotate, disable, or revoke authenticators when the agent’s purpose or scope changes. Disable or remove the agent account when it is no longer authorised to operate. Reduce access to the minimum required before allowing the agent to continue. | ||
| ISO/IEC 27001:2022 | A.5.16 — Identity management | Identity lifecycle management is central to revoking a homegrown agent’s access cleanly. |
| A.8.5 — Secure authentication | The issue depends on securely controlling the agent’s authentication material. | |
| Recommendation — Maintain a lifecycle record for each agent identity and revoke it on retirement or scope change. Invalidate authentication material immediately when the agent is no longer authorised. | ||
Practitioner Guidance
What to verify: Do not treat “revoked in the console” as sufficient. Verify that the agent can no longer authenticate, that cached or mirrored credentials have been removed, and that dependent jobs or integrations are not still able to call the old identity.
Decision rule: If the agent’s purpose has ended, revoke immediately; if its purpose has changed materially, rotate or reissue access under the new scope before allowing it to resume. If you cannot explain why the credential still needs to exist, it is already overdue for removal.
Practitioner takeaway: For homegrown agents, the safest default is to revoke first and reauthorize only when the next legitimate task is explicit, bounded, and observable.
Related resources from NHI Mgmt Group
- When should organisations revoke third-party access credentials?
- Should organisations revoke agent access after detection or redesign it up front?
- What should organisations do when an agent tries to access credentials or sensitive files?
- Should organisations use delegated access or separate agent credentials?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org