Getting Your First Agent Live

How to Give Your Agent Its Own Identity Without Sharing Credentials

Matt DoughtyMatt DoughtyCEO & Co-Founder, Prefactor
6 min read
Abstract illustration: How to Give Your Agent Its Own Identity Without Sharing Credentials

Agent identity authentication in production means every agent holds credentials that belong to it alone, scoped to what it needs, revocable without touching any human account or shared key. The alternative, inheriting a user’s token or reusing a team API key, works in a demo but collapses the moment you need an audit trail, want to revoke one agent without disrupting others, or must prove to a regulator which identity authorized a transaction.

Why Inherited Credentials Fail in Production

When an agent runs under a human user’s session token, every action it takes is attributed to that user. The agent can read anything the user can read, write anything the user can write, and there is no log entry that distinguishes the agent’s action from the human’s. When the user logs out, the agent loses access mid-task. When the agent misbehaves, the audit trail points at a person.

Shared API keys compound the problem. A key issued to a team has no owner, no expiry policy tied to any individual, and no scope narrower than whatever the original author decided. Rotating it breaks every agent and integration that uses it simultaneously.

The scale of this problem is not hypothetical. According to the Gravitee State of AI Agent Security 2026 Report, 88% of organizations reported suspected or confirmed AI agent security incidents in the past year, yet only 22% treat agents as independent identity-bearing entities. In the same survey, 45.6% of enterprises still authenticate agents with shared API keys.

For teams building their first multi-agent system or managing an expanding agent estate, the credential inheritance trap is the most common thing that stops a working prototype from becoming a trustworthy production service.

What Makes Agent Identity Distinct

An agent identity has three properties a service account or inherited token cannot provide:

A delegation chain. The agent acts on behalf of a user, but it is not that user. The chain records: user consented, agent acted, downstream resource accepted. Each link is auditable independently.

Session-scoped authority. The agent’s token covers one session and expires when that session ends. There is no standing access between tasks.

Independent lifecycle. The agent can be suspended, have its permissions narrowed, or be deprovisioned without affecting the human account that originally authorized it.

flowchart TD
    A[User grants consent] --> B[Auth server issues\ndelegated token]
    B --> C[Agent receives\nscoped session token]
    C --> D{Task complete\nor session ended?}
    D -- Yes --> E[Token expires]
    D -- No --> F[Agent calls\ndownstream API]
    F --> C
    E --> G[No standing access remains]

This structure is what AI agent governance frameworks require when they talk about accountability. Without it, you cannot answer “which agent did this, under whose authority, and what was the scope of that authority” from a single log query.

The Three Authentication Patterns That Work

OAuth 2.1 with Token Exchange

OAuth 2.1 tightens the original OAuth 2.0 spec by removing implicit grants and requiring PKCE. For agents, the relevant addition is RFC 8693 token exchange: the agent presents the user’s delegated consent to the authorization server and receives a new token minted for the agent-user pair. That token carries the agent’s identity, not the user’s, and is scoped to the permissions the user explicitly granted.

Intercom’s Fin agent uses OAuth-based scoping rather than inheriting customer session tokens. Fin handles over 2 million resolutions per week across 12,000 customers, and each agent authenticates independently. That separation is what makes per-customer audit trails possible at that volume.

Scoped Tokens with Short Expiry

A scoped token limits what the agent can touch. “Read orders for customer 4821 during this session” is a scope. “Full access to the orders service” is not. Combined with a short expiry, usually measured in minutes rather than hours, a compromised token has a narrow blast radius in time and in permission space.

Amazon Bedrock AgentCore Identity issues tokens that expire within minutes, with each agent in a deployment carrying its own IAM role. Swisscom runs customer support agents on this infrastructure, with VPC-isolated endpoints ensuring that a session boundary is also a network boundary.

Workload Identity Certificates

For agent-to-agent calls inside a system, mTLS with workload identity certificates lets each agent prove its identity to another without a human in the loop. The certificate is bound to the agent’s deployment identity, not to any person. This matters most in multi-agent orchestration where a coordinator agent spawns subagents: each subagent needs to prove what it is, not just present a token it was handed.

flowchart TD
    A[Coordinator agent] -->|requests subagent| B[Auth server]
    B -->|issues scoped cert| C[Subagent A]
    B -->|issues scoped cert| D[Subagent B]
    C -->|mTLS call| E[Tool or API]
    D -->|mTLS call| F[Tool or API]
    E --> G[Log: Subagent A, cert ID, timestamp]
    F --> H[Log: Subagent B, cert ID, timestamp]

Managing Credentials the Agent Never Sees

One practical pattern is to keep the agent entirely out of raw credential handling. A token vault sits between the agent and downstream APIs: the agent requests access to a tool, the vault retrieves the credential server-side, and the agent receives a short-lived proxy token. The agent never holds the upstream secret.

Nango operates this way across 1,000 or more APIs, with hundreds of AI companies using it in production. When an MCP server retrieves a token server-side, the agent calling that server cannot exfiltrate the underlying credential even if the agent itself is compromised. For teams using MCP architecture, this pattern fits naturally: the MCP server becomes the credential boundary.

Platforms like Prefactor take a similar approach as a category example of agent credential lifecycle management, where the agent’s identity is registered centrally and downstream tokens are dispensed per-task.

Keeping the Audit Trail Intact

The Palo Alto Networks 2026 Identity Security Landscape Report found that machine and AI agent identities outnumber human identities 109 to 1 in the average enterprise. At that ratio, audit logs built around human identity patterns break down. Each agent action needs to carry: the agent’s own identifier, the user on whose behalf it acted, the session identifier, and the scope in force at the time of the call.

Okta for AI Agents, generally available since April 2026, registers each agent as a first-class identity with its own lifecycle and audit trail. Early production customers including Ramp and Dell Technologies use this to distinguish agent-initiated actions from human-initiated ones in the same system, which is the minimum requirement for incident investigation at scale.

If you are building AI agent security controls for the first time, start with the log schema. If you cannot query “all actions taken by agent X on behalf of user Y in session Z,” your identity model is incomplete regardless of which authentication protocol you use.

For enterprise AI security, the identity model also needs to account for agents that act without a human in the loop at all. Those agents still need a first-party identity, still need scoped authority, and still need their actions to be attributable. The delegation chain just starts at a system policy rather than a user consent screen.

Where to Start

If your agents currently run under shared keys or inherited user tokens, the fastest path to a production-safe identity model is to register each agent as a distinct workload identity, replace standing credentials with short-lived scoped tokens, and add the four-field log schema above to every tool call. Take the agent readiness assessment to find the specific gaps in your current setup and get a prioritized list of changes to make before your agent estate grows further.

Matt DoughtyMatt DoughtyCEO & Co-Founder, Prefactor

Founder of Prefactor, writing on the operational reality of getting AI agents into production — evaluation, observability, governance, and the plumbing assistants never needed.

Frequently asked questions

What is agent identity authentication in production and why does it differ from service accounts?

Agent identity authentication in production means each agent holds its own credentials, with its own lifecycle and audit trail, rather than borrowing a human or service account's token. Service accounts have no concept of acting on behalf of a specific user, no built-in delegation chain, and no session-scoped expiry, so they cannot satisfy the auditability requirements that production agents face.

How does Okta for AI Agents assign a distinct identity to each agent?

Okta for AI Agents, generally available since April 2026, registers each agent as a first-class identity with its own permissions, lifecycle, and audit log entry. When an agent calls a downstream API, the request carries that agent's identity rather than a shared service-account token, so revocation and inspection are scoped to that one agent.

What is the OAuth 2.1 token exchange flow for AI agents acting on behalf of a user?

The agent requests a token from the authorization server, presenting the user's delegated consent as proof. The server issues a short-lived, scoped token tied to that agent-user pair. The agent uses it for the session, then the token expires, leaving no standing access. RFC 8693 token exchange covers the mechanics.

How does Amazon Bedrock AgentCore Identity handle session-scoped tokens?

Amazon Bedrock AgentCore Identity, powered by Amazon Cognito, issues tokens that expire within minutes and are scoped to a single agent session. Each agent in a deployment gets its own IAM role, so a compromised session cannot escalate to resources belonging to a different agent or the platform account.

Stay ahead of the curve

No spam. Unsubscribe anytime. A resource by Prefactor.

Almost there — check your inbox to confirm your subscription.