Empyre / Articles / OAuth for AI agents

OAuth for AI agents

OAuth for AI agents is delegated authorisation for software that runs without a human at the keyboard. The owner approves once on a hosted consent screen. The agent receives short-lived, scoped bearer tokens instead of a password or a root API key.

That model is the same OAuth families use for web apps. Agents stress it because consent is a single moment and exercise of authority can run for months. Scope, rotation, replay detection and revocation matter more when nobody is watching.

Ready-to-buy searchers usually want a provider name, an integration path, and a checklist they can hand to security. The sections below are that checklist first. Empyre Relay is one shipped product in the category; install steps and SDK detail live on the companion product page, not here.

What problem OAuth for agents solves

An agent that reads mail, posts content or merges code needs authority tied to a person or organisation. Pasting that person's password into agent config grants full account access with no audit trail and no per-task limit.

OAuth separates **who approved** from **what the software may do**. The upstream API sees a token with expiry and scopes, not a reusable secret that unlocks every endpoint.

For multi-tenant products, that separation is not optional. You cannot revoke one customer's agent without rotating credentials for every customer if everyone shared one API key.

Minimum bar before you call it production-ready

Treat missing items as open security work, not as vendor marketing bullets:

Hosted consent

The owner approves on a page you control, not inside the agent's chat UI. The agent never sees the credential being typed.

S256 PKCE on authorisation

Public clients are the norm for agents. Proof Key for Code Exchange stops an intercepted code from being redeemed by a different party.

One-time authorisation codes

A code that can be exchanged twice is a replay waiting to happen. Single-use redemption is non-negotiable.

Scoped access tokens

Authority must match the job. Read-only calendar access should not imply send-mail scope.

Refresh rotation with family revocation

Each refresh mints a new refresh token and invalidates the old one. Presenting a spent refresh token should end the whole token family.

Fail-closed revoke and introspect

If the token service is unreachable, the answer is deny — not allow because verification timed out.

Distinct agent subject

Your data model must tell "Alice" from "agent 7 acting for Alice since Tuesday with these scopes." Auditing and per-agent revoke depend on it.

OAuth for agents vs API keys vs signing relays

ApproachWhat the agent holdsFails when
OAuth for agentsShort-lived bearer tokens after owner consentYou need per-user delegation, audit, and revoke without rotating one shared secret
Long-lived API keyOne secret with fixed authorityThe key lands in a prompt, log or commit — or you cannot scope per end user
Signing relay (e.g. Empyre Vault)A capability to sign or decrypt, not the raw key materialThe risk is key exfiltration, not login-as-user. Vault returns signatures only.

When you actually need an OAuth-for-agents provider

You need this layer when unattended software acts on live accounts the owner already uses: brand social posts, CRM rows, repository merges, inbox triage. The test is not whether an HTTP API exists. The test is whether a cron job should hold the same credential the founder uses in a browser.

You can defer OAuth when the integration is read-only public data, or when a human pastes a one-time token for a single session and accepts the leak risk. Production agents on a schedule usually fail that bar within a week.

Generated products still need upstream OAuth for the founder's tools. A dedicated agent-OAuth product solves identity for **your** app and your agents. It does not replace wiring Gmail, Stripe Connect or X inside a company operator — those are separate integration surfaces.

Build on a general IdP or buy agent-shaped defaults

Auth0, Okta, Clerk and similar providers can issue OAuth tokens to agents. If you already run one for human login, extending it is often the right call. Migration cost usually beats re-learning edge cases.

The trade is configuration surface. Human login journeys treat narrow machine scopes, aggressive refresh rotation and fail-closed introspection as options you must turn on. Purpose-built agent OAuth products argue those behaviours should be defaults because silent misconfiguration is the common failure mode.

Neither choice removes your obligation to model agent identity in application code. The provider issues tokens; your service still decides which agent id may call which route.

Empyre Relay in this category

Empyre Relay at relay.empyre.dev is **OAuth for AI agents** in Empyre's product line: hosted consent, mandatory S256 PKCE, one-time codes, refresh rotation with family revocation, and fail-closed revoke and introspect. The published npm package is @empyre/relay-sdk **1.0.0** on registry.npmjs.org, read 2026-09-21. Relay answered HTTP 200 the same day.

Relay has been feature-frozen since 2026-07-10 — bug and security fixes only, with the SDK OAuth contract kept stable. The scoped GET /relay/oauth/userinfo endpoint (2026-08-06) returns consented profile claims so relying parties stop inventing display handles.

Relay bills separately from Empyre company-builder plans. Dollar tiers on relay.empyre.dev/pricing were not copied here on 2026-09-21; read that page the day you buy.

For SDK install, MCP paste URLs, and the "Relay plugin" search intent, use Relay plugin: SDK, MCP and OAuth. For the HTTP-gateway meaning of "API relay", use API relay for AI agents. For a product-style walkthrough with FAQ and CTA, use OAuth for AI agents — Relay product page — this article is the buyer checklist; that URL is the integration surface.

Where Empyre the company builder fits

Empyre (empyre.dev) turns a brief into a live company: repository, deploy, inbox, payments path, and eight agents that keep operating after launch. That is a different purchase from Relay.

Relay answers how an agent proves identity to **your** application. Empyre answers who runs the business once the application exists. The first deploy ceiling is thirty minutes from submit, not fifteen — agents may ship sooner; the deadline is a ceiling written at launch.

Vault (vault.empyre.dev) and Ledger (ledger.empyre.dev) are sibling products on the same account. Choose Vault when the risk is key exfiltration, Relay when the risk is delegated login, Ledger when the risk is untrusted arithmetic on money rows.

Common questions

What is an OAuth provider for AI agents?

An identity service that issues scoped, revocable credentials to autonomous software after explicit owner consent on a hosted page. It is OAuth 2.x shaped, with defaults aimed at unattended use rather than a one-click human login only.

How is this different from the Relay product page at empyre.dev/oauth-for-ai-agents?

The product page is Relay's feature guide: requirements list, SDK snippet, and sign-up CTA. This article is the category explainer for the head query "oauth for ai agents" and links there for install depth so the two URLs do not compete for the same job.

How is this different from Giving AI agents an identity?

The autonomous-software article explains why agents invert OAuth's human-present assumption. This page is for buyers comparing providers and integration paths today.

Can I use the same OAuth app for humans and agents?

Often yes, if scopes and token lifetimes differ per client. Many teams split clients so agent tokens cannot inherit browser-session breadth by mistake.

Does Relay replace secret management?

No. OAuth solves delegated login. When the agent must sign or decrypt with material that must never leave storage, Empyre Vault or an equivalent signing relay is the matching control. See secret management for AI agents on empyre.dev.

What npm package implements Empyre Relay?

`@empyre/relay-sdk`, latest **1.0.0** on registry.npmjs.org on 2026-09-21. Scope must be `@empyre`, not a fictional `@empyre/relay` package name.

Try Empyre free for 3 days

Describe a business in plain words and watch eight AI agents build and deploy it. Starter is free for the first 3 days.

Start your free trial →

Related

OAuth for AI agents — Relay product pageRelay plugin: SDK, MCP and OAuthAPI relay for AI agentsGiving AI agents an identityHow AI agents leak API keysSecret management for AI agentsRelay productAll articles