Retire the identity, revoke its credentials and remove any residual trust paths immediately. A machine identity should not remain active just because the account still exists; if the workload is gone, the access has to go with it.
When a workload is gone, what should happen to its machine identity?
The identity is not an asset to keep “just in case.” It is a trust relationship that should be tied to a live workload, a live owner and a live purpose. Once the workload has been decommissioned, the identity should be treated as dead too, even if the account object, token issuer entry or certificate record still exists in a directory, vault or control plane.
That distinction matters because machine identities are often reused across deployment systems, clouds, CI/CD pipelines and service-to-service paths. If the workload disappears but the identity remains active, you have an orphaned trust path that can still authenticate, still authorize and still be discovered by an attacker or an internal user who assumes it is valid.
Good lifecycle handling means the offboarding event must close the loop completely. Retiring the workload without retiring the identity leaves behind standing access, stale secrets and ambiguous ownership, which is exactly the condition that turns a normal shutdown into an exposure.
Which trust paths have to be removed, not just disabled?
The core cleanup is broader than deleting the account name. Organisations should revoke every credential that can still prove the identity, including keys, tokens, certificates, OAuth client material, workload credentials and any delegated trust that allows the old identity to be accepted elsewhere. If the identity was federated into another system, those trust bindings also need to be broken.
This is especially important when the identity was used as a service account, workload identity or automation principal. A dormant identity can survive through cached tokens, certificate validity windows, federation mappings or allowlists that were never updated when the workload changed. Non-human identity lifecycle basics and service account security both hinge on this same principle: remove the access path, not just the label attached to it.
Where certificates or other cryptographic credentials were part of the identity, lifecycle closure has to include revocation, replacement and any dependent trust store updates. A workload identity that outlives its workload is often really a certificate, key or token problem hiding behind an account record, so the cleanup must follow the actual authentication material.
How do organisations avoid orphaned machine identities in the first place?
The most reliable control is to make ownership, inventory and deprovisioning part of the same operating model. Every machine identity should have an accountable owner, a known purpose, an expiry or renewal rule and an automated removal path that is triggered when the workload is retired. If any of those elements is missing, the identity will eventually become orphaned.
At scale, manual cleanup is not dependable. Orphaned identities appear when infrastructure is rebuilt, applications are replaced, pipelines are renamed or cloud resources are torn down without a matching identity deprovisioning step. NHI ownership and accountability and top NHI lifecycle issues both point to the same operational weakness: if no one owns the shutdown, the identity survives by default.
Practitioners should also assume that the presence of the account alone is not evidence of legitimacy. The real control question is whether the identity still maps to an active workload, an active approval path and an active business need. If not, it is stale and should be retired.
Risk and Threat Considerations
Orphaned machine identities create a quiet but durable attack surface. They can be reused for unauthorized access, abused for lateral movement or left in place long enough for an attacker to find a valid trust path that defenders no longer monitor.
Failure mechanism: The workload is decommissioned, but its credentials, trust bindings or certificate-based authentication remain valid, so the identity can still authenticate or be accepted by downstream systems.
Impact: Residual access can turn into unauthorized system access, hidden persistence, privilege abuse or unwanted reach into production services long after the original workload has gone.
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 | Machine identities outliving workloads is an offboarding failure. |
| NHI-05 — Overprivileged NHI | Residual access after workload retirement is standing privilege risk. | |
| NHI-07 — Long-Lived Secrets | Stale machine identities often persist through leftover tokens, keys or certificates. | |
| Recommendation — Revoke credentials and trust paths when the workload is retired. Remove any permissions that survive beyond the workload's purpose. Expire or revoke credential material as part of decommissioning. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Credential lifecycle control is central to retiring a dead machine identity. |
| AC-2 — Account Management | Accounts must be disabled or removed when they no longer serve an active function. | |
| IA-9 — Service Identification and Authentication | Machine identities authenticate as services or workloads, so their trust relationships must be closed. | |
| Recommendation — Revoke and expire authenticators when the workload no longer exists. Disable or remove inactive accounts and their associated access paths. Revoke service authentication material when the service is decommissioned. | ||
| ISO/IEC 27001:2022 | A.5.16 — Identity Management | Identity records and lifecycle governance must remove obsolete machine identities. |
| A.5.17 — Authentication information | Credentials tied to a retired workload must be revoked or destroyed. | |
| Recommendation — Ensure identity records are retired when the underlying workload is retired. Withdraw authentication information that no longer has a valid business purpose. | ||
Practitioner Guidance
What to verify: Before closing a decommissioning ticket, confirm that the identity has no remaining dependencies, no active trust relationships and no surviving credentials in vaults, CI/CD systems, federated providers or certificate authorities.
Common mistake: Teams often delete the workload resource and assume the identity is gone. In practice, the risky part is the leftover authentication material and any external system that still trusts it.
Decision rule: If the identity can still authenticate to anything material, treat it as live and revoke it first, then clean up the account record, not the other way around.
Practitioner takeaway: A machine identity should be retired on the same event that retires the workload, because unused trust is still trust, and expired purpose is not a valid access justification.
Related resources from NHI Mgmt Group
- How can organisations reduce the risk of stale API keys and machine tokens?
- When should organisations treat machine access as a high-risk identity problem?
- When should organisations treat a machine identity like privileged access?
- When should organisations move from vault-based secrets to workload identity?
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 8, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org