Subscribe to the Non-Human & AI Identity Journal

How should security teams handle NHIs when employees leave or change roles?

Security teams should treat NHI offboarding as part of the employee departure process. That means identifying every secret, service account, and automation token tied to the departing role, confirming the business owner, and revoking or rotating access before the identity is left behind in production.

Why This Matters for Security Teams

Employee exits and role changes are not just HR events. They are identity lifecycle events that can leave service accounts, API keys, OAuth grants, certificates, and automation tokens attached to a person who no longer needs them. That gap is where NHI risk accumulates: secrets linger, privilege remains broad, and ownership becomes unclear. NHI governance guidance in the Ultimate Guide to NHIs shows how often organisations miss the full scope of these assets, while the NIST Cybersecurity Framework 2.0 reinforces the need for disciplined asset, access, and recovery processes.

The practical challenge is that NHIs rarely sit in one place. They live in CI/CD pipelines, application configs, secret stores, cloud roles, SaaS integrations, and code repositories. If teams only disable a user account and close a laptop ticket, the machine identities tied to that role can keep running with the same access for days or weeks. That is why the offboarding question is really about lifecycle control, not just removal. In practice, many security teams encounter stale service access only after a role change has already exposed data or automation has already continued under the wrong ownership.

How It Works in Practice

Effective NHI offboarding starts with inventory, because you cannot revoke what you cannot find. Security teams should map the departing employee or changed role to every associated secret, service principal, certificate, agent token, vault entry, CI/CD credential, and third-party integration. The Top 10 NHI Issues research is clear that credential rotation and visibility are persistent failure points, which is why discovery must happen before revocation.

From there, assign a business owner to each NHI, because accountability should move with the role, not the employee. If the identity is still needed, rebind it to the successor role and issue new access under that owner. If it is no longer needed, revoke the credential, remove the grant, and rotate any dependent secrets. For higher-risk systems, use JIT issuance and short-lived tokens so the access window is narrow by design. This is especially important where OAuth consent, cloud roles, and automation pipelines can silently preserve access even after a human departs.

  • Identify all NHIs tied to the role, including nested and inherited access.
  • Confirm whether the identity should be deleted, rotated, or reassigned.
  • Rotate secrets that may have been copied into code, configs, or pipeline variables.
  • Log the action in your PAM, ticketing, and risk records for auditability.
  • Revalidate that no dependent jobs, agents, or integrations still reference the old identity.

Where this guidance breaks down most often is in hybrid environments with unmanaged scripts, shadow IT SaaS, and embedded credentials in legacy applications, because the identity map is incomplete and the revocation path is not centralized.

Common Variations and Edge Cases

Tighter offboarding control often increases operational overhead, requiring organisations to balance rapid access removal against the risk of breaking business automation. That tradeoff is real, especially when a role change should preserve some machine access but not the original human’s authority.

For contractors and temporary staff, best practice is usually simpler: time-box the NHI from the start and remove it at contract end rather than trying to infer ownership later. For shared service accounts, current guidance suggests moving away from shared static credentials entirely, because a role change for one person should not force a disruptive reset for unrelated teams. For agents and other autonomous workloads, the challenge is even sharper: their permissions should be evaluated at runtime, not assumed safe because the original owner left. That is why intent-based authorisation, workload identity, and ephemeral secrets are increasingly discussed in modern governance models, though there is no universal standard for this yet.

Teams should also watch for hidden persistence paths such as long-lived refresh tokens, dormant API keys in source control, and CI/CD variables inherited across projects. The safest pattern is to make NHI offboarding a mandatory checkpoint in employee departure and role transfer workflows, with documented rotation steps and post-change validation. For deeper operational context, 52 NHI Breaches Analysis and Cisco DevHub NHI breach both show how missed machine identities can outlive the human process that created them.

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 address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Directly addresses rotation and lifecycle control for non-human credentials.
NIST CSF 2.0 PR.AC-4 Supports least-privilege access review and removal during role changes.
NIST AI RMF Helps govern autonomous or agentic workloads that need context-aware access changes.

Define accountability and runtime controls for agentic identities whose access cannot stay static.