
AGENT SECURITY
What Is Agent Credential Management?
The keys, tokens and secrets agents use to reach enterprise systems: documented lifetimes per credential type, what NIST says a cryptoperiod should be, and why revocation is weaker than assumed.
TL;DR
Agent credential management is not identity plus a vault. It's keeping every credential an agent holds scoped, stored, rotated, and revocable for the agent's entire working life, not just the day it was issued.
The numbers are in the vendors' own documentation and they do not agree with each other. A GitHub App installation access token expires after one hour. A Google Cloud service account key, by Google's own words, has no expiry time and stays valid until you delete it. A GitHub fine-grained personal access token may be given an infinite lifetime unless an organization policy blocks it. One agent can hold all three.
Most teams get the first half right. They mint a credential and lock it in a vault, and treat that as done. What they miss is the second half: whether that credential is still scoped correctly six months later, whether it rotates on its own, and whether anyone could revoke it in seconds if the agent went rogue.
We are not arguing that vaults are the wrong answer. They are the right answer to storage, and storage is the part almost everyone already solved.
The part to fix this quarter is time. NIST recommends a cryptoperiod of no more than two years for an authorization key, which means that for most enterprises the honest starting question is how old the oldest agent credential in production is, and whether anyone can say.
Overview
Agent credential management is the practice of securely handling the credentials an AI agent uses to reach the tools, APIs, data sources and enterprise systems it depends on. It's one of the disciplines that turns an agent from a liability into something you can trust to act on its own.
Why an agent needs a credential that's structurally its own, rather than a person's, is the foundational argument, and it belongs to a companion piece. This one takes that as settled and surveys what comes after: what counts as a credential, what each type's documented lifetime really is, where the discipline breaks under agents specifically, and the principles that keep it from breaking.
An agent without access does nothing useful. The moment you give it access you've created a surface that has to be governed, and credential management decides whether that surface stays scoped and legible or quietly becomes a standing risk nobody owns.
We think the load-bearing idea here is time, not the initial grant. Every agent should reach every system through a credential that's uniquely its own, narrowly scoped, securely stored, regularly rotated, and instantly revocable, for as long as the agent exists, not just at launch.
What Counts as a Credential
A credential is anything that proves an agent is allowed to do something. Agents accumulate a wide variety:
- API keys for SaaS platforms and internal services.
- OAuth tokens, both access and refresh, often delegated on behalf of a user.
- Service account credentials issued to the agent as a non-human identity.
- Database credentials for warehouses, transactional stores, and caches.
- Certificates and signing keys used for mutual TLS or message signing.
- Secrets such as webhook signing keys, encryption keys, or shared HMAC secrets.
Each is a separate thing to issue, store, rotate and retire. What makes the pile hard to reason about is that their documented lifetimes differ by four orders of magnitude, and no agent framework surfaces that difference.
| Credential | Documented lifetime | Revocation path |
|---|---|---|
| GitHub App installation access token | "The installation access token will expire after 1 hour" | Expiry. Scope it at mint time to named repositories and permissions |
| GitHub fine-grained personal access token | "Infinite lifetimes are allowed but may be blocked by a maximum lifetime policy set by your organization" | Delete it, or enforce a lifetime policy org-wide |
| Google Cloud service account key | Keys "don't have an expiry time and stay valid until you delete them" | Delete the key. Google's guidance is to avoid creating one at all |
| Azure managed identity | No credential you hold. "Credentials aren't even accessible to you" | System-assigned dies with the resource; user-assigned must be deleted explicitly |
| SPIFFE SVID | "Short lived, rotated frequently and automatically" | Expiry, in minutes to hours |
| Vault dynamic secret | A lease TTL you set. "When a lease is expired, Vault will automatically revoke that lease" | Revoke the lease, or a whole prefix at once |
| OAuth refresh token | Provider-specific, from hours to indefinite | RFC 7009 revocation endpoint, where the provider implements it |
Table 1 — Documented lifetimes, read from each vendor's own reference pages. One agent routinely holds several rows of this table at once.
The first and third rows are the pair worth staring at. Both are ordinary, both are platform-recommended for some use, and one expires before your deployment finishes while the other outlives the team that created it.
Why Agents Make This Hard
The more useful an agent becomes, the more systems it touches. Capability and access grow together, and that growth is what makes credentials hard to keep under control.
Take a hypothetical financial close agent that reconciles ledger entries at month end. It might need read access to the general ledger, write access to a journal-entry API, query access to a reporting warehouse, and read access to a banking integration. Four credentials, each with different scopes, owners and rotation requirements, for one agent doing one job.
Now multiply that across a procurement agent reaching the vendor master and a purchase-order system, a marketing agent reaching the campaign platform and the analytics API, and an IT operations agent reaching the ticketing system and the CMDB. Credentials sprawl quietly, faster than anyone tracks them.
Google's guidance on service account keys names the four threats that follow, and it is a useful checklist because it is not the one most teams write down: credential leakage, privilege escalation, information disclosure, and non-repudiation, a bad actor concealing their identity through service account misuse. Its recommendation is blunter than most vendor documentation gets: "choose a more secure alternative for authentication whenever possible", naming attached service accounts and Workload Identity Federation.
Agents also differ from traditional applications in a way that matters here: they're dynamic. They may be instantiated on demand, chain calls across many systems in one task, and act for different users at different moments. A credential model built for a long-lived, single-purpose service doesn't map onto that.
Figure 1 — A credential's lifecycle. Everything left of "Active" is a one-time setup step; everything at "Active" is where the discipline actually lives.
Common Failure Modes
When credentials are managed poorly, the same patterns recur. Each turns an agent into a security risk:
- Over-scoped tokens. An agent that only needs to read a report holds a token that can also write to the warehouse and delete tables.
- Shared keys. Several agents authenticate with one API key, so no log can tell you which agent actually made a given call. This is the non-repudiation failure by another name, and it is unfixable after the fact.
- Secrets in the wrong place. Credentials end up pasted into prompts, committed to repositories, baked into container images, or left in a notebook.
- Credentials that never rotate. A long-lived key issued at launch is still valid a year later, having been seen by every system and person who ever touched the agent.
- Lingering access after retirement. An agent is decommissioned, but its service account and tokens stay active, a working set of keys attached to nothing.
The unifying theme: each failure mode breaks one of two things, the ability to know which agent did what, or the ability to limit what any agent can do. Good credential management protects both.
Unique Identity
Credential management begins with identity. Each agent should hold credentials that are its own, so any action can be attributed to it specifically, not to "the account" that happened to be logged in. That's the shared-key failure mode made structural: a key two agents can present proves nothing about which one acted.
Unique identity is what makes everything downstream possible. Scoping, rotation, revocation and monitoring all assume a credential maps to exactly one agent. Where a platform forces shared service accounts, treat that as a gap to close.
Identity lifecycle is the part that bites later. Azure's two managed identity types differ on exactly this axis: a system-assigned identity has a "shared life cycle with the Azure resource" and is deleted with it, while a user-assigned identity has an "independent life cycle" and "must be explicitly deleted." The second is the one Microsoft recommends for most services, and the one that will still exist, still authorized, after the agent it was created for is gone. Write down who deletes the identity, and when.
Narrow Scope
A credential should grant only what the agent needs. An HR onboarding agent that creates accounts and assigns starter equipment has no business holding a token that can also read compensation records or terminate employees. The scope of the credential should mirror the scope of the job.
OWASP's LLM06:2025 Excessive Agency entry separates two things worth keeping apart. Excessive functionality is an agent holding tools it doesn't need. Excessive permissions is access rights to downstream systems that "exceed operational necessity", the credential-shaped half. Its recommendation for the second: "track user authorization and security scope to ensure actions taken on behalf of a user are executed on downstream systems in the context of that specific user."
The MCP specification's scope minimization section is the most concrete published guidance we know of on what over-scoping costs. It names wildcard scopes such as *, all and full-access as common mistakes, and lists the consequences in operational terms: a stolen broad token "enables unrelated tool/resource access", revoking a maximum-privilege token "disrupts all workflows", and a "single omnibus scope masks user intent per operation". Its prescription is progressive: start minimal, elevate through a WWW-Authenticate challenge carrying the scope actually required, and tolerate down-scoping, since a server "MAY issue a subset of requested scopes".
# Over-scoped: full admin on the analytics workspace
scopes: ["analytics:*"]
# Scoped to the job: read one dataset, write one report
scopes:
- "analytics:datasets:revenue:read"
- "analytics:reports:weekly-summary:write"Narrow scope limits blast radius. If a token leaks, a tightly scoped credential caps the damage to the surface it was issued for. Where the provider supports it, scope at mint time: GitHub's installation token endpoint accepts a repositories list and a permissions subset, and the resulting token cannot exceed what the app itself was granted.
Secure Storage
Credentials belong in a secrets manager, never hardcoded into prompts, source code, configuration files or notebooks. A secret pasted into a prompt can end up in logs, traces, or a model provider's records. A secret committed to a repository is public the moment it lands in history.
The agent should retrieve credentials at runtime, use them, and never persist them in its own context, the rung the Agent Access Control Taxonomy calls aact:credential-model/vaulted-secret-injected. Access to the vault is itself governed and logged, so even fetching a secret is traceable.
Two mature patterns remove the stored secret altogether. SPIFFE issues each workload an SVID, "the document with which a workload proves its identity", through a local Workload API, and because private keys are "short lived, rotated frequently and automatically", as the project puts it, "your application need not co-deploy any authentication secrets with the workload." Vault's dynamic secrets do the equivalent downstream: each is issued with a lease, and "when a lease is expired, Vault will automatically revoke that lease." Leases are hierarchical, so revoking a prefix revokes a tree of secrets at once.
Figure 2 — Call-time injection. The agent holds a reference, never the secret, which removes an entire class of leak.
Rotation & Revocation
Long-lived credentials accumulate risk by existing. The longer a key is valid, the more systems have seen it, the more people have had a chance to copy it, and the larger the window in which a leak goes unnoticed.
NIST SP 800-57 Part 1 gives the vocabulary and a number. A cryptoperiod is "the time span during which a specific key is authorized for use by legitimate entities", and a well-chosen one "limits the amount of exposure if a single key is compromised". Its recommendation for an authorization key, the class closest to what an agent presents, is that "a cryptoperiod be no more than two years", with symmetric authentication and data encryption keys likewise under two years of originator use. Two years is the ceiling, not a target. Read against Table 1, a service account key with no expiry sits outside what the standard contemplates.
Revocation is the other half, and it is weaker than most teams assume. RFC 7009 requires a compliant server to support refresh token revocation but only says it "SHOULD support the revocation of access tokens", returning unsupported_token_type when "the client tried to revoke an access token on a server not supporting this feature". Where it is supported, revoking a refresh token "SHOULD also invalidate all access tokens based on the same authorization grant". Three consequences follow. A revoked access token may still work until it expires. A provider may accept your request and revoke nothing. And a token deleted from your own storage is live at the provider until someone calls that endpoint, which is why clearing a local copy is not revocation.
A useful test: if an agent went rogue right now, how fast could you cut off every credential it holds? If the honest answer is "we'd have to go find them," the credential model isn't yet operational.
The operational form is short. Rotate on a schedule you own rather than on incident response. Prefer credentials that expire on their own, since expiry is the only revocation that never fails to be delivered. When you do revoke, verify with a call that should now fail. And treat revocation at decommissioning as a required step with a check attached, not a line in a runbook.
Usage Monitoring
Issuing credentials well isn't enough. Their use has to be visible, and this is the part of the discipline that's easiest to skip, because nothing about it feels urgent until the week it suddenly does.
The signals worth watching are deviations from an established pattern:
- A credential used from an unexpected environment or network location.
- A credential presented by an unexpected agent or process.
- A sudden change in volume or frequency of calls.
- An unusual action the credential has never been used for before.
For any of those to be computable, the record written per call has to carry the agent identity, the acting user, the credential reference and the scope actually exercised. Three of the four are missing from a default integration log, and the one usually present is the least useful alone.
When a hypothetical security-operations agent's database credential starts running bulk exports at three in the morning, that shouldn't be discovered weeks later in a breach review. It should surface the moment the pattern breaks, which is the "Flagged" branch in the lifecycle above.
In Practice
Putting this together doesn't require reinventing a security stack. Most of the building blocks already exist for human and service identities; the work is applying them to agents and wiring them into the agent's lifecycle.
A workable baseline looks like this. When an agent is provisioned it receives its own identity and narrowly scoped credentials minted from a vault. It fetches secrets at runtime and never stores them. Credentials carry short lifetimes and rotate automatically. Every use is logged against the agent's identity and the user it acted for, and that log feeds anomaly detection. At retirement, revocation is a required step, and it is checked rather than assumed.
The artefact that makes it auditable is usually missing: one record per credential, owned by a human, carrying the facts an auditor will ask for.
credential:
ref: cred_8f21 # what the agent holds, not the secret
agent: close-recon-v3
system: ledger-api
scopes: ["ledger:entries:read"]
issued: 2026-05-02
max_lifetime_days: 90 # policy, not hope
rotates: automatic
last_used: 2026-07-23T02:14:08Z # the field that finds dead credentials
owner: platform-finance
revocation: "POST /oauth/revoke, verified by a call that must 401"The payoff shows up the first time a hard question gets asked. When an auditor wants to know which systems a given agent could reach last quarter, or a security team needs to cut off a misbehaving agent in seconds, an enterprise with managed credentials answers immediately. One without it goes hunting through configs and code.
Where Fabriq Fits
Agentic Fabriq holds credentials per user in a vault and attaches them server-side at the moment of the call, so the agent never handles the secret and cannot leak what it never held, which is aact:credential-model/credential-never-exposed in the same taxonomy. Refresh runs automatically behind that boundary with last-used tracking per connection, which is what makes a dormant credential findable rather than theoretical. Every call carries two identities, the agent and the acting user, and produces an audit record, and an agent's effective tool list is the intersection of the user's scopes and its own.
What it does not do is reach into the provider for you. Clearing a vault copy is not the same act as invalidating a grant upstream, so the call to the provider's revocation endpoint is still yours to make.
Frequently Asked Questions
What is agent credential management? The discipline of issuing, scoping, storing, rotating, monitoring and revoking every credential an AI agent uses to reach a system, for as long as the agent exists. The distinguishing word is "every": a fleet holds far more credentials than identities, and the credential is the unit that leaks.
How is it different from secrets management? Secrets management is storage and distribution, one component of this. Credential management adds the lifecycle around it: whether the scope still matches the job, whether the credential rotates, who owns it, when it dies, and whether anyone can prove which agent used it.
How often should agent credentials rotate? More often than the standards' ceilings. NIST SP 800-57 recommends no more than two years for an authorization key, which is an upper bound for long-lived keys, not a target for an agent. Prefer lifetimes measured in hours and renewed automatically, which is what SPIFFE SVIDs, Vault leases and GitHub App installation tokens all do.
Can I use one service account for all my agents? You can, and you lose attribution permanently. Google's threat list for service account keys names non-repudiation, a bad actor concealing their identity through service account misuse, as one of four risks. No log can retroactively separate two agents that presented the same key.
What happens to credentials when an agent is retired? Whatever your decommissioning process explicitly does, and nothing more. An Azure system-assigned managed identity is deleted with its resource; a user-assigned one "must be explicitly deleted." Assume nothing cleans up on your behalf.
Is revoking a token enough? Often not. Under RFC 7009 a server must support revoking refresh tokens but only should support revoking access tokens, so an access token can remain valid until it expires, and a server that cannot revoke it answers unsupported_token_type. Revoke, then verify with a call that must now fail.
Should an agent use OAuth on behalf of a user, or its own service identity? Both, for different jobs. Anything acting for a person should carry that person's delegated grant, so the downstream system sees the right actor and scopes, which is what OWASP's guidance asks for. Anything acting for the organization should hold its own workload identity. The failure to avoid is a per-user job on a shared service credential, where attribution and scope disappear at once.
Conclusion
Agents can't act without access, and access is granted through credentials. That makes credential management load-bearing: it is the difference between access that's scoped, traceable and governable, and access that has quietly become a standing risk.
The practices aren't complicated. Give every agent its own identity, scope its credentials to its job, keep secrets out of the agent's context, prefer credentials that expire on their own, verify revocation rather than assuming it, and record enough per call to answer who did what with which credential. The discipline is doing all of it, for every agent, for as long as the agent is around.
Credential management decides whether an agent's access is something you control, or something that controls your exposure. Treat agent credentials as managed, scoped, and revocable from the day the agent is provisioned, not the day you discover they weren't.
Sources
All URLs read 2026-09-29.
- Agent Access Control Taxonomy — the credential-model dimension, whose four terms are the ladder this post walks: static secret in the agent, vaulted and injected, brokered short-lived token, and credential never exposed.
- NIST SP 800-57 Part 1 Rev. 5, Recommendation for Key Management — the definition of a cryptoperiod, what a well-chosen one limits, and the two-year recommendation for authorization keys.
- NIST SP 800-207, Zero Trust Architecture — per-session access decisions and least privilege as the model agent credentials should fit.
- RFC 7009, OAuth 2.0 Token Revocation — refresh token revocation as MUST, access token revocation as SHOULD, cascading invalidation, and
unsupported_token_type. - Best practices for managing service account keys, Google Cloud — keys with no expiry, the four threats including non-repudiation, and the recommendation to prefer attached service accounts or Workload Identity Federation.
- Managed identities for Azure resources, Microsoft Learn — credentials that "aren't even accessible to you", and the system-assigned versus user-assigned lifecycle difference.
- Generating an installation access token for a GitHub App — one-hour expiry, and scoping a token to specific repositories and a subset of permissions.
- Managing your personal access tokens, GitHub Docs — infinite lifetimes allowed unless an organization or enterprise maximum-lifetime policy blocks them.
- SPIFFE concepts — SPIFFE IDs, SVIDs, the Workload API, and short-lived automatically rotated keys with no co-deployed secrets.
- Lease, renew, and revoke, HashiCorp Vault documentation — lease TTLs, automatic revocation at expiry, and prefix revocation of secret trees.
- OWASP LLM06:2025 Excessive Agency — excessive functionality versus excessive permissions, and tracking user authorization so downstream actions run in that user's context.
- MCP Security Best Practices, Scope Minimization — the cost of omnibus scopes, progressive elevation through scope challenges, and down-scoping tolerance.