AI agent identity is the identity an AI agent proves when it calls a database, an API or a server, together with a record of the person it is working for. Those two parts are trusted for different reasons. A signature proves which agent sent the request, while the person is a statement made by the platform that ran the agent.

Agentic identity, as it’s also called, became a real problem once agents started acting between prompts. A coding agent in a terminal has no credential of its own and borrows the engineer’s. A cloud agent given a shared API key looks identical in the logs on every run, whoever started it.

What is AI agent identity?

How an AI agent is identified depends on where it runs, and in practice there are three cases.

Cloud agent platforms sign a token for each session. Cursor and Devin are both OpenID Connect (OIDC) issuers: a session asks the platform for a short-lived JWT, signed with the platform’s key, whose claims describe the run. A Devin token names the customer organization in org_id, the session in devin_id and the person who asked for the work in requesting_user_email. Cursor’s carries the team in team_id, the repository in repo_url and the owner in owner_email. Anyone with the platform’s public keys can check the signature.

Agents that run as ordinary workloads use the workload’s identity. A GitHub Actions job can request an OIDC token that names its repository and branch, a Kubernetes Pod can mount a service account token, and a SPIFFE workload gets a short-lived JWT-SVID whose subject is its SPIFFE ID. E2B issues one per sandbox execution, with a subject of the form spiffe://id.e2b.dev/<PROJECT_ID>/<SANDBOX_ID>/<EXECUTION_ID>, so even a single run has a name.

Coding agents on a laptop are the odd case, with no credential of their own. Claude Code, Codex or Cursor in a terminal uses the engineer’s SSH keys, GitHub token and cloud CLI session. The only thing that tells the agent apart is the process: on macOS it can be recognized by code signature, along with the git and curl processes it spawns, and on Linux by process name.

Identity answers who is asking. What that identity may then do is authorization, the subject of AI access control. The broader term AI identity also gets used for models and assistants that never touch a system, which is a far easier problem.

Should AI agents have their own identity?

Yes, and at the level of a single run. An AI agent should have an identity separate from the engineer who launched it and from every other agent. With the engineer’s credentials, its actions are indistinguishable from the engineer’s in every log, and the risk of a hijacked run is everything the engineer can reach. With one service account shared by all agents, you can’t tell runs apart, revoke one of them, or say which person each was working for.

The OpenID Foundation comes to the same conclusion from the standards side. Its whitepaper on identity management for agentic AI, published on October 7, 2025 by its Artificial Intelligence Identity Management Community Group, says enterprises “need to begin treating agents as first-class citizens within their identity and access management infrastructure.” It’s also calmer than you might expect. Current authentication and authorization standards, it says, already secure many of today’s agent use cases. The gaps it lists are further out: recursive delegation chains, trust that has to cross organizational boundaries, and the sheer number of authorization decisions autonomous agents will make.

Where we’d push further is granularity. An identity per agent product (“our Devin”) is too coarse to revoke or audit. An identity per run that someone configures by hand doesn’t survive the first busy week. What holds up keeps two things apart: the trust you configure and review exists once per platform, and the identity on the wire exists once per session, minted by the platform and gone when the session ends.

Agentic identity vs human and non-human identity

Every identity and access management (IAM) system you already run makes one of two assumptions about the caller. On the human side it’s a person at a login screen: SSO, MFA, a session that lasts a working day, and an HR process that ends it when the person leaves. Non-human identity (NHI) covers everything else that authenticates: service accounts, API keys, certificates and workload identities. Machine identity is mostly a synonym, sometimes narrowed to certificates and keys. NHI tooling assumes the code behind a credential does the same thing on every run, so its job is to find the credential, scope it and rotate it.

An agent breaks both models at once. It authenticates like a workload, with a token and no browser, yet picks its next action the way a person would, from whatever it just read. Most of the time a person is behind it, which a CI job’s credential never had to express. An NHI inventory will find the key a coding agent holds and tell you when it was last rotated. It can’t tell you whose request the agent was serving when it used it.

That last part isn’t new. BI tools such as Metabase and Looker reach a database through one credential while many analysts run queries through them. The established fix is end-user identity propagation: the tool reports which person is logged in, and the proxy in front of the database applies policy to that person. Formal’s identity docs already list “AI code agents” as machine users, next to BI tools, CI/CD pipelines and ETL jobs. A cloud agent platform is in the BI tool’s position. It has one machine identity, many people launching it, and its own statement about which one started this run.

How do AI agents authenticate?

There are five common AI agent authentication methods: a static API key or token, OAuth client credentials, a user’s delegated OAuth token, a per-session OIDC token signed by the agent platform, and the workload identity of wherever the agent runs. They differ in what the receiving service learns about the caller, and that decides what you can enforce and audit afterwards.

MethodWhat the receiving service learnsLifetimeWhere it breaks for agents
Static API key or personal access tokenThat someone holds the keyUntil someone rotates itCopies end up in .env files, images and transcripts; every run is the same caller; a leaked key works from anywhere
OAuth 2.0 client credentialsWhich registered application calledShort access token, long-lived client secretThe secret still sits in the agent’s environment, and one client ID covers every run and every person
User’s delegated OAuth tokenThe userShort access token, renewed with a refresh tokenThe agent gets the user’s whole reach, and the logs show the user acting
Platform-signed OIDC token per sessionPlatform, tenant, session, repository and the person who started itMinutes, one sessionThe receiving side has to pin the tenant and map the person itself
Workload identity (cloud IAM, Kubernetes service account token, SPIFFE JWT-SVID)The workloadMinutes to an hourIt names the workload; a person appears only if something adds one

For an agent that touches anything sensitive, we’d use the last two rows and retire the first. The middle rows are where most SaaS integrations start, and OAuth already has a standard for doing better. OAuth 2.0 Token Exchange (RFC 8693) defines delegation, where the issued token keeps the user as its subject and names the acting party in an act claim. In the RFC’s own words, with delegation semantics “A is an agent for B.” An API that supports token exchange can tell the agent and the person apart. One that only accepts a client secret sees a single application.

On laptops none of the five apply, since the agent rides on whatever the engineer is logged into. Selecting its traffic by process, as described above, is the handle you have there.

Delegation: tying the agent to a person

Take a Devin session an engineer starts from Slack. Its OIDC token is signed by app.devin.ai, and the relying party (the service that receives the token) checks that signature against Devin’s published keys. That proves Devin minted the token for this audience. The requesting_user_email inside proves something weaker: Devin says this person asked. You accept it because you already trust Devin to know who its users are, the same way you trust a BI tool to report who is logged in.

Formal’s OIDC docs turn that into a rule: build the person mapping only from claims the workload can’t choose itself. Signed claims such as the session ID and the requester qualify. Anything the agent writes doesn’t, and agents write a lot: the reason for an access request, the duration they ask for, the summary they post to a ticket. In the Devin guide the approver reads the agent’s reason and requested duration before saying yes, but the grant is scoped by two signed claims, the requester’s email and the session ID. The guide warns never to put payload fields into that condition, since Devin controls the payload and could inject CEL into it. This matters more where the proxy logs in upstream as the person’s own linked account, because then the agent acts as that person on the other side.

Two more decisions shape delegation. One is what happens when the person can’t be resolved. Formal’s integration fails closed: if an end-user mapping is set and the email matches no Formal user, no credential is issued at all. The other is runs with no person behind them, such as an agent fired by a schedule or a webhook. We’d give those their own machine-only trust with narrower access, so a missing claim never passes for an unnamed human.

Delegation from one agent to another is the part nobody has finished. RFC 8693 can express a chain by nesting act claims, but it says access control must consider only the current actor and treat earlier ones as history. The OpenID Foundation lists recursive delegation among the gaps current standards leave open. Until that settles, a subagent should either run on its parent’s session identity, with the same person, or get its own token from the platform. Don’t grant access on a chain the agents assembled among themselves.

Token lifetimes for agent sessions

SPIRE issues JWT-SVIDs that expire after five minutes by default. An agent on credentials like that holds a token close to expiry most of the time, and how it renews decides whether the short lifetime is real. Lifetimes also chain. When Formal exchanges an OIDC token for a Connector credential, the resulting federation token expires at min(upstream OIDC JWT exp, now + 1 hour), so it can’t outlive the token it came from.

The Devin guide’s access script is the pattern we’d copy. It mints a new federation token for every database connection and caches nothing. On hosts that stay up for hours or days, it depends on where the source token comes from:

  • A source the client can ask again (GitHub Actions, a SPIFFE Workload API, a cloud metadata service) should be refetched before expiry. The Formal Endpoint does this for each of them.
  • A token written to a file and rotated in place, such as a projected Kubernetes token, should be reread on every refresh.
  • A token passed once in an environment variable can’t be renewed. The process has to restart with a fresh one, which rules it out for anything that runs longer than the token.

AI agent identity management and governance

AI agent identity management starts with an inventory, of issuers rather than agents. Agent runs start and end all day, while the systems that sign their tokens change a few times a year: the cloud agent platforms your teams use, your CI provider, each Kubernetes cluster’s token issuer, your SPIRE server. Each becomes one trust relationship with a named owner.

Every trust needs a tenant check, because most issuers serve many customers. A token signed by app.devin.ai is valid for every Devin organization, so the signature says nothing about whose organization started the session. The claim condition pins it. In Formal’s presets that’s claims.org_id for Devin, claims.team_id (optionally with claims.repo_url) for Cursor, and the repository owner and repository IDs for GitHub Actions. Keep these trusts in Terraform or another reviewed config so a new one can’t appear without a second pair of eyes.

AI agent identity governance covers the rest of the lifecycle. Offboarding follows from the person mapping: once someone’s account is gone, sessions they start no longer resolve to a person, and a fail-closed trust gives them nothing. Least privilege comes from the permissions layered on top of the identity. Agents start with zero standing privileges on sensitive systems, ask for access with a reason, and get a grant scoped to the session once the person approves. That’s just-in-time access with one added rule, that the agent can request but never approve. On databases and servers the same controls are privileged access management applied to agents. The audit trail then has to be written where the request is enforced, with the machine identity, the person and the platform claims on every entry.

Common mistakes with agentic identity

Almost all of these come from setting up OIDC trusts for agents and CI jobs, and almost all of them pass a happy-path test:

  • Trusting an issuer with no tenant check. Some providers, Modal and Spacelift among them, fix the token audience, so the integration is chosen by a request header. A claim condition of true on such an integration admits any valid token from that issuer, including tokens minted for another service.
  • Matching a SPIFFE prefix without its trailing slash. spiffe://example.org/ns/prod also matches spiffe://example.org/ns/production.
  • Comparing aud as a string. Kubernetes service account tokens send a list, the comparison comes back false, and authentication fails with invalid OIDC credential until you switch to in.
  • Mapping the person from a field the agent writes, such as a request payload or a name it chose for itself.
  • Giving every agent the same identity, or baking a key into the agent’s environment image, which turns every run into one caller you can’t revoke separately.

How Formal handles AI agent identity

Formal doesn’t issue identities to agents. It trusts the tokens agent platforms and workloads already get, and maps each one to a Formal machine user through an OIDC integration: an issuer, a claim condition in CEL that has to be true, and an optional end-user email expression that names the person. Verified claims reach policies as input.user.oidc.claims.*, and the person becomes the session’s end user.

The Devin guide shows the whole pattern. Devin’s machine user is blocked by default. When a session needs the database, it calls a workflow, passing why it needs access and for how many minutes, Formal asks the requester in Slack, and a yes creates a policy suspension scoped by this condition (from the guide’s workflow):

input_condition: 'input.end_user.email == "${{ trigger.user.oidc.claims.requesting_user_email }}" && input.user.oidc.claims.devin_id == "${{ trigger.user.oidc.claims.devin_id }}"'

Both values come from the signed token, so the grant covers that requester and that Devin session, and a new session asks again. In the audit trail, the session shows the devin machine user, the engineer as end user, and Devin’s claims under user.oidc.claims. Devin security walks through the rest.

The agent never holds an upstream secret. The federation token it mints is a Formal credential for the Connector, while the database password or SSH key stays with the Connector as a Native User, taken from a static value, an environment variable or a hook such as Vault. The same token works for SSH, with one catch: federation tokens carry the source claims and often run past OpenSSH’s 1,023-byte password limit, so the docs pass a hashed formalhash: form instead.

Cloud agent VMs and CI runners can run the Formal Endpoint, which exchanges the platform’s OIDC token for its own Formal login as the machine user and renews it as it goes, so no Formal API key sits on the host. On laptops, where the agent has no token, Endpoint network rules select agent traffic with process.is_agent and process.has_agent_ancestor, matched by code signature on macOS. We wrote up how we give our own cloud agents production access with OIDC, and Cursor Cloud Agents follow the same shape, with owner_email as the person.

Cursor runs its Cloud Agents on this model, each on a narrowly scoped Formal identity, with the employee who launched it attached to every request:

“We’ve limited the amount of data that those cloud agents can access and we’re able to tie that back to the specific user who is using that cloud agent, which is a feature that I’m only aware of Formal having.”

— Roy Xu, Software Engineer, Security @ Cursor

None of this makes the person in the token more than the platform’s word. Formal verifies the signature and the claims you pinned, then enforces and logs against both identities. Deciding which agent platforms you trust to name your engineers, and pinning each of them to your organization, comes first, and everything else on this page builds on it.