What We’re Building
A gateway that sits between agents and existing services. Agents talk ATH to the gateway; the gateway talks standard OAuth to the upstream services. The upstream services don’t need any changes.Before You Start
What you need
| Requirement | Why you need it | Details |
|---|---|---|
| A reachable URL for the gateway | After the user approves on (e.g.) GitHub’s consent screen, GitHub redirects the user’s browser to https://your-gateway.com/ath/callback. GitHub must be able to reach this URL. | For local dev: http://localhost:4001 works if you register it as the callback URL with the provider. For production: a public URL. |
| OAuth credentials for each provider | The gateway acts as an OAuth client with each provider. You register an “app” with the provider and get a client ID + secret. | You do this on the provider’s developer dashboard — e.g., GitHub’s “OAuth Apps” settings. See Step 3 below. |
Why does the gateway need to be reachable?
Why does the gateway need to be reachable?
Here’s what happens during user consent:After the user clicks “Approve” on GitHub, GitHub tells the user’s browser to go to the callback URL. If the browser can’t reach that URL, the flow breaks.
- Local dev:
http://localhost:4001works because the browser is on the same machine - Production: The gateway needs a URL reachable from the user’s browser (doesn’t need to be reachable from GitHub’s servers — it’s a browser redirect, not a server-to-server call)
What you don’t need
- ❌ Changes to the upstream service — that’s the whole point of a gateway
- ❌ A public URL for the agent — the agent connects outward to the gateway. No inbound connections to the agent.
- ❌ An identity document for the agent (in development) — the gateway’s
skipAttestationVerificationmeans the gateway won’t try to fetch the agent’s public key - ❌ Deep OAuth or security knowledge — you fill in 6 fields per provider and the gateway handles everything else
When to use a gateway (vs native mode)
Why does the agent not need a public URL in gateway mode?
Why does the agent not need a public URL in gateway mode?
In native mode, the server fetches the agent’s identity document from the
agent_id URL to verify the agent’s public key. This requires the URL to be reachable from the server.In gateway mode with skipAttestationVerification: true (development), the gateway doesn’t fetch the identity document at all. In production, you’d configure the gateway to trust specific agents through its registry — the gateway still verifies agent attestation JWTs, but you can configure key resolution without requiring the agent to host a public URL.Bottom line: If you’re building an agent on your laptop and can’t expose a public URL, gateway mode is the easiest path.Step 1: Run the Gateway
Option A: From source
Option B: Docker
http://localhost:4001.
Step 2: Create a Gateway User
The gateway is multi-tenant — each user has their own isolated agent registrations. Create an admin user:token from the response — you’ll need it for admin operations.
Step 3: Add a Provider
Createproviders.json in the gateway directory with your OAuth provider’s details:
Where do these 6 fields come from?
Where do these 6 fields come from?
| Field | Where to find it |
|---|---|
display_name | Whatever you want to call it |
available_scopes | The provider’s documentation (e.g., GitHub scopes) |
authorize_endpoint | Provider’s OAuth docs — the URL users are sent to for consent |
token_endpoint | Provider’s OAuth docs — where codes are exchanged for tokens |
api_base_url | The root URL of the provider’s API |
client_id / client_secret | Created when you register an OAuth app with the provider |
How do I register an OAuth app with GitHub?
How do I register an OAuth app with GitHub?
- Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
- Set Application name to anything (e.g., “ATH Gateway”)
-
Set Homepage URL to your gateway URL (e.g.,
http://localhost:4001) -
Set Authorization callback URL to your gateway’s callback:
http://localhost:4001/ath/callback⚠️ This must exactly match. After the user approves on GitHub, GitHub tells the user’s browser to redirect to this URL. If it doesn’t match what the gateway sends, GitHub rejects the redirect and you’ll see a “redirect_uri mismatch” error. - Click Register application
- Copy the Client ID and click Generate a client secret
-
Put both values in your
providers.json
https://your-gateway.com/ath/callback, and copy the credentials.Step 4: Test the Full Flow
How It Works
Key security property: The upstream provider token (GitHub’s OAuth token) never leaves the gateway. The agent only holds an opaque ATH token that the gateway issued.Try It With the Demo
The ATH Demo includes a pre-configured gateway setup. To see gateway mode in action with a real e-commerce app:Next Steps
- Add more providers — GitHub, Google, Slack, and custom OAuth providers
- Production deployment — what to change before going live