How a user's own agent (Claude Code over MCP, a script) calls the API as that user, without a browser session.
A personal access token is an opaque bearer credential (ppat_…) a signed-in user creates for
themselves. It resolves to that same user, in the organization it was created in, while they are
still a member of it. Permissions are not stored on the token: on every request the deployment host
binds them from the deployment access policy and the user's verified identity, exactly as for a
browser session. A token therefore does exactly what its owner may do now, and a role removed from
the owner is gone from the token at once.
A token never impersonates (the backend ignores the impersonation headers for it and the middleware refuses them with 403) and cannot list, create or revoke tokens. Every write it makes is recorded under the owner's name, like any other write.
| Send | Authorization: Bearer ppat_…; X-Process-Platform-Organization is optional and must match |
| Lifetime | Chosen at creation, 1 to 365 days (default 90) |
| Stored | SHA-256 hash, name, owner, organization, created, last used, expiry; never the secret |
| Revoke | DELETE /api/access-tokens/{id} from the owner's browser session; immediate |
Tokens are kept per deployment owner: Mongo collections access-tokens-v1-…, oauth-clients-v1-…
and oauth-codes-v1-… under the Mongo driver, one JSON file in the data directory under the file
driver, memory under the memory driver.
A token's access is chosen when it is made (scope on POST /api/access-tokens) and cannot change:
scope | What it may do |
|---|---|
full (default, and every older token) | Everything its owner may do, in every application. |
steps | Only in the application it was made from (the frontend proxy's stamp), with the owner's permissions narrowed to an allowlist: read items, save and complete steps, notes and follow-ups. Never starts, shares, abandons, reopens or deletes. |
read | Bound the same way; its allowlist may name only processes:read, processes:read_all, processes:audit and templates:read (anything else is refused at creation, 400 invalid_scope). Every write is refused (403 token-scope), including any write added later: the deployment host lets such a token through only a fixed list of reads. |
GET /api/me reports a scoped token's accessTokenScope. Using a token from a script:
drive runs over the JSON API.
An MCP client signs in with OAuth 2.1 instead of a pasted token. The frontend hosting the MCP
server is the authorization server: it publishes RFC 9728 protected-resource and RFC 8414
authorization-server metadata, accepts RFC 7591 dynamic registration of public clients, shows a
consent page that requires the user's normal app sign-in, and exchanges a single-use code (with a
PKCE S256 verifier) for an access token that is one of the user's personal access tokens (1 hour)
and a refresh token (30 days) that rotates on every use. Replaying a used refresh token revokes the
grant. Clients, codes and grants live in the backend (/api/oauth/*), hashed; the connection
appears in the user's token list under the client's name.
The Auth0 tenant is not involved: users sign in to the app as usual, and the app issues the
client's token. Spell review is the first frontend to host this; see
applications/spell-review/docs/mcp.md.
full token is not narrowed to one application: it reaches whatever its owner's browser session
reaches through the API. Its application is recorded for display only.lastUsedAt is written at most once a minute per token.