auditing-api-key-and-token-lifecyclelisted
Install: claude install-skill UnboundCompute/security-agent-skills
# Auditing API key and token lifecycle: a key is a standing credential, so bound it and be able to kill it
An API key or long-lived access token is a bearer credential: whoever holds it is the caller, with no second
factor and often no user behind it. That makes the whole security of the key a question of its lifecycle, how
narrowly it is scoped, whether it expires, whether you can actually revoke it, and where it might leak, because
the moment one of those is loose, a single leaked string becomes standing access. A key issued with broader
scope than its caller needs means a leak grants far more than the one function it was for. A key with no expiry
stays valid forever, so a credential stolen once works until someone notices, which is often never. A revocation
path that does not truly stop the key, a rotation that leaves the old key live, a disable that a cache ignores,
means a compromised credential keeps authenticating after you believed you killed it. A key that leaks into
logs, URLs, client-side code, or error messages and is never rotated is a published password. And a token whose
scope or audience is not enforced on use works against endpoints it was never issued for. The audit follows each
key from issuance to revocation and checks it is minimally scoped, expiring, truly revocable, and enforced on
use. You audit this by holding a key and testing what it can reach, how long it lasts, and whether you can stop
it.
## When to use
- A service issues API keys or long-live