The fastest way to ship an AI feature is to hand it a service account with broad access. Everything works immediately. Every retrieval succeeds, every tool call goes through, and nothing fails in the demo.

It also means the assistant can read everything, for everyone, and the audit log shows one identity doing all of it. When somebody asks six months later who authorised a particular change, the honest answer is "the app did".

Every action carries three identities

Every AI action carries three separate claims, and collapsing them is where authorisation goes wrong.

The user identity answers on whose behalf the work is being done. The service identity answers which deployment is running. The agent identity answers which workflow and which run, so a specific trace can be pulled back later.

Requests need to carry all three, with the user's identity travelling as a delegated token (OAuth 2.0 token exchange, RFC 8693) rather than as a bare user ID the downstream system has to take on trust. If the retrieval layer only sees the service identity, it cannot filter documents by what the user is allowed to see, and you have built an expensive way to leak internal files between teams. Permission filtering belongs in the query rather than in a post-hoc instruction asking the model to be discreet.

Scope the verb, not only the data

Read and write are really four settings, and splitting them makes approval proportional to the risk.

LevelWhat the agent may doGate
ReadFetch only what the signed-in user could open themselvesSession auth
SuggestDraft a change in the interface, nothing persistedSession auth
StageWrite to a pending queue with a visible diffPolicy check
ExecuteCommit to a system of recordHuman approval, logged

Most workflows never need to leave the first three. The ones that do should say so explicitly in configuration, because "this workflow can execute" is a decision worth someone's name against it. There is a second reason to keep Execute rare. A reviewer who approves a steady stream of requests stops reading them.

Deciding policy and enforcing it are different jobs

Keep the policy decision point separate from the policy enforcement point. Policy gets evaluated in one place, against a request that names the user, the resource, the action and the context. Enforcement happens at the tool boundary, in code, before the call goes out. The model is never the enforcement point, because anything a model can be talked out of is a preference rather than a control. Every tool call then pays for a policy check, which makes the decision point a production dependency: run it like one, and fail closed when it cannot answer.

The split makes audit logs meaningful, since every allow and deny records who asked, what was requested, which rule fired and whether a human approved. It also makes exceptions manageable, because a break-glass path with a stated reason, an expiry and a review replaces a permanent widening of scope that nobody remembers granting.

An agent that holds standing privileges of its own amounts to an extra staff account, one that runs around the clock and is never offboarded.

About this explainer

Format
Explainer
Level
Practitioner
Read
2 min read
Published
Aug 25, 2026

Short mental models: one idea, why it matters, what to do about it.

Checklist · · 29 checks

Security review checklist for an AI feature

What to check before an assistant, RAG app or agent goes in front of real users. Grouped by area, ticked off locally; progress stays in your browser.