Sealgraf

Developer guide

The map, not the manual. The step-by-step kit — issuing a key, exact tool inputs, the full error table — is the setup guide.

Production is https://sealgraf.com. Sealgraf checks an agent's proposed purchases against a permission slip (a mandate) its owner set, and seals a receipt as independently verifiable evidence when a checked spend completes. Sealgraf checks and records — it never moves money. The agent still buys through its own channels.

Keys are owner-issued, each with one scope; the owner is the authority behind every credential, and an agent can never create, raise, or edit a slip.

Connect with MCP

The MCP endpoint is hosted on the Sealgraf service itself:

https://sealgraf.com/mcp

Calls carry the credential — an API key in the X-API-Key header, or an OAuth access token as Authorization: Bearer <see_at_…>. The credential selects the workspace; no tenant id is ever sent.

{
  "mcpServers": {
    "see": {
      "url": "https://sealgraf.com/mcp",
      "headers": { "X-API-Key": "see_<the-secret-from-the-owner>" }
    }
  }
}

Four tools exist: check_permission, check_status, report_purchase and get_receipt. None of them moves money. An agent with a REST channel can finish a spend over REST with the decision token and the evidence; an agent that only speaks MCP reports its purchase with report_purchase, and the receipt seals it as reported by the agent. Access tokens are short-lived; refresh is rolling.

Your first check

Introduce yourself first. Before the first check, make one REST call:

curl https://sealgraf.com/v1/whoami \
  -H "X-API-Key: see_<the-secret-from-the-owner>"

GET /v1/whoami answers with your own binding: the slip's id, the agent name it expects, its category ids, and its currency. A wrong tie shows here, before any money moves.

Then check, before buying. The check_permission tool takes the purchase facts flattened: mandate_id, agent_id, category, amount_minor, currency, plus optional counterparty and description. Amounts are integers in the currency's minor unit — $42.50 is 4250.

Every check ends in one of three outcomes:

  • allow — the purchase fits the slip, and the answer carries a decision_token: short-lived, single-use, bound to this exact action.
  • needs_human_approval — the purchase fits the caps but is above the owner's ask-me-first threshold. No token is issued to you. Stop and wait; if the owner approves, a token is issued for you at approval time and you claim it (next section).
  • deny — the purchase does not fit the slip. Do not buy. The reason_code says which rule refused it, and a denial is final unless the owner changes the slip.

Complete and keep the evidence

On allow, buy through your normal channel, then complete over REST: POST /v1/preauthorize/<preauth_id>/complete with the decision_token, a unique completion_nonce, and the evidence — the amount actually charged (completed_amount_minor, in cents), what was bought, and the rail's own reference. Report only facts you saw; never a full card number — last 4 only.

If the owner approved an ask, claim the token first with POST /v1/preauthorize/<preauth_id>/decision-token — before you buy. Only the key that ran the check can claim.

The response is the sealed receipt. Keep its receipt_id:

  • Read it back with the get_receipt tool or GET /v1/receipts/<receipt_id> — the full DSSE envelope.
  • Anyone holding a receipt's proof bundle can check it as a stranger, no key needed, on the Check a receipt page — the envelope verifies on its own signatures.

De-identified sealed records are retained for five years (see the Privacy policy).

Handle errors

Tool calls return {"error": <name>, "detail": <explanation>}; REST returns the same situations as HTTP statuses. The ones a first integration hits:

name / statusmeaningwhat you do
Unauthorized · 401no key, or the key was revoked / expiredStop. Tell the operator the key is dead. Never retry with a different or guessed key.
Forbidden · 403the key's scope or slip-tie doesn't allow this, or a tenant argument was passedDo not work around it. Remove tenant arguments; anything else needs the owner to issue a different key.
NotFound · 404the id doesn't exist in your workspaceCheck the id. Never probe other ids looking for a hit.
ValidationFailed · 422malformed input (wrong type, unknown field, unsupported evidence key)Fix the input shape, once. If it persists, stop and report.
Conflict · 409the item's state moved (already completed / aborted, token used)Re-read the item's state and follow it; never force.

Claim answers carry their own 409 codes: not_approved_yet (keep polling), decision_token_expired (do not buy), and already_completed (never buy twice).

Never treat a timeout as approval. A timed-out check has an unknown outcome: the only proof of an allow is a decision outcome carrying a token. Re-read the record, or repeat the check with the same idempotency_key, before buying anything.

The full error table, the denial reason_code list, and rate-limit behaviour are in the setup guide.