← All posts
AI / LLM Strategy

Agent Identity Is Your Next Security Problem: Authenticating AI Agents in 2026

Your AI agents are logging in as humans with shared API keys and production-level scope. That is the confused deputy problem with venture funding behind it. Here is the fractional CTO's playbook for giving agents real identities and scoped delegation — before your first incident.

Craig Hoffmeyer10 min read

A founder I have been advising for a year called me in late March. Her team had built a support automation agent — it read customer emails, pulled account data from their CRM, queried billing, and drafted responses that a human approved before sending. For six months it worked beautifully. Then on a Tuesday morning she got a Slack ping from her head of security: the agent had cleared out a prospect's Salesforce pipeline, updated a dozen opportunity stages to "Closed Lost," and sent four apology emails before anyone noticed. The root cause was not a model hallucination. A prompt injection hidden in an inbound email had convinced the agent to run destructive CRM operations, and the agent had the permissions to do it because it was authenticating as a shared service account with full admin scope on Salesforce. "I thought we were careful," she said. "The agent had its own API key." That was the problem. The agent had a key. It did not have an identity.

This is the pattern that is going to define the next eighteen months of AI security work. Gartner projects that by the end of 2026, 30% of enterprises will be running AI agents that act with minimal human intervention. Beam AI reported that 88% of organizations already running agents experienced a confirmed or suspected security incident in the prior year. The 2026 Saviynt CISO survey found that 47% of CISOs have observed agents exhibiting unintended or unauthorized behavior in production. None of those numbers are about model quality. They are about identity, delegation, and scope — the boring plumbing that traditional IAM solved for humans and that we have collectively not yet solved for agents.

Why the usual auth pattern is broken for agents

The typical AI agent in April 2026 authenticates one of three ways, and all three are wrong at scale.

The first pattern is a static API key for the agent itself — a long-lived secret minted in the CRM or database admin panel, stored in an environment variable, and shared across every invocation of the agent. Every user of the agent, every task the agent runs, every tool it calls, authenticates as the same principal with the same scope. There is no way to answer the basic audit question: which user's request caused the agent to run that delete? There is also no way to enforce least privilege. If the agent can issue refunds, it can issue them for every customer, not just the one whose ticket is currently being processed.

The second pattern is a shared service account — essentially the same problem dressed up in OIDC. The agent runs as support-agent@acme.com and inherits the full permission set of that account. Compromise the agent and you have compromised the service account; compromise the service account and you have compromised every downstream system the agent touches. Meta's widely reported incident last fall, in which a rogue agent passed every existing identity check and still caused a data exposure, was exactly this shape. The agent had legitimate credentials. What it did not have was a way to distinguish "I am acting for user A" from "I am acting for user B."

The third pattern is straight token passthrough — the application reuses a human user's OAuth token and hands it directly to the agent and then to downstream tools. The MCP specification explicitly forbids this, and developers do it anyway because it is the path of least resistance. The result is that the agent has exactly the user's scope, including scopes the current task does not remotely need, and you now have a long-lived user token sitting in an agent's context window where any prompt injection can exfiltrate it.

What all three patterns share is the confused deputy problem. The deputy (the agent) has authority it did not need for the task at hand. The attacker (a prompt injection, a compromised tool, a malicious peer agent) convinces the deputy to exercise that authority on their behalf. This is a forty-year-old class of vulnerability, and agentic AI is the most powerful amplifier of it we have ever shipped. An agent with broad scope, natural-language instructions, and machine-speed execution is a confused deputy waiting for the right input.

The architecture I now recommend

The fix is not a new product. It is a composition of three standards that already exist, applied in an order most teams have not yet taken seriously.

First, give every agent its own identity — distinct from users, distinct from services, cryptographically attestable. In practice this means a SPIFFE ID or a WIMSE workload identity token, issued by your workload identity system, renewed on a short cycle, and tied to the specific process or container running the agent. The IETF's WIMSE working group has been standardizing this since 2024, and the draft-klrc-aiagent-auth-00 draft published on March 2, 2026 formalizes how agent identities compose with OAuth. If you are running on Kubernetes, SPIRE gives you this out of the box. If you are on a managed platform, your cloud provider's workload identity feature is fine. The key property is that the agent's identity is something the agent is, not something the agent has.

Second, handle user delegation through OAuth 2.0 Token Exchange (RFC 8693). When a user asks the agent to do something, the application exchanges the user's access token for a new, narrowly-scoped token that carries two pieces of information: the subject (the user who authorized this), and the actor (the agent that is acting on their behalf). The downstream API sees both. Authorization decisions can reference both. Audit logs capture both. The emerging IETF draft draft-oauth-ai-agents-on-behalf-of-user-01 adds two explicit parameters — requested_actor at the authorization endpoint and actor_token at the token endpoint — that make this a first-class OAuth flow rather than a hack on top of client_credentials. If your authorization server supports token exchange (Auth0, Okta, Curity, PingAM, Keycloak, ZITADEL all do in 2026), you can adopt this today without rewriting your IdP.

Third, scope every token to a specific resource using RFC 8707 Resource Indicators. When the agent requests a token to call your billing service, the request includes resource=https://billing.acme.com, and the resulting token is only valid against that service. If the agent is tricked into calling a different service with the token, the target rejects it. This is the single most effective mitigation against the confused deputy problem that does not require rewriting your agent. It is also required by the new MCP Authorization Specification, which treats every MCP server as an OAuth 2.1 resource server and mandates resource-indicator-scoped tokens for every client.

The composition looks like this at runtime. The user authenticates to your app and receives a normal access token. The user asks the agent to do something. Your app calls your authorization server's token exchange endpoint, passing the user's token, the agent's WIMSE/SPIFFE identity as the actor, and a resource indicator for the specific downstream service the agent needs next. The authorization server returns a short-lived (minutes, not days), narrowly-scoped (one resource, one or two scopes) token where the sub claim is the user, the act claim is the agent, and the aud claim is the resource. The agent uses that token to call the tool. The tool validates all three claims, authorizes against both the subject and the actor, and logs all three. Every step of the chain has context. Every step can be audited. And a prompt injection in the agent's input cannot escalate the token because the token is already the minimum.

A concrete example

Let me walk through the support agent incident I opened with, fixed.

Before: the agent authenticates to Salesforce using a static API key tied to a service account with api_enabled, modify_all_data, and send_email. A prompt injection in an inbound email convinces the agent to loop through open opportunities and update their stages. Salesforce sees a legitimate admin service account making legitimate API calls and logs them as such. No user attribution. No scope restriction. No blast radius limit.

After: the agent has a SPIFFE ID (spiffe://acme.com/support-agent/v2) issued fresh every hour by SPIRE. When a customer email arrives, the app looks up the customer's account owner (a human user, Riley), exchanges Riley's standing Salesforce token for a task-scoped token with sub=riley@acme.com, act=spiffe://acme.com/support-agent/v2, aud=https://salesforce.com/api, scope read:cases write:case_comments — no modify_all_data, no bulk operations, no access to pipeline. The token expires in five minutes. If a prompt injection arrives, the worst the agent can do is write a case comment on one of Riley's cases. The pipeline is untouchable. The apology emails are not sendable. The incident does not happen.

Same agent, same model, same prompt injection. Different identity architecture, different outcome.

The vendor and standards landscape in 2026

This space has moved faster in the last nine months than it did in the prior five years, so a quick field survey is useful.

On the IdP side, Auth0 for AI Agents went GA in October 2025 with token vaults, async approvals, and fine-grained delegation. Okta for AI Agents reached GA on April 30, 2026 with a broader identity-fabric framing including agent lifecycle management, Cross App Access (XAA — an open OAuth extension for agent-to-app delegation), and verifiable credentials. Strata, Aembit, and Token.io have emerged as specialized agent-identity platforms with multi-IdP and multi-protocol support. If you are already on Auth0 or Okta, you do not need to change vendors. You need to turn on the features.

On the standards side, the MCP Authorization Specification in its current draft mandates OAuth 2.1 and RFC 8707 Resource Indicators for every MCP client and server. The IETF WIMSE working group has published workload-identity practices and identifier drafts. draft-klrc-aiagent-auth-00 composes WIMSE, SPIFFE, and OAuth into a framework (AIMS) that is rapidly becoming the reference model. The direction of travel is unmistakable: agents get workload identities, users delegate through token exchange, tokens are resource-scoped, and audit is end-to-end.

On the open-source side, SPIRE remains the reference SPIFFE implementation. Keycloak 26 added native token-exchange support with actor claims. LiteLLM and Portkey both now support per-request actor claims at the gateway layer, which is how most teams will actually roll this out in practice — not by rewriting every agent, but by terminating identity at the AI gateway and propagating actor claims downstream.

The counterpoint — when the simple pattern is fine

Because I am a fractional CTO and not a vendor, here is the honest counter-case. If your agent is a nightly batch job that calls one internal API with read-only scope, and the input to that agent comes exclusively from your own database, a static service credential is fine. Identity architecture solves a blast-radius problem. If you do not have a blast radius — no user-supplied input, no destructive operations, no multi-tenant data — you do not need this yet. Add a scoped API key, a dashboard for the cost, and move on.

The inflection point is any one of four conditions. First, the agent takes user-supplied input — emails, chat messages, uploaded documents, anything a user can influence. Second, the agent performs destructive or state-changing operations — writes, deletes, sends, transacts. Third, the agent crosses tenant boundaries in a multi-tenant product. Fourth, the agent is subject to audit — SOC 2, HIPAA, any regulated data. If any of those are true, you are past the point where a shared service account is acceptable. If two or more are true, you are one prompt injection away from a board-level incident.

Your action checklist

Here is what I would do in the next two weeks if you are shipping agents without an identity story.

  1. Inventory every agent in your environment. Include background jobs, embedded copilots, and third-party agents accessing your APIs. You cannot govern what you cannot see. In my experience, most teams find 30–50% more "agents" than they expected once they count everything that calls an LLM on a schedule.

  2. Map each agent's current auth pattern. Static API key, shared service account, or token passthrough? Which scopes does it hold? Which tools can it call? Which tenants can it reach? This is the risk register.

  3. Pick one agent to lead with. Ideally the one with the highest blast radius — destructive operations, user-supplied input, enterprise tenant. Do not boil the ocean.

  4. Give that agent its own workload identity. SPIRE if you are on Kubernetes, cloud workload identity otherwise. The agent should renew its identity on a short cycle and never hold a long-lived secret.

  5. Implement token exchange for user-delegated calls. Use RFC 8693 with your existing IdP. Pass the agent's workload identity as the actor_token. Pass the user's token as the subject_token. Request a token for exactly one downstream resource using RFC 8707 resource indicators.

  6. Constrain the resulting token. Minutes, not days, on lifetime. Minimum viable scope. Resource-pinned. If the token leaks, the blast radius is one call to one resource for one user for five minutes.

  7. Log the actor claim downstream. Your tools should log sub, act, and aud on every request. If you only log sub, you cannot tell a user's action from an agent's action, and your incident response will be blind.

  8. Test the prompt-injection case. In staging, feed your agent an obvious injection payload and verify the agent cannot exceed its scope. If it can, you are not done.

  9. Write the runbook. What happens when an agent identity is compromised? Rotation procedure, revocation, downstream impact. Your incident response plan needs an "agent compromise" scenario, not just a "user compromise" scenario.

Most teams can finish steps 1–5 in a sprint. Steps 6–9 take another sprint and usually surface two or three policy decisions that want a founder in the room.

Where I come in

Agent identity is where most of my 2026 fractional CTO engagements are running into walls. Not because the standards are missing — they are not — but because teams are shipping agents faster than they are designing for how agents should authenticate, delegate, and be audited. If you are weeks away from an enterprise security review, or you just had a close call, or you are wondering whether your agent architecture will survive its first determined prompt injection, this is the conversation. Book a 30-minute call and bring one agent you are worried about — we will map its identity and scope in the first twenty minutes, and you will leave with a remediation plan you can hand to an engineer the same day.


Related reading: AI Safety for Startups: Minimum Viable Guardrails · The Multi-Agent Playbook · The MCP Playbook for SaaS Founders · MCP for Developers · Security Review for AI-Generated Code · Data Privacy in an AI-First Product

Shipping AI agents? Let's talk identity and delegation.

Get in touch →