Skip to main content

Trust Model

TokHive connects three parties who don't trust each other: Consumers who send requests, Providers who supply their subscriptions, and Hive, the marketplace service in between. This page explains who can see what today, what each party has to trust, and what is still planned.

The parts​

PartRuns whereRole
HiveTokHive's serversAuthenticates Consumers, routes requests, meters usage, settles payments.
TEEA Trusted Execution Environment (AMD SEV-SNP) operated for TokHiveOpens the Provider's credential, executes each request against the upstream vendor, signs a receipt.
BeeThe Provider's own machineKeeps the Provider's subscription available and relays encrypted traffic to the upstream vendor. Open source.
Upstream vendorOpenAI, AnthropicServes the model.

TokHive Architecture

Who can see what​

DataConsumerHiveTEEBee / Provider
Provider's access tokenNoSealed envelope onlyYes, inside the enclaveReads it locally from the official client
Provider's refresh tokenNoNoNoStays in the official client's store
Consumer prompts and model responsesTheir ownYes, in plaintextYes, inside the enclaveNo, encrypted TLS bytes only
Consumer's identityTheir ownYesNoNo
Provider's identityNoYesA pseudonymous device ID onlyTheir own
Model, token usage, costTheir own callsYes—No; only target host, byte counts and timing in receipts

Two points follow from this table:

  • Provider credentials are protected from Hive. Bee encrypts the access token to a public key that only the TEE holds. Hive stores and forwards the sealed envelope but can't open it.
  • Consumer traffic is not hidden from Hive. Hive receives each request from the Consumer over HTTPS, translates it where needed (for example from Chat Completions to Responses), and passes it to the TEE. An end-to-end encryption option that would hide prompts from Hive too is planned.

What each party trusts​

As a Consumer​

You trust Hive with your prompts and responses, the same way you would trust any API provider. In exchange, the TEE gives you guarantees no ordinary relay can:

  • Your request goes only to a host on the allowlist built into the TEE image, over a TLS session that ends inside the TEE. For a Provider's subscription or API key, that is the vendor's own endpoint: chatgpt.com, api.openai.com or api.anthropic.com. When fallback supply serves the request, it goes to a vetted premium API service instead. The receipt records the host that was actually called. The Provider's machine only relays encrypted bytes and can't read, change or substitute the request or the response.
  • Every execution has a receipt signed inside the TEE, and Hive verifies it before you are charged. See Execution Receipts.
  • A Provider can't see who you are or what you asked.

As a Provider​

You don't have to trust Hive with your credentials:

  • Bee checks the TEE's hardware attestation itself before it seals anything, so the key it encrypts to belongs to a TEE image this Bee release trusts. Hive only passes the key on and can't swap in one of its own. See How the access token is sealed.
  • Your access token leaves your machine only sealed to the TEE. Your refresh token is never sent to Hive or to the TEE. Bee uses it only on your machine, to renew the login directly with the vendor: automatically for Codex, and for Claude only if you enable token refresh. See Renewing the login.
  • Bee connects only to the hosts in its allowlist, and every upstream connection leaves from your own IP.
  • Bee is open source, so you can check what it does with your login.

You do trust the TEE operator's hardware attestation: that the TEE runs the published image and keeps your token inside the enclave.

Trusting the TEE​

Neither Hive nor Bee simply trusts the TEE:

  • Every connection from Hive to the TEE uses mutual TLS with remote attestation (RA-TLS). Hive checks the hardware attestation report and that the TEE runs the expected image measurement before sending anything.
  • Bee checks the TEE's attestation independently of Hive before sealing a credential. It accepts only the TEE images and whitelist built into its release, and only a TEE booted under TokHive's Secure Boot release key.
  • Every receipt carries its own attestation report, which proves that the key that signed it belongs to a genuine SEV-SNP enclave running the expected image.
  • The list of upstream hosts and paths the TEE may call is built into the measured image, and every receipt names it.

What is stored​

  • Call records keep metadata only: endpoint, model, timing, status, usage, cost and receipt digests. Prompts, responses, request headers and API keys are not written to them.
  • Receipts are kept permanently, unaltered.
  • Failed calls: when a call fails, Hive keeps the Consumer's request and the upstream's response in restricted diagnostic logs to troubleshoot the failure. API keys, credentials and other sensitive headers are redacted. These logs are deleted after 3 months. Nothing is kept for successful calls.
  • Bee logs never contain tokens, prompts or responses.

Current limitations​

  • Hive handles Consumer prompts and responses in plaintext. End-to-end encryption is planned.
  • Consumers can download each receipt and verify its signature, hardware attestation and TEE release themselves; see Verify a receipt yourself. Proving which model produced a response is the goal of Web Proof.
  • A receipt proves where a request was sent and what bytes came back. It does not by itself prove the token usage that was billed; Hive takes usage from the verified response.
  • Bee versions before v0.0.12 don't check the TEE's attestation. They take the TEE's public key from Hive and check only that it matches its ID, so with them you trust Hive to hand over the real key. Update Bee to get the check.