Most NHI programmes have a lifecycle diagram, but few can say what "rotate" or "decommission" actually means for an SSH key compared with an OAuth client or an AI agent's token. Each credential type has its own issuing system, its own expiry mechanics and its own way of going wrong, so a single generic lifecycle leaves gaps exactly where attackers look. This atlas maps six lifecycle stages (request, provision, rotate, monitor, suspend, decommission) against six credential types (API keys, OAuth clients, certificates, SSH keys, tokens and agent identities), with the control, owner and rotation trigger for each cell. It is written for NHI and IAM programme owners who need a single reference to hand to platform, PKI and application teams. Workflow design is covered in NHI lifecycle automation; this page is the map that sits above it.
Key takeaways
- One lifecycle, six mechanics. The stages are the same for every non-human identity, but the controls differ by credential type; write the per-type control down or teams will improvise.
- The best rotation is no rotation. Managed identities, workload identity federation and short-lived tokens remove the rotate stage almost entirely; long-lived secrets should be the documented exception.
- Owner, purpose and expiry are set at request. These three fields drive every later stage; an NHI created without them becomes the orphan that OWASP lists as NHI1:2025 Improper Offboarding.
- Suspend before you delete. Disabling a credential and watching for breakage is the safe path to decommissioning for every type, and it turns retirement into a routine change rather than a risk.
- Certificate lifetimes are forcing automation. Under CA/Browser Forum ballot SC-081v3, public TLS certificate validity falls to 200 days from 15 March 2026, 100 days from 15 March 2027 and 47 days from 15 March 2029, so manual renewal stops scaling.
The lifecycle stages
The six stages below align with the lifecycle used across this site's NHI material and with the account management and authenticator management controls in NIST SP 800-53 Rev. 5 (AC-2, IA-4, IA-5). NIST SP 800-57 Part 1 Rev. 5 adds the cryptographic view: keys move through defined states and each has a cryptoperiod, which is the formal basis for rotation intervals.
| Stage | What happens | Exit criteria |
|---|---|---|
| 1. Request | A team asks for an identity, stating purpose, owner, target systems, permissions needed, environment and expiry | Approved request with a named owner and a justified credential type |
| 2. Provision | The identity and credential are created by the issuing system, scoped, tagged and stored in a vault or bound to a workload | Credential exists only in its approved store; inventory record created |
| 3. Rotate | The credential is replaced on schedule or on a trigger, with the new value distributed before the old one is revoked | Old credential revoked; consumers confirmed working |
| 4. Monitor | Usage, age, permissions and owner status are watched; periodic recertification confirms the identity is still needed | Owner attests or the identity moves to suspend |
| 5. Suspend | The credential is disabled but not deleted, for a defined observation window | No breakage in the window, or a documented reason to restore |
| 6. Decommission | Credential revoked and deleted, identity removed, permissions and trust relationships cleaned up, evidence kept | No residual grants, keys or trust; inventory record closed |
Credential types covered
- API keys and cloud access keys: static shared secrets such as SaaS API keys, AWS IAM user access keys and Google Cloud service account keys. AWS recommends temporary credentials through IAM roles instead of long-term access keys and allows at most two access keys per IAM user, which is what makes overlap rotation possible.
- OAuth clients: application registrations and service principals that authenticate with a client secret, certificate or signed assertion. RFC 9700 (BCP 240, January 2025) recommends asymmetric client authentication, mutual TLS or
private_key_jwt, over shared secrets. Microsoft Entra documentation recommends managed identities where supported, then a certificate from a trusted CA, with client secrets as the fallback. - Certificates: X.509 certificates for TLS, mutual TLS client authentication, code signing and device identity, public or private PKI.
- SSH keys: user and host key pairs used for interactive and automated access. NIST IR 7966 notes that SSH key-based access has been largely ignored and that it needs provisioning, termination and monitoring like any other access.
- Tokens: bearer tokens such as personal access tokens, OAuth access and refresh tokens, cloud session tokens and CI/CD OIDC tokens. For GitHub fine-grained personal access tokens the expiry is chosen at creation, organisations can set a maximum lifetime and require approval, and GitHub recommends a GitHub App for organisation-level or long-lived integrations.
- Agent identities: the identities AI agents use to call tools and APIs, usually a combination of the types above (an OAuth client, delegated tokens, sometimes an API key) plus a link to the human or workflow that launched the agent. See the AI Agent Credential Lifecycle and Rotation Guide.
The identity (service account, app registration, machine user) and the credential (key, secret, certificate, token) have separate lifecycles. An identity can outlive many credentials, and deleting a credential does not remove the identity's permissions. Track both.
The atlas matrix: stage by credential type
Each cell gives the primary control for that stage and credential type. Split into two tables for readability.
API keys, OAuth clients and certificates
| Stage | API keys and cloud access keys | OAuth clients | Certificates |
|---|---|---|---|
| Request | Justify why roles or federation cannot be used; record scope, owner, expiry | Record redirect URIs, grant types, scopes or app roles, owner and consenting admin | Record subject names, issuing CA, key usage, owner and renewal method |
| Provision | Create by pipeline, write straight to a vault, tag with owner and expiry; block console creation by policy (for example Google Cloud's disable key creation constraint) | Prefer certificate or private_key_jwt over client secret; least-privilege scopes; assign owners in the directory | Issue through ACME or a certificate manager; private key generated on the host or in an HSM, never emailed |
| Rotate | Create second key, update consumers, deactivate old, delete after observation; triggers: schedule, leak, owner change | Add new credential alongside old, switch, remove old; refresh tokens rotated or sender-constrained per RFC 9700 | Automated renewal well before expiry; re-key on renewal; revoke on key compromise |
| Monitor | Last-used date, source IPs, CloudTrail or audit logs; secret scanning in code and chat | Sign-in logs for the service principal, consent grants, credential expiry, unused permissions | Inventory with expiry dates, Certificate Transparency monitoring for public names, alerts at 30 and 7 days |
| Suspend | Set key status inactive (AWS supports Inactive), watch for errors | Disable the service principal or sign-in, keep the registration | Remove from service configuration; revoke only once replacement confirmed |
| Decommission | Delete key; remove the user or service account if no keys remain; close inventory record | Delete registration and service principal, remove consents and role assignments | Revoke, remove private key from stores and backups where possible, update inventory |
SSH keys, tokens and agent identities
| Stage | SSH keys | Tokens | Agent identities |
|---|---|---|---|
| Request | Record source host, target hosts, account, permitted commands and owner | Prefer an app or federated token; personal tokens only for personal use; record scope and expiry | Record the agent, its tools, data scope, launching user or workflow, and expiry |
| Provision | Generate on the client; prefer short-lived SSH certificates from an SSH CA over static authorized_keys entries; restrict with forced commands and source address | Issue with the shortest workable lifetime; set organisation maximum lifetime; require approval for organisation access | Distinct identity per agent (no shared keys); bind to workload identity; scope tools and data least privilege |
| Rotate | Replace key pairs on schedule and on staff or host change; SSH certificates expire on their own | Expiry is the rotation; refresh tokens rotated; revoke on leak | Short-lived tokens issued per task or session; rotate any underlying client secret or key |
| Monitor | Scan authorized_keys across hosts for unknown or duplicate keys; log key fingerprints at login | Token use by IP and user agent; tokens near expiry; secret scanning | Tool calls, data accessed, deviation from expected behaviour, link to human owner still valid |
| Suspend | Comment out or remove key from authorized_keys on targets, keep a record | Revoke the token (tokens rarely support suspension) | Pause the agent and disable its identity; keep configuration for review |
| Decommission | Remove key from every target and from the source host; remove host keys of retired servers from known_hosts | Revoke and confirm revocation; remove from CI variables and config | Delete identity, revoke grants and tokens, remove tool connections and memory stores. See the AI Agent Decommissioning Checklist |
Rotation triggers
- Scheduled: the cryptoperiod or policy maximum age for the type is reached.
- Exposure: secret scanning, a provider notice or a leak report; rotate immediately, then investigate. Google Cloud can disable detected leaked service account keys automatically when the exposure response constraint is set to
DISABLE_KEY. - People change: an owner or anyone who has seen the secret leaves or changes role.
- System change: host rebuilt, vendor offboarded, environment split, or the integration moved to a new platform.
- Algorithm or policy change: a key size, algorithm or CA becomes untrusted, or a certificate lifetime rule tightens.
- Incident: any compromise of a system that stored or used the credential.
Ownership and accountability per stage
Every NHI needs one accountable business or technical owner for its whole life. Stages are carried out by different teams, which is why ownership needs to be written down per stage. See the NHI Ownership Guide and the NHI Ownership RACI.
| Stage | Accountable | Responsible | Consulted or informed |
|---|---|---|---|
| Request | NHI owner (requesting team lead) | Requesting engineer | IAM or NHI programme team approves type and scope |
| Provision | Platform owner of the issuing system | Pipeline or platform engineering | Security for high-privilege scopes |
| Rotate | NHI owner | Platform automation, PKI team for certificates | Consuming application teams |
| Monitor | NHI programme team | Security operations and detection engineering | NHI owner on alerts and recertification |
| Suspend | NHI owner (or security on incident) | Platform engineering | Consuming teams, service desk |
| Decommission | NHI owner | Platform engineering | Audit and the NHI programme team for evidence |
When an owner leaves, ownership transfers through the human leaver process, not later. An NHI with no owner should move automatically to suspend after a short grace period.
Automation points
- Request intake: a form or pull request template that will not submit without owner, purpose, environment and expiry, and that steers to federation or managed identity first.
- Policy-gated provisioning: create credentials only from pipelines; block manual paths with platform policy (Google Cloud key creation and upload constraints, organisation token lifetime limits, Entra app management policies).
- Vault-native rotation: use the secrets manager or certificate manager to rotate and distribute; for certificates, ACME automation is the practical answer to 47-day lifetimes.
- Usage-driven review: feed last-used data into recertification so owners confirm only what is active, and flag anything unused for 90 days.
- Auto-suspend: disable credentials that pass expiry, lose their owner or stay unused beyond the threshold, with a notice to the owner.
- Decommission runbook as code: one job per type that revokes, deletes, removes grants and records evidence.
Small organisations: start with the two highest-volume types (usually cloud access keys and tokens) and use native platform controls. Large organisations: build the inventory first, join it to the HR system for owner status, and measure each type separately. See the Credential Rotation at Scale guide.
Measuring the lifecycle
- Owner coverage: share of NHIs with a current, employed owner, per credential type.
- Age over policy: share of credentials older than their type's maximum age. See How to measure secret age and rotation coverage.
- Short-lived share: proportion of workloads using federation, managed identity or short-lived tokens instead of static secrets.
- Dormant NHIs: count unused for 90 days and median days to suspend them.
- Certificate renewal lead time: days before expiry that renewals complete; any expiry-caused outage is a failure.
Framework mapping
| Stage | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | OWASP NHI Top 10 2025 |
|---|---|---|---|
| Request and provision | AC-2, IA-4, AC-6 | PR.AA-01, PR.AA-05 | NHI5 Overprivileged NHI, NHI9 NHI Reuse |
| Rotate | IA-5, SC-12, SC-17 | PR.AA-01 | NHI7 Long-Lived Secrets |
| Monitor | AC-2, IA-5 | ID.AM-08, DE.CM-09 | NHI2 Secret Leakage |
| Suspend and decommission | AC-2(3) Disable Accounts | ID.AM-08 | NHI1 Improper Offboarding |
| Ownership | AC-2 | GV.RR-02 | NHI10 Human Use of NHI |
CIS Controls v8.1 Control 5 (Account Management) and Control 6 (Access Control Management) cover the same ground for service accounts, including keeping an inventory of service accounts.
Common failure patterns
- Static key with no expiry, in code: the Toyota T-Connect key exposure left a server access key in a public repository for about five years; scanning plus a maximum age would have shortened that window sharply.
- Forgotten non-production identities: in the Microsoft Midnight Blizzard breach a legacy test tenant account and a legacy test OAuth application with elevated access gave the attacker a path to executive mailboxes. Test and legacy NHIs need owners, reviews and decommissioning like production.
- Rotating the secret but not the identity: a new client secret is issued while the app keeps excessive permissions and stale consents, so the risk is unchanged.
- Deleting without suspending: a hard delete breaks an undocumented dependency, the credential is recreated in a hurry with wider scope, and the lifecycle starts again outside the process.
- Shared credentials across agents or environments: one key used by several services or by test and production makes rotation risky and revocation impossible without an outage (OWASP NHI8 and NHI9).
- SSH keys outside the inventory: authorized_keys files on long-lived hosts accumulate keys from people and systems that left years ago.
Practitioner checklist
- Publish a one-page control standard per credential type covering all six stages, using the matrix above as the starting draft.
- Make owner, purpose, environment and expiry mandatory fields at request for every NHI.
- Set a maximum age per credential type and an exception process for anything longer.
- Block manual creation paths with platform policy wherever the platform supports it.
- Move workloads to managed identity, workload identity federation or short-lived tokens, and track the share that remain on static secrets.
- Automate certificate renewal with ACME or a certificate manager ahead of the 2026 to 2029 lifetime reductions.
- Feed last-used data into quarterly recertification and auto-suspend NHIs unused for 90 days or without an owner.
- Run decommissioning as a suspend, observe, delete sequence and keep evidence of each step.
- Report owner coverage, age over policy and dormant NHIs per credential type each month.
Standards and references
- OWASP: Non-Human Identities Top 10 2025
- NIST: SP 800-57 Part 1 Rev. 5 Recommendation for Key Management
- NIST: IR 7966 Security of Interactive and Automated Access Management Using Secure Shell (SSH)
- IETF: RFC 9700 Best Current Practice for OAuth 2.0 Security
- CA/Browser Forum: Ballot SC-081v3 Reducing Validity and Data Reuse Periods
- AWS: Manage access keys for IAM users
- Google Cloud: Best practices for managing service account keys
- Microsoft Learn: Create a Microsoft Entra app and service principal
Related NHI Mgmt Group resources: Non-Human Identity (NHI) Guide · NHI lifecycle automation · NHI Offboarding and Decommissioning Guide · NHI Discovery Across Cloud, SaaS, CI/CD and On-Premises Environments · OWASP NHI Top 10 NHI7 Long-Lived Secrets Guide