Join our Newsletter — 33% off our NHI Course

Should organisations rotate AI keys before or after building a unified inventory?

Before and after are both necessary, but inventory comes first. Without a trusted list of issued keys, rotation becomes guesswork and can miss dormant credentials or break active ones. Once the inventory exists, rotation can be risk-based instead of blind.

Why inventory has to come before rotation

Rotation is only safe when you know what exists, where it is used, and which systems depend on it. A unified inventory turns key rotation from a blunt event into a controlled change, so teams can identify ownership, scope, and blast radius before a credential is touched. That is especially important for the NHI Lifecycle Management Guide and the broader lifecycle problem of discovering issued credentials before acting on them.

Without that inventory, rotation can miss dormant keys that still matter, or it can break active integrations that were never mapped. The inventory step is what separates “we changed a secret” from “we managed a credential lifecycle.”

What changes once the inventory exists

Once organisations have a trusted inventory, rotation becomes risk-based instead of blind. Teams can prioritise the oldest keys, the highest-privilege keys, the externally exposed keys, and the keys attached to business-critical services. That is the practical difference between a cleanup exercise and a defensible security control, and it aligns with the inventory and rotation emphasis in Top 10 NHI Issues.

A good inventory also makes it easier to distinguish keys that can be rotated immediately from keys that need a dependency review first. That matters because some keys are easy to replace, while others require coordinated cutover, validation, and rollback planning. Where the key estate is large, the inventory becomes the control plane for sequencing the work.

How to sequence rotation without creating outages

The safest pattern is to inventory first, then rotate in waves, then re-check the inventory after each wave. Start with the credentials that have the greatest exposure or the weakest governance, then validate that every dependent system is still authenticating correctly. For lifecycle-heavy environments, Lifecycle Processes for Managing NHIs and Guide to NHI Rotation Challenges both reinforce that rotation succeeds when ownership, dependency mapping, and change control are already in place.

If teams rotate first and inventory later, they usually create two failures at once: they lose confidence in what was changed, and they increase the chance of service disruption. If they inventory first, they can use the same source of truth to decide what to rotate now, what to defer, and what needs a manual exception.

Risk and Threat Considerations

When keys are rotated before inventory, the main risk is hidden dependency failure. Untracked keys can continue to function in shadow systems, while tracked but undocumented keys may be retired too aggressively and break production workflows.

Failure mechanism: The organisation lacks a complete map of issued keys, so rotation is applied without knowing which credentials are dormant, duplicated, embedded, or actively consumed by applications and automation.

Impact: Attackers can retain access through missed keys, or legitimate services can fail after a poorly sequenced rotation, creating both security exposure and operational downtime.

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 and risk surface, while NIST SP 800-57 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 — Improper Offboarding Keys rotate safely only when issued credentials are inventoried and retired cleanly.
NHI-02 — Secret Leakage The question concerns finding and rotating keys that may already be leaked or unmanaged.
NHI-07 — Long-Lived Secrets Rotation timing is driven by long-lived credentials that accumulate exposure over time.
Recommendation — Track and retire exposed keys before rotating active credentials. Inventory secrets first, then rotate any leaked or unknown keys. Prioritise long-lived keys for rotation once inventory identifies them.
NIST SP 800-57 Key Lifecycle Management The subject is whether key inventory should precede rotation in a key lifecycle process.
Recommendation — Define cryptoperiods and rotate keys only after inventorying key usage and ownership.
CIS Controls v8 CIS-5 — Account Management Key inventory and rotation depend on knowing which credentials and accounts exist.
Recommendation — Inventory credentials and disable or rotate those that are stale or unowned.

Practitioner Guidance

What to prioritise: Build the unified inventory from actual observed usage, not from policy lists alone. Include ownership, last-used time, privilege level, environment, and dependency data so rotation decisions can be made with context.

Decision rule: If a key cannot be tied to an owner and a consuming system, treat it as a higher-risk candidate for investigation before rotation. If it is tied to a critical production dependency, rotate it only with a tested cutover plan and a rollback path.

Practitioner takeaway: Inventory is the control that makes rotation accurate; without it, rotation is mostly guesswork, but with it, rotation becomes a targeted lifecycle action rather than a blind reset.