---
title: "Regents Labs agent authentication"
description: "Authenticate a client with OAuth or sign agent requests with SIWA, from setup through revocation."
canonical: "https://staging.regents.sh/auth.md"
---
# Regents Labs agent authentication

## Discover

Read [the protected resource metadata](https://staging.regents.sh/.well-known/oauth-protected-resource/mcp) for the hosted MCP server, then [the authorization server metadata](https://staging.regents.sh/.well-known/oauth-authorization-server) for its issuer, endpoints and supported scopes. A protected call can return a `WWW-Authenticate` challenge pointing to its metadata. Public documentation and the [sample account response](https://staging.regents.sh/sandbox) need no credentials.

## Pick a method

Use OAuth when connecting an app to [hosted MCP](https://staging.regents.sh/mcp). Use [Sign-in with Agent](https://staging.regents.sh/docs/siwa) for an agent calling the signed REST API. These credentials have different audiences. A browser session belongs to the person who signed in.

## Register and claim

An OAuth client can use its HTTPS client ID metadata document, or register a public client at the issuer’s `registration_endpoint` with its exact redirect URI. Start the authorization-code flow with S256 PKCE, a fresh state, the MCP resource and the scopes the task requires. The account owner signs in and reviews consent.

For signed REST calls, follow [agent setup](https://staging.regents.sh/start). The owner creates a short-lived pairing code. The agent redeems it using its own signing key. Keep the code and private key out of URLs, chat and logs. Regents uses owner-approved pairing and consent. WorkOS anonymous registration, identity assertions (ID-JAG), and claim-token exchanges are unsupported.

## Exchange and use the access token

An OAuth client verifies state on return and sends the code, its original PKCE verifier, redirect URI and resource to the advertised `token_endpoint`. Send the resulting access token only in the `Authorization: Bearer` header on its intended resource. The identity permission is `regent.identity.manage`. Request `regents.agent` only for work as the owner's paired agent. Product permissions still apply. A signed REST client signs each request, including retries, through its SIWA client.

## Errors

On a 401, inspect the challenge and check the resource, credential and expiry. On a 403, check the account’s pairing and the permission for the requested action. On a 429, wait for `Retry-After` before trying again. See [limits](https://staging.regents.sh/docs/limits) and [errors](https://staging.regents.sh/docs/errors).

## Revocation

An OAuth client can use the issuer’s `revocation_endpoint`. The account owner can revoke an app at [Connected apps](https://staging.regents.sh/oauth/connections) and remove an agent pairing from [Agents](https://staging.regents.sh/account/agents).
