Most of what an organisation already does for service accounts applies to AI agents. Issue a credential, scope it, rotate it, log what it did, and withdraw it when the work ends. The practice is mature, the tooling exists, and teams running it well have a head start.
It stops at three points, and each one breaks a different assumption that service account practice rests on.
What carries over from service accounts
Credential hygiene, ownership and audit all carry over from service accounts to AI agents. That is worth saying first, because a lot of agent security writing implies everything is new.
Credential hygiene carries over completely. No long-lived secrets in environment variables, no keys in images, and rotation on a schedule you actually meet. If you already practise rotating credentials on a schedule, that discipline applies to agent credentials unchanged. The same goes for mutual TLS client authentication, which binds a credential to a key the caller holds.
Ownership carries over. Every service account should have a named owner who can be asked why it exists. The same applies to agents, and they make it more urgent because they get created faster.
Audit carries over in principle. You already log what the account did. The record needs more fields for agents, covered below, but the practice is in place.
What changes
Service account
AI agent
Fixed call path
Chooses its own calls
Acts for itself
Acts for a person, through other agents
One account, many processes
One identity, many attested copies
Scope by listing calls
Scope by policy at request time
Credential hygiene, ownership and audit carry over unchanged
What changes, one: the agent chooses its own calls
An AI agent chooses its own calls, so it cannot be scoped by listing endpoints the way a service account can.
A service account runs fixed code. The set of endpoints it will touch is known before it runs, which is why permissions can be scoped by listing them: you write down what the job needs and grant exactly that.
An agent decides which tool to call, often from data it read a moment earlier. There is no list to write down. Scoping an agent by endpoint list produces one of two outcomes: a list so wide it grants everything the agent might ever need, or a list so narrow the agent fails on its third task and somebody widens it permanently.
What to do instead. Express the bound as a policy the authorisation server applies at request time, with the token carrying only what each request named. The agent has a set of everything it may ask for across all its work, and a grant covering this one request. Approval to prepare one report does not become standing access to the data behind it.
What changes, two: the agent delegates
An AI agent usually acts for a person and often hands part of the task to another agent, which service account tooling has nowhere to record.
A service account acts for itself, so the question of whose behalf it acts on never arises. An agent's request may arrive at an API four hops from the person who started it. If each hop issues its own token, the authority the person granted gets replaced along the way by whatever the third system decided to ask for.
What to do instead. Carry actor information through the chain and narrow the scope at each hop. OAuth 2.0 Token Exchange (RFC 8693) defines the mechanism, with the act claim describing the acting party. The claim is informational, so the receiving system still decides whether a given chain is acceptable. That decision needs a written policy, agreed across teams before the second agent ships, because the first pattern approved tends to become the standard by accident. We follow one such chain in agent API security when one AI agent calls another.
You can also watch delegation happen in our interactive walkthrough, a small galaxy of bank systems where you follow one agent's task from the treasurer who handed it over to the platform that decides.
What changes, three: the agent runs as many copies
One approved AI agent can run as hundreds of copies, across clouds, regions and sometimes customer devices, and a credential alone cannot tell them apart.
A service account is one account. Scaling it means more processes using the same credential, and in most estates that is fine. With agents, approving the agent and knowing which copy made a given call are separate problems. That introduces a distinction service account practice does not need: three objects, each with its own lifecycle.
| Object | What it is | Has an identity? | Has a version? |
|---|---|---|---|
| Agent | The governed identity, with its authority chain and roles | Yes | No |
| Release | A versioned build of the software, with a digest and SBOM | No | Yes |
| Instance | One running copy, with a key and an attestation | No address of its own | No |
What to do instead. Where the copy matters, attest it. The instance generates a key in process, an attester checks it, binds that key and publishes an entry on a signed list of copies. The instance presents that attestation when it authenticates. Where the copy does not matter, this adds nothing and should be skipped.
Withdrawal gets a vocabulary
Service account practice uses one word for stopping things, and agents need three, because three different acts have three different blast radii.
- Withdraw the agent. The authority stops vouching for the identity. Every consumer stops accepting it at its next read, and every copy is affected.
- Revoke a credential. A certificate or token is invalidated. That credential stops working, and the identity's authority is untouched.
- Stop an instance. One running copy ends. The identity and every other copy are unaffected.
A lost laptop is the third case. An agent behaving badly across the estate is the first. Using one word for both means the response is wrong in one direction or the other.
There is no kill switch. Each consumer applies a change at its next read, inside a window it states in advance. The guarantee worth writing down is: withdraw once, and every consumer reads again when its answer expires.
The audit record needs more fields
An audit record for an agent needs four fields that service account logging does not have. Service account logs answer which account called which endpoint and when. For agents, that record will not pass a second-line review, because it cannot say who authorised the access.
- The initiating person or organisation
- Each agent in the chain and the authority each resolved to
- The limits in force and what the request actually named
- Where a status source was read from, when, and whether it answered
The last one matters more than it looks. A check that was never read is different from one that was checked and passed, and a log that cannot tell them apart will be read as the second.
A migration order that works
A team that already runs service accounts well can move to agent identity in five steps, in this order.
- Inventory. List every agent with a named owner. Most organisations cannot do this today, and everything else depends on it.
- Split shared accounts. Give each agent its own credential bound to a key it holds. This alone fixes the audit problem and most of the withdrawal problem.
- Shorten lifetimes. Move agent credentials to minutes.
- Agree the delegation pattern across teams, before the second agent ships.
- Extend the audit record with the four fields above.
Steps one to three use tooling most organisations already own. Steps four and five are where the new work is. Agents are one kind of non human identity, and our guide to AI agent identity and access management covers the rest of the model.
To check where your own agents stand on all five steps, get the free AI agent access readiness assessment. It shows which access controls you already have, which are missing and what to fix first.
Frequently asked questions
Can AI agents use service accounts?
They can, and it is the most common starting point, but it breaks at the first audit. A shared service account means no downstream system can tell two agents apart, and withdrawing one withdraws all of them.
What is the difference between a service account and an AI agent identity?
A service account runs fixed code and acts for itself, so its permissions can be listed in advance. An agent chooses its own calls, usually acts for a person, and runs as many copies from one approved identity.
Do existing credential rotation practices work for AI agents?
Yes, and teams with mature rotation have a real head start. Agent credential lifetimes should be much shorter, but the discipline is the same.
How do you audit AI agents compared to service accounts?
Add four fields: the initiating person or organisation, every agent in the chain with the authority each resolved to, the limits in force against what the request named, and whether each status check actually answered.
Should we replace service accounts with agent identities?
Only where the caller is an agent. Service accounts remain the right tool for software that runs a fixed path and acts for itself, which is still most of an estate.
Check if your AI agents are ready for production
See which access controls you already have, which are missing, and what to fix first.
Get the free assessment