TETHESIS
DocumentationAuthentication
DOCUMENTATION · AUTH

Authentication

Six ways to prove who’s calling, from a single operator token to scoped, short-lived capability tokens for one agent run. Every request carries one, and the resolved principal is recorded for supported authenticated write paths; verify release and route coverage.

THE MODES

Pick the credential for the caller

1Bearer (static)

An operator token from the environment, compared in constant time. Simplest; good for a single-tenant server you control.

2API key gq_…

Runtime keys minted by an operator. Stored only as a SHA-256 hash and shown once; limited to named graphs, given a role, optionally an expiry, and revoked immediately (no grace). A key without a write role can’t write.

3JWT

Bearer JWTs from Cognito or any external identity provider, verified against a JWKS URL and issuer.

4HMAC

Per-request signed headers, for server-to-server callers that prefer signing to a stored secret.

5Capability tokens

Signed, short-lived tokens for one principal on one graph — optionally one session and one stated purpose — with a lifetime you choose. Minted from a key; a token never has more rights than the key behind it.

6Tenancy isolation

A per-graph tenant check layered on top, so a key is confined to its tenant’s graphs on every route.

API KEYS

Mint, use, revoke

# create (operator) — the secret is returned once POST /admin/api-keys { "graphs": ["acme"], "role": "writer", "expiresAt": "2027-01-01T00:00:00Z" } # -> { "id": "abc123", "token": "gq_abcdef..." } # use it on every request curl -H "Authorization: Bearer gq_abcdef..." https://invariantdb.com/graphs/acme/cypher # revoke — immediate, no grace period DELETE /admin/api-keys/abc123

Mint a delegated key for an agent run: its rights are the intersection with the parent’s on every request, it never outlives the parent, and one call can suspend every key of a run.

CAPABILITY TOKENS

Scoped to one principal, one graph, a short life

# issue a 1-hour token for "alice" on "acme", one session, one purpose POST /capabilities/issue { "principal": "alice", "graph": "acme", "session": "conv-42", "purpose": "fraud_review", "ttlSeconds": 3600 } # -> { "token": "", "expires_at": 1717891200 }

Remote MCP clients sign in with OAuth: consent is given with an existing key, the token never outranks that key, and revoking the key ends its tokens at once.

INTROSPECTION

See what a credential can do

Ask the server who it thinks you are and what you’re allowed, so you can debug a scope before a call fails.

GET /admin/whoami GET /admin/api-keys/{id}/effective-capabilities

Modes are tried in a fixed precedence order, and whichever resolves populates the request’s Principal — its graphs, role, tenant and (if given) purpose. For supported authenticated write paths, the server records the principal; it is not supplied by the request.

Give each caller exactly what it needs