AI agents

Authentication and authorization for AI agents

Authorizer lets an AI agent act on a user's behalf without inheriting the user's full reach. The agent exchanges the user's token for a short-lived delegated token, every permission check requires both the agent and the user to be allowed, and every action is recorded against the agent.

How an agent acts for a user

An agent is a service account in Authorizer's client registry. It authenticates with its own credentials (a client secret, or a workload identity token such as a Kubernetes or SPIFFE JWT) and exchanges the user's access token for a delegated token using RFC 8693 token exchange.

The delegated token names both identities: sub is the user and act.sub is the agent. It lives five minutes, has no refresh token, is bound to exactly one resource (RFC 8707), and its scopes are the intersection of the user's scopes, the agent's allowed scopes and what was requested.

Permissions: the agent and the user must both be allowed

When the authorization model declares type agent, a check made with a delegated token passes only if the agent and the user each hold the permission. An agent with a broad grant can't reach a document its user can't see, and an agent with no grant can do nothing, whatever the user's access.

  • Time-limited agent grants: a tuple can carry a condition such as non_expired_grant, and the server's own clock decides when it expires.
  • Task-scoped grants: grant a task once, assign agents to it, and delete one tuple to end the task for every agent.
  • A delegated token can't send condition context or contextual tuples, so an agent can't extend its own window or assert access it wasn't given.

Revocation and audit

Every exchange checks that the user's originating session is still live, so signing the user out stops the agent from minting new tokens. Delegation chains are capped at four hops, and audit logs record the acting agent and the user it acted for.

Run it locally

Start a server with Docker, then follow the token exchange guide to register an agent.

docker run -p 8080:8080 \
  -v authorizer_data:/authorizer/data \
  quay.io/authorizer/authorizer \
  --database-type=sqlite \
  --database-url=/authorizer/data/data.db \
  --url=http://localhost:8080 \
  --client-id=123456 \
  --client-secret=secret \
  --admin-secret=admin \
  --jwt-type=HS256 \
  --jwt-secret=test \
  --encryption-key=test-encryption-key

Frequently asked questions

Can an AI agent get a token that never expires?
No. Delegated tokens last five minutes and cannot be refreshed. The agent needs a valid user access token and a live user session to mint a new one, and its permissions can additionally be time-limited with conditional grants.
What stops a prompt-injected agent from accessing more data?
Each check requires both the agent and the user to hold the permission, the subject is pinned server-side, and delegated tokens can't send contextual tuples or condition context. The agent can only use access it was explicitly granted.
Is this a hosted service?
No. Authorizer is open source (Apache-2.0) and self-hosted; users, agents and permissions live in your own database.