AI Development

AI Agent Identity and Permissions: A Practical Guide

November 18, 2026 · 10 min read

AI Agent Identity and Permissions: A Practical Guide

Most companies already know how to manage two kinds of identity: people, who sign in with passwords, passkeys and multi-factor authentication, and applications, which use service accounts and API keys. AI agents fit neither box. They act like software, but they make decisions like people, often on behalf of a specific person, across many systems, at machine speed.

That is why AI agent identity has become one of the hottest topics in security. This practical guide explains what agent identity means, why shared keys and service accounts fail, the standards that now exist, how to design least-privilege permissions, and how to run agents through a full lifecycle from registration to retirement. It includes a token exchange example and a permission policy you can adapt.

What Is AI Agent Identity?

AI agent identity means giving each AI agent its own unique, verifiable identity, separate from the people it works for and from ordinary applications. With a proper identity, every system an agent touches can answer three questions: which agent is this, who is it acting for, and what is it allowed to do right now?

The topic moved to the top of the agenda in 2026. Gartner made AI agent identity one of its top strategic technology trends for 2027 and predicts that by 2028 25% of enterprise security breaches will trace back to AI agent abuse. In the United States, the NIST National Cybersecurity Center of Excellence published a concept paper on software and AI agent identity and authorisation in February 2026, and its summary of public comments shows 614 responses, most of them from industry.

Why Shared Keys and Service Accounts Fail for Agents

The quickest way to connect an agent is to give it an existing API key or a service account. It is also the most dangerous. Here is why:

  • No attribution. When several agents and scripts share one key, logs cannot show which agent did what, or for whom.
  • Too much access. Service accounts are usually broad, because they serve whole applications. An agent needs only a slice of that access for a single task.
  • Credentials that never expire. Long-lived keys copied into prompts, configuration files or agent memory can leak and be reused for months.
  • Lost user context. If an agent acts with its own broad rights instead of the user's, it can reach data the user was never allowed to see.
  • No easy off switch. Revoking a shared key breaks everything that uses it, so teams hesitate to act when something goes wrong.

The scale makes this urgent. CyberArk's 2025 Identity Security Landscape found 82 machine identities for every human in organisations worldwide, with 42% of machine identities holding privileged or sensitive access, while 88% of organisations still defined "privileged users" as humans only.

The Three Questions Every Agent Identity Must Answer

1. Who is the agent?

Authentication proves the agent is the registered agent it claims to be. That means a unique identity in your identity provider, with credentials that are issued automatically, stored securely and rotated, never pasted into a prompt.

2. Who is it acting for?

Delegation records the human or system on whose behalf the agent is working. When an agent books a meeting for a manager, both identities matter: the manager authorised the task, and the agent carried it out. Good designs keep both in every token and log.

3. What may it do right now?

Authorisation decides which actions are allowed for this task, at this moment, with this data. For agents, permissions should be narrow, short-lived and tied to the task rather than permanent.

The Building Blocks: Standards and Platforms

You do not need to invent new security protocols. Agent identity builds on proven standards, with a few new pieces designed for agents:

Building blockWhat it does for agents
OAuth 2.1 and OpenID ConnectIssue scoped, expiring access tokens instead of sharing passwords or permanent keys
OAuth Token Exchange (RFC 8693)Swap a user's token for a narrower token that records both the user and the acting agent
Identity Assertion JWT Authorization Grant (ID-JAG)Lets an enterprise identity provider approve which apps and agents may access which services, behind products such as Okta's Cross App Access
SPIFFE and the IETF WIMSE workGive software workloads, including agents, cryptographic identities across clouds and services
MCP authorisationTreats remote MCP servers as OAuth resource servers, so agents need properly scoped tokens to call tools
Microsoft Entra Agent IDCreates first-class agent identities with conditional access, identity protection, governance and audit logs

For agents built on the Model Context Protocol, two 2026 changes matter most. The MCP 2026-07-28 revision hardened its OAuth rules, as the Agentic AI Foundation explains, including issuer validation and a preference for Client ID Metadata Documents. And the Enterprise-Managed Authorization extension, built on ID-JAG, became stable in June 2026. As WorkOS describes, it lets an administrator approve an MCP server once in the company identity provider so employees' clients connect without separate consent screens.

Designing Permissions for AI Agents

Use these principles when you decide what an agent may do:

  1. Least privilege by default. Start with no access and add only what the task needs.
  2. Task-scoped, not role-scoped. An agent that approves invoices needs access to invoices, not to the whole finance system.
  3. Short-lived credentials. Tokens that expire within minutes limit the damage if one leaks.
  4. Never more than the user. When acting for a person, the agent's access should be the intersection of the user's rights and the agent's purpose.
  5. Separate reading from acting. Read access can be broader; write access should be narrow, limited and logged.
  6. Human approval above thresholds. Set limits on amounts, record counts and recipients, and route anything above them to a person.
  7. Policy as code. Express rules in a policy engine such as Open Policy Agent or Cedar so they are versioned, reviewed and tested.

These are the same ideas behind zero trust security: verify every request, grant the minimum and assume any component could be compromised.

Example: Delegated Access With Token Exchange

Suppose a finance user asks an invoice agent to approve this week's small invoices. Rather than using a powerful service account, the agent exchanges the user's token for a narrow token aimed at one API:

# The agent swaps the user's token for a narrow, short-lived token for one API (RFC 8693).
curl -X POST https://auth.example.com/oauth2/token \
  -u "invoice-agent:$AGENT_CLIENT_SECRET" \
  -d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
  -d subject_token="$USER_ACCESS_TOKEN" \
  -d subject_token_type=urn:ietf:params:oauth:token-type:access_token \
  -d actor_token="$AGENT_ASSERTION" \
  -d actor_token_type=urn:ietf:params:oauth:token-type:jwt \
  -d resource=https://api.example.com/invoices \
  -d scope="invoices:read invoices:approve"

The authorisation server checks its policy and, if allowed, returns a token whose claims look like this:

{
  "iss": "https://auth.example.com",
  "sub": "user:amira@example.com",
  "aud": "https://api.example.com/invoices",
  "scope": "invoices:read invoices:approve",
  "act": { "sub": "agent:invoice-agent" },
  "iat": 1795000000,
  "exp": 1795000900
}

The sub claim identifies the user, and the act claim records the agent acting for them. The token works only for the invoices API, carries only two scopes and expires after fifteen minutes. The API can now enforce rules for both identities and every log entry shows exactly who asked and which agent acted.

Example: An Agent Permission Policy

Every production agent should have a written record that states its owner, purpose, tools, limits and approvals. Many teams keep it as a machine-readable file in an agent registry:

{
  "agent_id": "agent:invoice-agent",
  "owner": "finance-ops@example.com",
  "purpose": "Match supplier invoices to purchase orders and approve small invoices",
  "acts_on_behalf_of": "the finance user who started the task",
  "allowed_tools": ["erp.read_invoice", "erp.read_purchase_order", "erp.approve_invoice"],
  "limits": {
    "approve_invoice_max_amount": 500,
    "max_actions_per_hour": 200,
    "data_scope": "finance records only, no HR or payroll data"
  },
  "requires_human_approval": ["approve_invoice above 500", "invoices from new suppliers"],
  "credentials": { "type": "short-lived OAuth access token", "max_lifetime_minutes": 15 },
  "review_by": "2027-03-31",
  "kill_switch": "disable client invoice-agent in the identity provider"
}

A record like this turns vague intentions into rules you can review, test and enforce. It also gives auditors and security teams a single place to see what each agent is allowed to do.

The Agent Identity Lifecycle: Register, Review, Rotate, Retire

Agents are created far faster than employees are hired, so lifecycle management matters even more. Gartner's predictions for 2027 and beyond warn that more than 10 billion autonomous agents created by people, companies and governments could clog public services by the end of 2030, and recommend automated registries for business-created applications alongside risk-based governance.

  1. Register: every agent gets an identity, an owner, a purpose and a permission policy before it touches production.
  2. Review: owners re-certify access regularly, and unused permissions are removed.
  3. Rotate: credentials are short-lived and renewed automatically, never stored in prompts or code.
  4. Monitor: unusual behaviour, such as new tools, new data or activity at odd times, triggers alerts.
  5. Retire: when an agent is no longer needed, its identity and credentials are disabled and its records archived.

Logging and Accountability

When something goes wrong, you need to reconstruct exactly what happened. Log every agent action with the agent's identity, the user it acted for, the tool and parameters, the data touched, the policy decision and the outcome. Keep logs tamper-resistant and retained long enough for investigations and audits. If agents process personal data, your logging and retention must also respect privacy laws, which our guide to data privacy laws for developers explains.

Identity is one layer of a wider defence. Our guide to AI agent security covers prompt injection, tool gateways and approval flows, and our API security best practices cover the services agents call.

A 30-Day Plan to Get Agent Identity Under Control

  • Week 1: inventory every agent, automation and AI integration, with the credentials each one uses.
  • Week 2: give each agent its own identity and owner, and replace shared and personal keys.
  • Week 3: narrow permissions to each agent's tasks, switch to short-lived tokens and add approval thresholds.
  • Week 4: turn on logging and alerts, document permission policies and schedule access reviews.

If you are building your own tools, our tutorial on how to build an MCP server shows where authorisation fits, and our guide to agentic AI explains how agents use those tools.

Frequently Asked Questions

Should AI agents have their own accounts?

Yes. Each agent should have its own identity so you can limit its access, see exactly what it did and switch it off without affecting other systems or people.

What is the difference between agent identity and workload identity?

Workload identity covers any software service. Agent identity builds on it but adds delegation and decision-making: it records who the agent acts for and applies tighter, task-based limits because agents choose their own actions.

Can an AI agent use my password to log in?

It should not. Sharing passwords with agents removes accountability and creates serious risk. Use delegated access with OAuth so the agent receives a limited, expiring token instead.

How do I revoke an AI agent's access quickly?

Disable the agent's identity or client in your identity provider and revoke its tokens. Because each agent has its own identity, you can do this without disrupting other agents or users.

What is ID-JAG?

The Identity Assertion JWT Authorization Grant is an emerging OAuth standard that lets an enterprise identity provider decide which applications and agents may access which services. It underpins Okta's Cross App Access and the MCP Enterprise-Managed Authorization extension.

Do small businesses need agent identity management?

Yes, in a simpler form. Even a small team should give each agent its own credentials, limit access to what the task needs, avoid sharing personal logins and turn on two-factor authentication for the human accounts that manage agents.

Give Every Agent an Identity Before It Gets Access

AI agent identity is the foundation of safe automation. Unique identities, delegated and short-lived tokens, task-scoped permissions and full audit trails turn agents from a security blind spot into something you can govern. If you want help designing identity and access controls for your AI agents, contact our team to plan a secure rollout.

Want this built for you?

Our team offers Website Deploy On Vercel — get a free quote.

View Services