Rightshold™ Sign up

Answers · agent safety

How do I keep an audit trail of which human authorized an AI agent's actions?

Last updated

TL;DR: Record each authorization as its own event, separate from the tool calls, and link every action to the grant it used. For any action an agent takes on someone's behalf, the trail should answer: which person granted the authority, exactly what they granted (actions, targets, limits, expiry), when and how they approved, which agent and session acted, and which calls used that grant. Standards supply the vocabulary. OAuth 2.0 Token Exchange (RFC 8693) keeps the user a token is about separate from the actor using it through the act claim, and nested act claims form a history of prior actors. Rich Authorization Requests (RFC 9396) let a grant spell out actions and locations as structured authorization_details instead of a bare scope string. Log where each approval came from, too: Claude Code's tool_decision telemetry tells a one-time Yes from a person (user_temporary) apart from a saved rule or policy (config). Because config doesn't say which rule matched, keep your own record of who wrote and approved each rule. Then make the records tamper-evident so the trail holds up when someone disputes it.

What should I check, step by step?

1. Give each agent its own identity (service account, OAuth client or API key), and don't let it act under a person's own credentials, or the log will show that person did everything.

  1. Write a grant record whenever a person authorizes work: grant id, the approver's identity from your identity provider (not a typed name), the agent, the purpose, allowed actions and targets, limits such as amount or data categories, start and expiry, and how they approved (UI click, signed request, ticket).
  2. Carry the grant id with the work, in the token, a header or a tool argument, and write it into every tool-call log entry so each action points at exactly one grant. With RFC 8693 delegation tokens, sub names the user and act names the agent.
  3. For risky actions, record the approval per action: who was asked, what they were shown (the exact arguments, or a hash of them), their answer and the time. Keep one-off approvals distinct from standing rules, and log every rule change with its author.
  4. When an agent hands work to a sub-agent, record the hand-off as a new, narrower grant that names its parent, so you can rebuild the chain from the person to the last actor.
  5. Log refusals, expiries and revocations as well as approvals. A denied request or a revoked grant is evidence too.
  6. Keep personal data to what you need: a stable user id rather than an email where possible, and no tokens, passwords or session ids in the log (OWASP).
  7. Make the trail tamper-evident: append-only storage written by an account that can't edit or delete, plus regular hash commitments kept somewhere the agent's operator can't rewrite.

What the standards give you

RFC 8693 distinguishes impersonation from delegation. When A impersonates B, A is indistinguishable from B in that context. With delegation, A keeps its own identity, and a composite token names both parties. An audit trail needs delegation, so the agent stays visible as the actor.

What an agent tool's telemetry does and doesn't tell you

Claude Code's OpenTelemetry tool_decision event records accept or reject plus a source. user_temporary means a one-time Yes at a prompt, and user_permanent means 'don't ask again', which saves an allow rule. user_reject and user_abort are refusals. hook means a PreToolUse or PermissionRequest hook decided. config covers decisions made without a prompt: by settings, managed policy, command-line flags, the permission mode or the auto mode classifier.

How do I ask Rightshold about this (free, no key)?

Add the MCP server https://www.rightshold.com/mcp to Claude, Cursor, ChatGPT, Grok or VS Code, then ask: “Here is the proof bundle for the intent my agent acted under. Check that the agent signed it, that the operator's mandate is attached, and when it was on the ledger.”

One-click setup

{
  "tool": "verify_intent_proof",
  "arguments": {
    "proof": "<the JSON bundle that intent_proof returned>"
  }
}

Rightshold records intents and operator mandates for agents that use it and verifies proof bundles. It doesn't run your identity provider, see your agents' actions in other systems, or decide who in your organization may approve what. Not legal advice.

What are the sources?

Related

Not legal advice. JSON · Markdown · All answers

Get a free API key in one call

No card and no email needed. 100 free credits; the license and policy checks stay free without a key.

curl -s -X POST https://www.rightshold.com/v1/accounts/signup -H "Content-Type: application/json" -d '{"accept_terms":true}'
export RIGHTSHOLD_API_KEY=rs_...   # the api_key from the reply (shown once)
curl -s https://www.rightshold.com/v1/licenses/check -H "Authorization: Bearer $RIGHTSHOLD_API_KEY" \
  -H "Content-Type: application/json" -d '{"license":"MIT","intended_use":{"commercial_use":true}}'