Authentication and authorization for AI agents

Who is acting, for whom, and who said they could?

Every API your agent calls needs those three answers, whether it is a calendar, a repository or a customer’s account. An API key gives it one. This guide starts from that key and goes as deep as the specifications.

What can the API tell?

The agent attaches

The agent attaches: Its own API key

What the API can tell
Who is acting?YesThe key belongs to the agent’s account.
For whom?Noalice is whatever the agent typed. The API cannot confirm it.
Who said they could?NoAn administrator gave the agent its access. Alice approved nothing.

The API knows the agent is calling, and has to take its word for everything else. If Bob asks for Alice’s calendar and the agent sends Alice’s name, the API sees a valid key and answers. Alice is protected only while the agent tells the truth about who is asking. Do not rely on a key to keep users apart.

The agent attaches: A key Alice made

What the API can tell
Who is acting?NoThe key is Alice’s. Nothing shows which software is using it, or that software is involved at all.
For whom?YesAlice’s account, because the key is hers.
Who said they could?PartlyAlice made the key, so she agreed to something. Most keys open the whole account and never expire.

The API can now tell Alice’s requests from Bob’s. But as far as it can tell, the agent is Alice: whatever it does is recorded as her doing it, and the key usually allows everything her account can do, for as long as it exists. It names the person and hides the software.

The agent attaches: A token Alice approved

What the API can tell
Who is acting?YesThe token names the app it was issued to. Like a key, it works for whoever holds a copy.
For whom?YesThe token names Alice, and the service that signed it vouches for that.
Who said they could?YesAlice did, for reading her calendar and nothing else.

The API can now tell Alice’s requests from Bob’s, refuse anything beyond reading a calendar, and block this one agent without locking Alice out. What the agent can do for Alice is now limited by what Alice approved, and the API is the one enforcing it.

A token Alice approved answers all three. Lesson 1 shows why

An independent guide, not a specificationReviewedNovember 2026

Whose authority is the agent using?

If you know the ground, start here. It is the first question to settle, and it decides whose name is on the token.

Whose authority is the agent using?

ThenIs a person available when access is needed?

Yes, in the session

Reachable, but elsewhere

No

The agent runs unattended on authority the person delegated earlier. The arrangement to be most careful with.

ThenWhere does its identity come from?

The platform it runs on

A registered client credential

The decision guide asks four more questions: what the agent calls, who runs that, where the agent runs and what is at stake. Chains of agents and tools have flows of their own.

Answer all six questionsSee all 20 flows