Shane Deconinck Trusted AI Agents ยท Decentralized Trust

Understanding OAuth On-Behalf-Of: The OBO Token Exchange Flow Explained

How agents act on behalf of users

AI Agents Break OAuth's Assumptions

Traditional App
๐Ÿ‘คโ†’Appโ†’๐ŸŒ
App forwards user intent
AI Agent
๐Ÿ‘คโ†’๐Ÿค–โ†’???
Agent creates its own intent

When an agent approves an expense, the audit log shows alice@company.com โ€” but Alice didn’t decide. Who’s accountable?

Dual Identity with RFC 8693

๐Ÿ‘ค
sub = authority (whose permissions)
๐Ÿค–
act = actor (who's deciding)

The On-Behalf-Of token identifies both. APIs can enforce Alice’s limits while logging the agent’s actions. Full accountability.

Token Exchange Flow

Sequence Diagram
๐Ÿ‘คAlice ๐Ÿค–Agent ๐Ÿ”Auth Server ๐ŸŒAPI OIDC login request ID + access token Delegates Token exchange Validate OBO token Approve $487 expense โœ“ Approved Approve $1,250 expense โœ— Limit exceeded Click Start to begin
Alice's Token
โ€”
OBO Token
โ€”

Audit Log Comparison

Same expense approval. What does the audit log show?
โŒ
Without OBO
Standard OAuth
Audit Entry
ActionExpense Approved
Amount$487.50
Useralice@company.com
Who decided????
Was it Alice clicking approve?
Or an AI agent acting autonomously?
๐Ÿคท
โœ“
With OBO
RFC 8693 Token Exchange
Audit Entry
ActionExpense Approved
Amount$487.50
Authority (sub)๐Ÿ‘คalice@company.com
Actor (act)๐Ÿค–expense-agent-001
Alice granted permission.
Agent-001 made the decision.
โœ…

Who Benefits?

๐Ÿ›ก๏ธ
CISO
"Agent compromised. What did it access?"
Query actor: agent-001 โ†’ instant forensic trail across all users.
๐Ÿ“‹
Compliance
"Who approved this $10K expense?"
Alice (authority) + agent-001 (actor). Both logged. Full accountability.
โš™๏ธ
Platform
"Which agents are misbehaving?"
Per-agent metrics. Spot anomalies. Rate limit or revoke specific agents.
๐Ÿค–
AI Team
"Is agent v2 making better decisions?"
Compare rejection rates per agent version. A/B test with real audit data.

Where OBO Falls Short

OBO works within a single trust domain. It breaks down when:
Multi-Hop Delegation
Agent A calls Agent B calls Agent C. The act claim only captures one layer. Who's really acting?
Cross-Organization
Agent from Org A needs to call API in Org B. Different auth servers, no shared trust anchor.
User Consent Opacity
RFC 8693 is backend-only. The user consents to the initial token, but every exchange after that is invisible. No front-channel interaction, no visibility into what scopes the agent requests or which downstream services receive tokens.
Emerging fix: IETF draft-oauth-ai-agents-on-behalf-of-user adds front-channel consent for AI agent delegation.
For emerging solutions to these challenges, see my blog post.