Keys and credentials
Admin Keys, Identity Keys, sessions: what each one may do, and how errors answer.
Admin Key
An API key with Org scope (tigby_admin_…). Minted in the console, with POST /api/keys, or by
tigby login; named, shown once, stored hashed. Wherever a console session is accepted, an Admin
Key is too, except on the session endpoints themselves. Revoking one (DELETE /api/keys/{id} in the
reference, tigby key revoke in the CLI) takes effect on the next request: 401 api_key_invalid.
An Org holds at most 50 live Admin Keys on every Plan. Revoked ones do not count, and neither do
Identity Keys. Every tigby login mints a key of its own and leaves the one before it live, so a
machine that signs in over and over is what usually reaches the cap. The 51st is refused with 403
admin_key_quota_exceeded, and a tigby login confirmed at the cap mints nothing: the login is
refused and the terminal stops with the same code. GET /api/keys and tigby key list show when
each key was last used; revoke the ones no longer in use, and tigby logout revokes the key of the
machine it runs on.
Identity Key
An API key scoped to a single Identity (tigby_id_…). An Identity holds several, each with a name:
one per Instance (each copy of a deployment, each harness session, the copy on your laptop next to
the one in production) that you want to tell apart, revoke on its own, and see the last use of.
Instances that need not be told apart may share one, but not Instances that claim Mailbox messages,
because a claim names the key it was made under (Several Instances on one
Mailbox).
Retrieve the first key
The first one is minted by the last step of provisioning and handed over by GET /api/identities/{handle}/identity-key, not by the status read, which carries no credential in any
state. That route answers with it on every call until POST /api/identities/{handle}/identity-key/ack says it arrived or its short window closes, because a
dropped response must not destroy a key whose plaintext exists nowhere else.
Create further keys
Every further key is minted with Org scope: a console session on the Identity's page, an Admin Key
on POST /api/identities/{handle}/keys, tigby key create --identity @orderbot --name production,
or tigby login --identity @orderbot on the machine that is to hold it, which you confirm in the
console like the operator's login and which mints nothing with Org scope. Its name is unique among
the Identity's live keys, case aside, and an Identity holds at most ten live keys on every Plan, the
first one included, revoked ones not.
The eleventh is refused with 403 identity_key_quota_exceeded: revoke the ones no longer in use
first. GET /api/identities/{handle}/keys and tigby key list --identity @orderbot list them all,
revoked ones too, with when each was last used. An Identity Key never mints or lists its siblings (a
key that could would outlive its own revocation) and is refused there with 403
admin_scope_required.
A lost key is replaced by minting a new one. A rotation is the same three steps in order: mint the new key, deploy it, revoke the old one.
An Identity Key may act as its own Identity; on another Identity it is refused with 403 identity_scope_mismatch, and on Org-level endpoints with 403 admin_scope_required. All of an Identity's keys are revoked as the first act of its teardown.
Revocation and Tunnel connections
Revoking an Identity Key by hand (DELETE /api/keys/{id}, tigby key revoke) also severs the Tunnel connections that key opened: a control connection is authorized once, when the agent connects, so without the sever a leaked key would keep an inbound path into your machine open for as long as the agent stayed connected. Traffic in flight on those connections ends mid-request, and the agent holding the revoked key does not come back.
Instances on the Identity's other keys keep serving. A tunnel server that could not be reached is owed the sever and retried until it confirms; one that answers and refuses turns the call into a 500, and the key is revoked either way, so retry it.
Limit the agent’s credentials
Give the agent an Identity Key, keep the Admin Key for yourself: the agent can then read its mail,
run its Tunnel, and post through its Connectors, but cannot create Identities, change the allowlist,
or touch billing. The machine the agent works on holds that Identity Key and no Admin Key (a harness
can be talked into whatever its machine's key allows, through a tool or a shell) so tigby mcp
refuses an Admin Key unless --admin is given, and tigby login --identity is how that machine is
signed in.
Sessions and magic links
The console signs in with a magic link: a one-time, 15-minute link mailed on signup and on every later sign-in; there is no password. Consuming it mints a server-side session carried in an httpOnly cookie. Sessions expire after 30 days and are revocable.
An address signs in to one Org, and it is compared without regard to case or to a +tag in its local part, whatever the domain: name+work@example.com signs in to the Org name@example.com opened rather than opening a second one, and the link goes to the address as it was signed up with. Provider rules such as the dots Gmail ignores are not applied.
Errors
Every refusal is an RFC 9457 problem document with three Tigby members on top:
code: stable, part of the contract; branch on this.agent_hint: the next step, such as fixing the call, waiting, or stopping.doc_url: where a human reads more.
title and detail are prose and may change; the code does not. Both SDKs raise this shape as TigbyError, and the MCP server returns it in structuredContent.