---
title: Revocation and the kill switch
summary: How to stop one agent, one app or every agent in a realm right now, and how your own servers find out within seconds.
section: agents
order: 7
---
# Revocation and the kill switch

How to stop one agent, one app or every agent in a realm right now, and how your own servers find out within seconds.

Access tokens are JWTs that your servers can check offline, so by default a revoked token is only noticed when it expires. Tessera ends tokens sooner in two places: at Tessera itself, on every request, and at your servers through a signed feed they poll.

## Ways to end a token

| What you do | What it ends |
| --- | --- |
| `tessera kill agent <id>` | One agent: delegated agent, service account or workload issuer |
| `tessera kill client <client_id>` | Every token issued to one client, user tokens included |
| `tessera kill realm --yes` | New agent tokens for the whole realm (not people) |
| Disable or delete a delegated agent | The agent's tokens, like a kill |
| `POST /revoke` | One access token, by its owning client |

Kill needs the `tessera:realm-admin` scope and is not available for Tessera's own operator realm. Every kill is reversible with `resume`.

## Kill

```sh
tessera kill client rogue-sync --realm acme --reason "key leaked"
```

The same call over HTTP:

```sh
curl -sS -X POST "$ADMIN/clients/rogue-sync/kill" \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"reason": "key leaked"}'
```

```json
{
  "kind": "client",
  "subject": "rogue-sync",
  "state": "killed",
  "tokens_not_before": "2026-10-25T09:00:00.123456Z",
  "killed_at": "2026-10-25T09:00:00.123456Z",
  "reason": "key leaked"
}
```

| Endpoint (under `$ADMIN`) | Target |
| --- | --- |
| `POST /agents/<id>/kill` | An entry of the agent inventory, by its `id` (`GET $ADMIN/agents`). For a service account that is the client's UUID, shown as `client_uuid` by `tessera agents list`. It is reported as a `client` kill |
| `POST /clients/<client_id>/kill` | One client |
| `POST /kill` | All agent-class issuance in the realm |

Each has a matching `/resume`, which answers with `"state": "active"`. The body is optional JSON with a `reason` of up to 512 characters. Both calls are idempotent. A caller without the scope gets `403`, an unknown target `404`, Tessera's own operator realm `403`. `kill realm` and `resume realm` only print a dry run unless you pass `--yes`.

What a kill does:

- It sets the target's `tokens_not_before` to now. Any token issued at or before that moment is dead. The clock has one-second resolution, so a token issued in the same second is dead too.
- It stops new tokens from the target (see below).
- Tessera checks this on every request from the database, so a kill through one server applies to the next request on every server. If the state cannot be read, the token is refused.
- A realm kill stops `client_credentials`, JWT bearer and token exchange tokens. It does not stop people signing in, and it spares tokens whose only audience is the admin API, so administrators can still resume.
- `resume` lifts the suspension. Tokens issued before the kill stay dead; the agent needs new ones.

## What a killed agent sees

New token requests get `403` and a typed error:

```json
{
  "error": "access_denied",
  "error_description": "the client is suspended",
  "error_code": "client_suspended"
}
```

| `error_code` | Cause |
| --- | --- |
| `client_suspended` | The client was killed; it gets no token from any grant |
| `agent_suspended` | The delegated agent was killed or disabled |
| `workload_suspended` | The trusted issuer behind the workload was killed |
| `realm_suspended` | The realm's agent issuance is suspended |

Your reason is never shown to the agent. It is stored in the audit log and returned to you. A killed agent that keeps asking is audited as `token.issuance_refused`, at most once a minute per client and cause.

Calls with an old token get `401`: introspection answers `{"active": false}`, UserInfo and the admin API answer `401`. A token that is DPoP-bound is ended the same way, before its proof is looked at.

## Disable or delete an agent

For a delegated agent:

```sh
curl -sS -X PATCH "$ADMIN/users/$USER_ID/agents/$AGENT_ID" \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H "Content-Type: application/json" \
  -d '{"enabled": false}'
```

Disabling is the same kill (audited as `agent.killed` with the reason "agent disabled"). Enabling again resumes it, and earlier tokens stay dead. Deleting an agent ends every token whose `act` chain names it. The owner can also remove an agent from the account app.

## Revoke one access token

The client a token was issued to can revoke it:

```sh
curl -sS "$ISSUER/revoke" -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d token="$ACCESS_TOKEN" -d token_type_hint=access_token
```

The answer is `200` with an empty body, also for unknown or foreign tokens (those stay usable by their owner). Only the owning client can revoke a token, and a DPoP-bound token needs no proof for this. A client may hold at most 10,000 live revoked tokens, then `503`.

## Revocation feed

`GET $ISSUER/revocations?since=<cursor>&limit=<n>` is public, like the JWKS. It returns a compact JWS with media type `application/revocations+jwt`, signed with the realm key and typed `revocations+jwt`, so it can never be mistaken for an access token. Its claims:

```json
{
  "iss": "https://login.kurthlabs.com/realms/acme",
  "iat": 1790000000,
  "exp": 1790000300,
  "cursor": 42,
  "has_more": false,
  "events": [
    { "seq": 41, "kind": "client", "sub": "rogue-sync", "nbf": 1790000000 },
    { "seq": 42, "kind": "jti", "jti": "3b0a4a64", "exp": 1790000900 }
  ]
}
```

- `kind` is `realm`, `client`, `agent`, `workload` or `jti`. For the first four, a token whose `iat` is at or before `nbf` (the epoch, in seconds) is dead. A `client` event covers every token of that client id. An `agent` event covers any token with that agent in its `act` chain. A `workload` event covers tokens of that issuer. A `realm` event covers agent-class tokens only.
- `jti` events list single revoked tokens until their own `exp`.
- Events come oldest first. Pass the last `cursor` as `since` to continue; `limit` is 1 to 1000 (default 500). Events are kept at least 48 hours, longer than a token lives.
- Discovery advertises the URL as `tessera_revocations_endpoint`.

Your resource server can poll the feed itself: fetch it every 30 seconds with the last `cursor`, verify the signature against the realm's keys (the header `typ` must be `revocations+jwt`), keep the `client`, `agent`, `workload` and `realm` cutoffs and the `jti` entries in memory, and refuse any token your validator accepts that matches one. A revocation then takes effect within one polling interval. If the feed cannot be reached, decide deliberately: keep judging tokens by signature and claims alone (the API stays up, a killed token lives until it expires), or refuse every token once your last successful poll is too old. The helper libraries that would do this for you are planned, not published yet.

A validator that does not poll the feed keeps accepting a killed agent's tokens until they expire. Keep agent token lifetimes short, or call `POST $ISSUER/introspect` for every request. Introspection needs a confidential client that is registered with your server's URL in its `allowed_resources` (a public client gets `401 invalid_client`), and it sends its credentials like any token endpoint call: `curl -sS "$ISSUER/introspect" -u "$RS_CLIENT_ID:$RS_CLIENT_SECRET" --data-urlencode "token=$ACCESS_TOKEN"`.

## Get told when an agent is killed

Subscribe a webhook to `agent.killed`, `agent.resumed`, `realm.killed` and `realm.resumed` (the pattern `agent.*` matches the first two). The delivery is the audit row, signed like every webhook (see [webhooks](/docs/connect/webhooks.md)):

```json
{
  "event": "agent.killed",
  "realm_id": "019e5b94-0000-7000-8000-000000000000",
  "occurred_at": "2026-10-25T09:00:00.123Z",
  "actor": { "type": "user", "id": "6f1d2c1e-3b0a-4a64-9c53-0b1a8d0e5f11" },
  "subject": { "type": "client", "id": "rogue-sync" },
  "on_behalf_of": null,
  "metadata": { "kind": "client", "reason": "key leaked", "tokens_not_before": "2026-10-25T09:00:00.123456Z" }
}
```

Use it to stop the matching work in your own systems at once. The events are also in the [webhook event list](/docs/reference/webhook-events.md).

> **Planned.** The admin console has no kill button yet; use the CLI or the API.
