Skip to content
TesseraDocs
MenuQuotas and usage

Quotas and usage

How Tessera limits how fast an agent or client can ask for tokens, how to set those limits, and how to see what each agent was issued.

View as Markdown

On this page

How Tessera limits how fast an agent or client can ask for tokens, how to set those limits, and how to see what each agent was issued.

One agent stuck in a retry loop should not take down a realm. Every client and every delegated agent is limited on the token endpoint, and the limits are shared by all Tessera servers.

What is limited

  • Token requests with client_credentials, the JWT bearer grant (jwt-bearer) and token exchange.
  • Not human sign-in (authorization code, refresh and device flows), which has its own protection against repeated failures.
  • Not calls to your own APIs. Tessera does not count those. See limiting calls in your own API.

A request that fails earlier (a bad assertion, a bad subject token, wrong credentials) does not spend the client's allowance.

The four limits

Field Meaning
token_rate_per_minute How fast the allowance refills
token_burst How many requests may arrive at once. Default: a tenth of the rate, at least 1
max_active_exchanges How many unexpired exchanged tokens one agent (or one client, across all its agents) may hold
daily_token_cap Admitted requests per UTC day

Each field is a positive whole number or unset. An unset field takes the realm default, and an unset realm default takes the platform ceiling. Nothing you set can exceed the ceiling; a higher value is rejected with 400.

The platform ceilings are chosen by the Tessera operator. The defaults are generous so healthy clients never notice them: 6000 requests a minute, a burst of 600, 10,000 active exchanged tokens and 10 million requests a day. A ceiling of 0 means no limit on that field.

Set a limit for one agent

PUT $ADMIN/agents/<kind>/<id>/quota (scope tessera:agents:write) replaces the whole policy of one agent. kind is delegated (the id of a delegated agent) or service_account (the id of the client, the UUID that tessera clients get shows, not its client_id). A workload has no limit of its own; set the limit on the client that requests its tokens.

curl -sS -X PUT "$ADMIN/agents/delegated/$AGENT_ID/quota" \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"token_rate_per_minute": 120, "token_burst": 20, "max_active_exchanges": 50}'
{
  "policy": { "token_rate_per_minute": 120, "token_burst": 20, "max_active_exchanges": 50 },
  "realm_defaults": {},
  "effective": { "token_rate_per_minute": 120, "token_burst": 20, "max_active_exchanges": 50, "daily_token_cap": 10000000 },
  "ceilings": { "token_rate_per_minute": 6000, "token_burst": 600, "max_active_exchanges": 10000, "daily_token_cap": 10000000 }
}

GET on the same path reads it (scope tessera:agents:read). Send {} to clear the policy so the agent inherits again. effective is what is enforced now.

The realm default applies to every client and agent that sets nothing. It uses tessera:realm:read and tessera:realm:write:

curl -sS -X PUT "$ADMIN/agent-quota-defaults" \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"token_rate_per_minute": 300, "daily_token_cap": 50000}'

Changes are audited as agent.quota.updated and realm.agent_defaults.updated.

When a request is refused

A limited request gets 429 Too Many Requests with a Retry-After header (whole seconds, at least 1) and an RFC 6749 error body:

HTTP/1.1 429 Too Many Requests
Retry-After: 12
Cache-Control: no-store
Content-Type: application/json

{"error": "temporarily_unavailable", "error_description": "too many token requests; retry after the interval in Retry-After"}
  • An empty bucket refills in time. A daily_token_cap refusal sets Retry-After to the seconds until UTC midnight. A max_active_exchanges refusal sets it to the time until the earliest held token expires.
  • 503 with the same error means Tessera could not decide and refused to guess. Retry after the Retry-After seconds.
  • A refused request does not use up a JWT bearer assertion. Send the same one again after the wait.
  • Keep your cached token until it expires instead of asking for a new one on every call.
async function tokenWithBackoff(request: () => Promise<Response>): Promise<Response> {
  for (let attempt = 0; attempt < 5; attempt++) {
    const response = await request();
    if (response.status !== 429 && response.status !== 503) return response;
    const wait = Number(response.headers.get("Retry-After") ?? "1");
    await new Promise((resolve) => setTimeout(resolve, wait * 1000));
  }
  throw new Error("token endpoint still limiting after 5 tries");
}

See what an agent was issued

GET $ADMIN/agents/<kind>/<id>/usage?from=2026-10-01&to=2026-10-24 returns one row per UTC day, oldest first, plus totals. kind is delegated, service_account or workload (the id of the trusted issuer). Both dates are inclusive and optional: the default is the last 30 days, and the longest range is 366 days.

{
  "items": [
    { "day": "2026-10-23", "tokens_issued": 412, "exchanges": 130, "refused": 2, "rate_limited": 0 },
    { "day": "2026-10-24", "tokens_issued": 977, "exchanges": 301, "refused": 0, "rate_limited": 6 }
  ],
  "totals": { "day": "total", "tokens_issued": 1389, "exchanges": 431, "refused": 2, "rate_limited": 6 },
  "from": "2026-10-01",
  "to": "2026-10-24"
}
Counter Counts
tokens_issued Access tokens issued
exchanges Those issued by token exchange
refused Token requests the grant itself answered with a 4xx error
rate_limited Requests answered 429 by a quota

The call needs tessera:agents:read and tessera:audit:read, plus tessera:realm-admins:read for a service account or tessera:trusted-jwt-issuers:read for a workload. Counters are written in the background in batches, so the newest minute can lag by a moment.

Audit trail

Each refusal is counted exactly in rate_limited, but the audit log gets one token.rate_limited event per agent per minute, with suppressed saying how many refusals it stands for, so a loop cannot flood the log. The event carries the reason (rate, daily, agent_active_exchanges or client_active_exchanges), retry_after_seconds and the effective limits, and never a token or secret.

Issuance events (token.issued.client_credentials, token_exchange.issued, jwt_bearer.issued) carry agent_id and client_id. Filter the audit log with them: GET $ADMIN/audit?agent_id=<id> or ?client_id=<client_id>.

Limiting calls in your own API

Tessera limits token requests, not what an agent does with a token. To meter calls in your own API, key your limiter on the token's sub and act.sub (the agent) or client_id. The jti identifies one token. Use the usage endpoint to see how many tokens each agent was issued.

Planned. There are no tessera agents quota or tessera agents usage commands, no quota methods in the Go and TypeScript admin clients, and no usage tab in the admin console yet. Use the API calls above.