AI agent authentication: from secrets to workload identity
Shared, long-lived credentials are the anti-pattern for AI agent authentication. Here's how workload identity, scoped tokens, and verified context replace them.
Updated
16 min read

Member of Product Management @DevRev
Anirudh Shenoy
16 min read

Member of Product Management @DevRev
Anirudh Shenoy
Updated
16 min read

Member of Product Management @DevRev
Anirudh Shenoy
16 min read

Member of Product Management @DevRev
Anirudh Shenoy
TL;DR
- Make AI agent authentication specific to the request. Verify the workload, preserve the acting context, and restrict where its credential can be used.
- Shared, long-lived credentials make exposure and rotation harder to contain. API keys can have scopes, but a shared key alone doesn’t identify the requesting employee.
- Workload identity, federation, delegated context, and per-task token issuance are complementary choices. Combine them around the execution model, rather than treating them as maturity stages.
- Short-lived tokens still need validation and replay controls. Neither task completion nor token exchange automatically revokes an issued credential.
What is AI agent authentication?
AI agent authentication verifies the software identity making a request to a system or service. It relies on trusted credentials and validation, not the agent’s self-description. For delegated work, the credential flow also needs verified context about the person or service represented. Authentication establishes identity; authorization determines permitted access.
What does the shared credential actually prove?
Ask one question in your next credential review: “Which identity does this credential prove, and why should the receiving service trust it?”
“The support agent uses a service account” isn’t a complete answer. You still need to know which workload can obtain that account’s credential. And if an employee starts the task, you’ll also need to establish how their identity reaches the downstream service.
Consider a support agent that reads case histories for employees across teams. A shared API key might identify the integration reliably. By itself, it doesn’t distinguish which employee requested a particular lookup. If the API accepts only that key, every request arrives with the integration’s credential context.
That creates an over-privilege problem. First, the credential flow loses the requesting person’s identity. Adding an employee’s name to a prompt won’t repair it. The name needs a trusted source and protection against substitution.
The problem is sharing and persistence, not the label
API keys can be scoped, limited to particular resources, and revoked. A service account is an identity, not a synonym for an insecure credential. Background automation often needs a service identity with an accountable owner.
The fragile design combines broad reuse, long validity, and unclear ownership. One secret copied into a deployment variable, a developer’s environment, and a debugging script now has several exposure paths. Test the retired copy. Rotation hasn’t finished if the receiving service still accepts it.
OWASP’s Non-Human Identities Top 10 identifies long-lived secrets, secret leakage, and identity reuse as distinct risks. Treat them separately in AI agent credential management. A shorter lifetime addresses exposure duration; separate credentials address reuse; neither substitutes for protecting credentials in transit and storage.
Rotation has to include the consumers
Before replacing a shared key, identify every process that uses it and how each receives the replacement. Test an ordinary request after rotation, then test the retired credential. The first should succeed through the intended path; the second should fail.
The non-human identity framework covers ownership and retirement. Keep AI agent authentication reviews focused on the credential’s path.
That path also belongs on the build vs buy: identity axis. Whether your team operates the token service or evaluates a platform, someone must own issuance, validation, rotation, and emergency invalidation.
Compare credential choices for AI agent authentication
A production agent can use workload identity, federation, and task-scoped tokens in the same request. These choices solve different problems; they aren’t steps on a maturity ladder.
| Design choice | What it establishes or enables | Lifetime and context | What you still need |
|---|---|---|---|
| API key or shared secret | Possession of a credential associated with an account or integration | Scope and expiry depend on the service; shared possession doesn’t identify the requesting employee | Protected storage, separate ownership, rotation, and any required delegated context |
| Federation | Acceptance of identity evidence from another trusted issuer | Assertion and token lifetimes follow configured policies; person or workload context depends on the flow | Explicit issuer trust, subject mapping, audience checks, and supported exchanges |
| Workload identity | A verifiable identity for running software | Credentials may be short-lived and renewed; no employee identity is implied | Runtime attestation or equivalent trust, protected keys, and downstream acceptance |
| Per-task or per-skill token issuance | A credential issued for a bounded execution context | Issuer-defined expiry and scope; delegated or service authority must be explicit | Issuance policy, scope enforcement, validation, and defined cancellation behavior |
In short: combine controls to prove the workload, represent the right authority, and limit credential exposure; no row provides all three alone.
Scoped secrets can be a constrained fallback
A downstream API may accept only API keys. You can’t remove that requirement by renaming your integration “secretless.” Instead, isolate the credential, limit its scope where supported, and keep it out of model-visible inputs.
Document that boundary. If your execution service authenticates dynamically but translates requests into a stored downstream key, the downstream credential still needs management. Evaluate both sides of the translation.
Federation moves trust across a boundary
Federation lets a receiving system rely on identity evidence from an issuer it trusts. It can reduce the need to provision another standing credential for every connection. But you still have to define which issuer, subjects, and audiences the receiving system accepts.
For example, accepting assertions from a development environment shouldn’t automatically admit workloads from that environment into production. The configured trust relationship, not the word “federated,” determines the boundary.
Workload identity supplies the software principal
Workload identity gives your running agent software a verifiable identity, rather than relying only on a copied application secret. Attestation checks evidence about the runtime before credentials are issued.
This can remove long-lived application secrets from deployment configuration. It doesn’t remove cryptography, private-key handling, or the need to establish initial trust. Ask who can obtain the workload credential and what prevents another process from claiming the same identity.
Per-skill issuance narrows the moment of use
A skill is a bounded capability the agent invokes, such as retrieving a case history. Issuing a credential when that skill executes can avoid handing every task the same standing access token.
The issuer still decides what to issue. A request for a narrow token isn’t evidence that the resulting token is narrow. Inspect the granted scope, intended recipient, and expiry, then test what the recipient actually accepts.
How does AI agent authentication preserve acting context?
Preserve acting context through authenticated inputs to the credential flow, not through names supplied by the model. Distinguish the agent executing the request from the person or service whose authority supports it. Keep those identities connected without pretending they’re interchangeable.
For a delegated case lookup, the employee signs in through the application’s trusted identity flow. The execution service separately establishes the agent workload’s identity. A token service then evaluates the supplied evidence and requested target before issuing a credential the downstream API understands.
A background case-reconciliation job follows a different path. It may run under service authority with no employee session. Give that service principal an owner, purpose, and bounded scope; don’t insert a fictional person into its identity claims.
Inspect the credential contract
For AI agent token exchange, review these fields or their equivalents in the deployed token format:
- Issuer: Which trusted authority issued the credential, and how does the recipient associate it with verification keys?
- Subject: Which principal does the credential describe? Confirm the meaning within that issuer’s namespace.
- Actor: Which agent or service acts for the subject, if this is delegated execution?
- Audience: Which API or recipient is supposed to accept this credential?
- Lifetime: When does validity begin and end, and what clock tolerance does the recipient allow?
- Scope: Which requested capabilities did the issuer actually grant for this execution?
This isn’t a universal token schema. Opaque tokens may require server-side validation rather than local claim inspection. A JSON Web Token, or JWT, exposes structured claims, but decoding those claims doesn’t validate them.
For example, a token intended for case retrieval shouldn’t be accepted by an unrelated administrative API. The wrong audience should fail even when the signature is valid. Test rejection, too.
Issue for the execution, then verify the limits
Reusing the agent’s standing credential for every skill makes execution-specific restrictions harder to express and inspect. DevRev uses per-skill token minting in Computer, by DevRev, issuing short-lived, least-privilege tokens at execution time. DevRev’s token-exchange implementation uses an `act_as` claim to represent the acting context. That claim is implementation-specific, not the standardized actor claim defined by RFC 8693.
The broader design question applies to any implementation: what happens after issuance? A task finishing doesn’t automatically expire its token. The issuer sets the token’s time to live, or TTL, and the recipient has to enforce validity.
Choose that lifetime against the expected operation, retry behavior, and acceptable exposure. Don’t adopt a universal “seconds versus hours” rule without examining the workflow. A queued task might need fresh issuance when execution begins, rather than reusing a credential minted before the queue delay.
Define cancellation separately. RFC 8693’s token-exchange specification explicitly says revocation propagation isn’t a general property of token exchange. Revoking an input token doesn’t automatically invalidate every token issued from it. Require an explicit mechanism and test its behavior.
When the agent hands work to another agent, the credential connection becomes part of delegated-task accountability. That handoff needs its own contract; copying an access token isn’t enough.
Which standards cover each part of the credential path?
AI agent authentication draws on existing identity and access standards, but those standards have different jobs. During an October 2026 rollout review, ask which protocol governs each boundary and which implementation enforces it.
A list of supported acronyms isn’t an architecture. Nor does discussing a standard establish that a particular platform supports it.
OAuth governs authorization; OIDC adds end-user identity
The OAuth 2.0 authorization framework enables limited access to protected services. It supports resource-owner authorization and an application’s own authority, including through the client credentials grant. Client authentication can be part of that flow, but OAuth itself isn’t an end-user authentication protocol.
OpenID Connect Core, or OIDC, adds an end-user identity layer over OAuth. Its ID token conveys claims about the person’s authentication to the client. An ID token isn’t a general-purpose access token for downstream APIs.
Keep that distinction visible in design reviews. “We use OIDC” explains part of employee sign-in; it doesn’t explain how an agent obtains an API credential.
As of September 17, 2026, OAuth 2.1 remains an active Internet-Draft, not a finalized RFC. Use current published security guidance alongside the specific flows your deployment implements, and recheck draft status before launch.
Token exchange represents subjects and actors
RFC 8693 defines an OAuth token-exchange mechanism, including support for delegation and impersonation scenarios. It defines `act` to identify the acting party when delegation has occurred. It defines `may_act` to identify a party eligible to become the actor.
Neither field means “copy whatever identity the agent requested.” The authorization server must evaluate the submitted tokens and apply its policy. Request parameters can express the desired audience, resource, and scope; they don’t guarantee the server grants them.
SPIFFE and SPIRE address workload identity
SPIFFE defines standards for identifying software across environments, including verifiable identity documents called SVIDs. Workloads can use these cryptographic documents when authenticating to other workloads. SPIRE implements SPIFFE capabilities, including attestation-based issuance.
An SVID can establish the software principal without establishing an employee’s delegated authority. The service still needs a supported mechanism to connect that workload identity to any person-associated access. Protect the attestation configuration and trust material, not just the issued credential.
SCIM and NIST address different lifecycle and identity concerns
SCIM’s protocol specification, RFC 7644, standardizes identity-management operations across domains. It can support provisioning and deprovisioning where the connected systems implement the required resources and schemas. Don’t assume a generic SCIM connection provisions agent identities or revokes their active tokens.
NIST SP 800-63-4 addresses human digital identity, including identity proofing, authentication, and federation assurance. It says it does not explicitly address machine-to-machine authentication or API access on behalf of subjects. Use it for the employee identity context, not as an agent-authentication certification or machine assurance framework.
Validation and replay controls complete the path
The recipient has work to do after a token arrives. JWT security best practices, RFC 8725, require appropriate algorithm verification and validation of issuer, subject, and audience. A valid signature protects integrity; it doesn’t independently authorize a request or prove the presenter is the intended workload.
A bearer token can be used by whoever possesses it. The OAuth security best current practice, RFC 9700, recommends audience restrictions and sender-constrained access tokens. Sender constraints require the presenter to prove possession of associated key material. Mechanisms include mutual TLS, or mTLS, and Demonstrating Proof of Possession, or DPoP, where supported.
Keep credentials out of prompts, tool outputs, application logs, and exported traces. Redact authorization headers before instrumentation records them. Record safe identifiers and validation outcomes instead, so debugging doesn’t create a second credential distribution system.
Include these checks in your AI agent security review checklist. Token expiry limits an exposure window; it doesn’t make that window harmless.
From authentication to authorization
Authentication gives the receiving service a validated identity context. Authorization decides whether that context permits the requested operation. A correctly authenticated agent can still receive an access denial; that’s expected behavior.
For delegated execution, the permission decision may need both the agent’s privileges and the requesting person’s privileges. A signed claim can carry those identities, but it doesn’t calculate their permission intersection. The configured policy and enforcement points must do that work.
AI agent authorization: the intersection model covers that next boundary. Keep the credential review’s outcome precise: you know whose request arrived, why its identity evidence is trusted, and where its credential is valid.
Follow one credential all the way through
Before your next rollout, choose one real skill execution and trace its credential from issuance to expiry. Identify the issuing authority, the evidence it accepted, the resulting subject and actor, and the intended recipient.
Then inspect the awkward cases: the request reaches the wrong API, waits in a queue, retries after cancellation, or leaves a debugging trace. Confirm when the token stops working and what can invalidate it earlier.
Your credential review is complete when your team can explain both acceptance and rejection.
Frequently asked questions
These questions separate AI agent auth mechanisms from the assumptions that often accompany them.
How do AI agents authenticate in enterprise environments?
AI agents authenticate through credentials that receiving systems can validate, such as workload certificates or trusted assertions. They may then obtain scoped access tokens for downstream APIs. The design should distinguish the agent workload from any represented person or service, validate intended recipients, and define credential expiry and invalidation behavior.
What’s the difference between agent and human authentication?
Human authentication verifies a person through authenticators such as passkeys or multifactor authentication. Agent authentication verifies running software through its credential and trust chain. In delegated workflows, both identities matter: the person supplies the initiating context, while the agent executes. Background agents can instead operate under separately governed service authority.
Are API keys always unsafe for AI agents?
No. API keys can have scopes and revocation controls, depending on the service. The concern is a key shared across workloads, exposed in traces, or accepted indefinitely. A shared key alone also doesn’t establish which employee requested a task. Prefer separate, constrained credentials and dynamic issuance where supported.
What is workload identity for AI agents?
Workload identity assigns a verifiable software identity to an agent’s runtime, such as a container or service. It can replace long-lived application secrets with dynamically issued credentials. It doesn’t eliminate private keys, trust configuration, or credential protection, and it doesn’t automatically provide the identity of a person requesting work.
Which standards apply to AI agent authentication?
OAuth governs access authorization, while OIDC establishes end-user identity. RFC 8693 specifies token exchange and actor claims. SPIFFE defines workload identity documents, and SPIRE implements attestation-based issuance. SCIM supports provisioning where schemas permit it. JWT and OAuth security guidance cover validation and token protection; no single standard supplies the complete architecture.
DEVREV
See Computer work for you
Your AI teammate that finds answers, takes action, and gets work done across every tool.
Computer+ Apps
Our customers
Resources
Initiatives



