The Full Flow
Step 1: Discovery — “What can I connect to?”
Why does this exist?
Why does this exist?
Without discovery, every agent would need to be manually configured with your app’s URLs and capabilities. The
.well-known document makes your app automatically discoverable by any ATH-compatible agent.Step 2: Registration — “Can I use your service?”
What's that agent_attestation thing?
What's that agent_attestation thing?
It’s a signed JWT that proves the agent is who it claims to be. The agent has a private key; its public key is published at
agent_id URL. The shop can verify the signature.Think of it like an ID card — the agent shows its ID, and the shop can verify it’s not forged. You don’t need to understand the cryptography to implement this — the SDK handles signing automatically.Step 3: Authorization — “Let me ask the user”
Step 4: User Consent — “The user decides”
The user opensauthorization_url in their browser and sees:
ATH Shop Demo Agent wants to access your account:If the user clicks Authorize, the shop processes the OAuth callback internally. The user never gives their password to the agent.[Authorize] [Deny]
- ✅ View products
- ✅ Manage shopping cart
- ✅ Place orders
What happens technically?
What happens technically?
The URL contains a PKCE code challenge. When the user approves, the shop’s OAuth server issues an authorization code, exchanges it for an internal token, and stores the user’s consented scopes on the ATH session. All of this is handled server-side — the agent doesn’t see any of it.
Step 5: Token Exchange — “Here’s your scoped access”
- What the shop approved for this agent (Phase A)
- What the user consented (Phase B)
- What the agent actually requested (this call)
Step 6: Use the API — “Now I can shop”
- Validates the token (not expired, not revoked)
- Checks the request is within the granted scopes
- Forwards to the real API
Step 7: Revoke — “I’m done”
The Key Insight
The entire protocol exists to answer two questions:| Question | Who answers | When |
|---|---|---|
| ”Should this agent be allowed here at all?” | 🏢 Your app (the service) | Step 2 (registration) |
| “Does this specific user want this agent acting for them?” | 👤 The user | Step 4 (consent) |
What Do You Want to Build?
Add ATH to my app
I want to protect my API so agents can access it securely
Set up a gateway
I want to put ATH in front of existing services
Build an agent
I want my agent to call ATH-protected APIs