Govern AI agents / Acting for a person
Acting for a person
When an agent works for someone, it may do only what that person may do, and only what the agent itself may do. Caroline decides both and allows the call only when both say yes.
Name the person
The gateway puts the person in context.on_behalf_of, taken from the session that started the agent, never from the model:
{
"subject": {"type": "agent", "id": "a_support_bot"},
"action": {"name": "issue"},
"resource": {"type": "refund", "id": "r_refund_mid"},
"context": {"on_behalf_of": "u_rep_ana"}
}
Both sides decide
- The person must be someone Caroline holds. An unknown id, a blank, or another agent is refused (
delegator_unusable). An agent cannot act for an agent, so grants cannot be passed along a chain. - Rules about agents bind only the agent. A rule that selects
kind: agentdoes not match the person. - A person's approval counts on both sides, and the person's own limits still bind.
- Shadow rules are measured on the agent's side only; the person's side uses enforced rules.
The answer says why
| Outcome | Reason, as Caroline gives it |
|---|---|
| allow | allowed by [agent-refund-within-limit], acting for u_rep_ana (allowed by [rep-refund-within-limit]) |
| deny | denied: acting for u_rep_ben, who has no matching allow rule |
| deny | denied: acting for u_rep_ben, who is refused by [deny-suspended] |
| deny | denied: on_behalf_of does not name a person the PIP holds |
Decisions shows "for ..." beside the agent, and the Policy Tester shows what the person's own rules said.
Agents that must not act alone
Set delegation: required on an agent's record and every call that names no person is refused (delegation_required). Use it for any agent that works inside someone's session; leave it optional for a batch agent that works for the business.
What the gateway must get right
Caroline can only judge the person it is told about. The gateway must take on_behalf_of from the authenticated session (in the MCP reference gateway, the X-On-Behalf-Of header the agent's runtime sets) and never from the tool call's arguments.
The person fixed by the key
Or let the agent's key say it. An agent's key can be issued for one person: Caroline then writes context.on_behalf_of from the key, and refuses a request that names anyone else with 403 person_mismatch, before the engine. The gateway sends no person at all.
A connection can take the person from the key only: Fix the person by the key on its card in Keys. From then on a call there needs a proven agent key, and names a person only with a key issued for that person; anything else is 403 person_not_proven. Give out the keys first. Accept a named person takes the claimed person again, and waits for another person's countersign. A connection whose connector holds the system's own credential always takes the person from the key.