AI agent identity means every agent run has its own verifiable identity that says which agent it is, which person it acts for and what it may do, instead of borrowing a person's API key or a shared service account. Least privilege means that identity carries only the scopes the task needs, for minutes rather than months, and that each tool call is still checked against policy. Together they shrink what a wrong or manipulated agent can do, and make every action traceable to an agent and a person.
What is an AI agent identity?
An AI agent identity is a credential issued to an agent, not to a person or a server. A useful one answers three questions on every call: which agent (and which run of it), on behalf of whom, and with which permissions. It is a kind of non-human identity, alongside service accounts and API keys, which OWASP catalogues in its Non-Human Identities Top 10. What makes agents different is that their behaviour is decided at run time by a model, so their permissions cannot be justified by reviewing the code alone.
Why is giving an agent a shared API key a problem?
A shared or borrowed key has three faults. It is too broad: a GitHub token that can open pull requests can usually also delete branches. It lives too long: if it leaks into a log, a prompt or a tool result, it works until someone rotates it. And it hides who acted: the upstream sees the key, not the agent or the person behind it. The OWASP Top 10 for Agentic Applications lists Identity and Privilege Abuse as ASI03, and the earlier OWASP LLM list calls the same pattern excessive agency: too much functionality, too many permissions and too much autonomy.
What does least privilege mean for an AI agent?
NIST defines least privilege as giving each entity "the minimum system resources and authorizations" it needs to do its job. For an agent that turns into four concrete rules:
- Scope by tool, not by system. Grant this MCP server or model route, not "GitHub" or "the cloud account". The MCP specification's security best practices warn against omnibus scopes such as
files:*oradmin:*and recommend a minimal starting set with step-up when needed. - Make credentials short-lived. Minutes, tied to one session, so a leaked token expires before it is useful.
- Keep real secrets away from the agent. The process the model steers should never hold the upstream API key or OAuth secret. Something outside it should attach them.
- Check each call, not just the login. A token says what the agent may reach. A policy decides whether this call, with these arguments, now, is allowed. "Delete pod" is fine in a test namespace and not in production.
This is zero trust applied to agents: as NIST SP 800-207 puts it for any subject, access is granted per request and no implicit trust comes from where the caller sits on the network.
How should an agent act on behalf of a person?
An agent that works for Alice should be able to do at most what Alice may do, and usually less. The standard pattern is token exchange, defined in RFC 8693: the agent's token carries an "actor" claim naming the person, and any derived token can only narrow the scopes. Two mistakes to avoid:
- Token passthrough. Forwarding the user's own token to a downstream API. The MCP authorization specification forbids it: servers "MUST validate that access tokens were issued specifically for them".
- Losing the person in multi-agent chains. When agent A asks agent B to do something, B's call should still carry the original person, so policy and audit see who started it.
For actions where a token is not enough, ask a person. See human-in-the-loop approval for AI agents.
What is workload identity, and does an agent need SPIFFE?
A bearer token works for anyone who copies it. Workload identity binds the credential to the running workload. SPIFFE is the open standard for this: each workload gets an ID such as spiffe://example.org/ns/team-a/agent/coder and short-lived X.509 or JWT documents (SVIDs) that prove it, issued by an implementation such as SPIRE. An alternative is to bind the token to a key the agent holds in memory with OAuth DPoP, RFC 9449. You do not need either on day one, but if your threat model includes tokens stolen from logs or memory dumps, one of them closes that gap.
What is a practical checklist for agent permissions?
- Give each agent session its own identity; never reuse a person's key.
- Include the person the agent acts for, and verify it, rather than trusting a header the agent sets.
- Issue tokens that expire in minutes, scoped to named tools and model routes.
- Keep upstream credentials in a gateway or vault; inject them per call.
- Strip the agent's token before forwarding; send the upstream its own credential.
- Evaluate a policy on every call, with default deny.
- Hold high-impact calls for a person, with no self-approval.
- Record every decision with the agent, the person and the rule that decided.
- Be able to revoke one agent, one session or one person's agents within seconds. See the AI agent kill switch.
How does MAQPNA handle agent identity?
In MAQPNA, every agent session gets a session token from the identity broker. It is an Ed25519-signed token whose subject is a SPIFFE-style ID for the namespace, agent and session, whose act claim names the person the agent acts for, and whose scopes name tools, model routes and agents. It lasts 15 minutes by default and never more than an hour. The specifics, all in the docs at identity and delegation:
- No static secrets in sandboxes. Upstream API keys, OAuth client secrets and mTLS keys live only in the gateway. When an MCP server needs the user's own OAuth token, the gateway injects it from its encrypted token vault. See secret vaults.
- Derived tokens only narrow. RFC 8693 token exchange issues shorter-lived tokens with narrower scopes, and an exchanged token cannot be exchanged again.
- No token passthrough. The gateway strips the agent's
Authorizationheader and sends the upstream verified identity headers or a short-lived transaction token, plus its own credential. - Delegation across agents. Agent-to-agent calls nest the chain in
act, capped at five hops, and policies keep matching the original person. Revoking any agent in the chain revokes the delegated token. - Optional workload identity. With SPIRE, the gateway can require the sandbox's X.509-SVID to equal the token subject, so a stolen token alone is not enough. The docs note current limits for tier-0 sandboxes. See workload identity with SPIFFE and SPIRE, or DPoP sender-constrained tokens.
- Per-call policy. Scopes decide what is reachable; policies decide each call on tool, arguments, user, groups and session history, default deny.
Related: what is an MCP gateway?, agent egress control and DLP, is MCP safe? and AI agent governance.