Sealed API keys

Seal each request on your machine, so Morse's relay sees only ciphertext, with morse-seal or attested().

A plain request with an sk_ key is encrypted in transit, but Morse's relay opens it on its way to Morse's enclave. Sealing encrypts each request on your machine to a key that only an attested enclave holds, so the relay, the load balancer, and the hosts in front of the enclave see ciphertext only. You keep your OpenAI SDK and change its base URL.

Two ways to seal

ToolForHow
morse-sealAny language, any OpenAI SDK, curlA sidecar on your machine that serves the OpenAI API at http://127.0.0.1:4141/v1 and seals every request it forwards.
attested()Node 24 or later, with gitA fetch for the OpenAI SDK, from @askmorse/verify, that seals in your process.

Both check Morse's enclave the way the verifier does before they seal anything, and both refuse to send a request the relay could read. The rest of this page is about morse-seal.

Install morse-seal

With Go 1.27.3 or later:

Terminal
go install github.com/trymorse/morse-seal/cmd/morse-seal@latest

Or download a binary for Linux, macOS, or Windows, on amd64 or arm64, from the releases. Each archive and the container image carry a GitHub build provenance attestation, which names the workflow run and commit that built them. Check it before you run the binary:

Terminal
gh attestation verify morse-seal_<version>_linux_amd64.tar.gz --repo trymorse/morse-seal
gh attestation verify oci://ghcr.io/trymorse/morse-seal:<version> --repo trymorse/morse-seal

Or run the container image:

Terminal
docker run --rm -p 127.0.0.1:4141:4141 -e MORSE_API_KEY \
  ghcr.io/trymorse/morse-seal --floor tee --upstream https://inference.trymorse.ai

Run it

Start the sidecar with your key:

Terminal
MORSE_API_KEY=sk_... morse-seal --floor tee --upstream https://inference.trymorse.ai

--upstream https://inference.trymorse.ai is where an sk_ key is taken; api.trymorse.ai refuses one. --floor tee keeps every chat on a model in an attested enclave. Each time the sidecar first trusts an image, it prints the image's tag, the start of its PCR0, and the commits that pin it and publish its source:

Output
morse-seal: trusting image v2026.11.24 pcr0 6314f0abf19cb012… pinned by trymorse/morse-pins@b98cc6bd09689d3dc57e387a92a10907cfc9f5a2, source commit 3d7113c7cc603e9a86d0bd8deb4c644914b6d172

Then point your SDK at http://127.0.0.1:4141/v1. The SDK's own API key can be any value: the sidecar puts your sk_ key on the outer request.

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:4141/v1", api_key="morse-seal")
stream = client.chat.completions.create(
    model="z-ai/glm-5.3",
    stream=True,
    messages=[{"role": "user", "content": "Hello"}],
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Setting OPENAI_BASE_URL=http://127.0.0.1:4141/v1 works too, in place of the base URL in code.

Flags

FlagDefaultWhat it does
--key$MORSE_API_KEYYour sk_ key. It goes on the outer request only.
--floorNoneThe lowest tier a chat may use: anon, private, or tee. It sets provider.min_privacy inside the seal, and refuses every other content route.
--privacy-veilOffAsks for the Privacy Veil inside the seal on every chat, and withholds a reply the enclave didn't veil.
--upstreamhttps://inference.trymorse.aiThe Morse API. api.trymorse.ai refuses an sk_ key.
--listen127.0.0.1:4141The address to serve the OpenAI API on.
--pins-commitmain of morse-pinsThe morse-pins commit whose list of images to trust, so the list changes only when you change the flag.

morse-seal --help lists the rest.

What --floor refuses

The floor goes in a chat's body, so with --floor the sidecar seals only POST /v1/chat/completions and POST /v1/chat/compact. Every other content route, such as /v1/messages, /v1/responses, images, and search, gets 400 floor_unsupported_route rather than going out without the floor. Run a second sidecar without --floor, on another --listen port, for those.

GET /v1/models, GET /v1/attestation, and the other requests that carry no content go to Morse unsealed.

What it proves

For each request, the sidecar seals the body to the keys of enclaves whose attestation documents pass every check below. When none pass, the request gets 502 attestation_failed, and nothing is sent.

  • The document is signed by a chain that ends at AWS's Nitro root, which is built into the binary, and every certificate in it was valid when it was signed.
  • It is at most 30 minutes old.
  • Its PCR0, PCR1, and PCR2 match an image that trymorse/morse-pins lists for prod and doesn't mark revoked.
  • A tag of trymorse/morse-enclave names the same PCRs, so the image's source is public, and you can rebuild it and compare.
  • The document binds the key the request is sealed to.

What it doesn't prove

  • That your usage is hidden. Morse still sees who calls and when, the model, the token counts, the rough size of each request and reply, and the timing of a stream.
  • That the model's host can't read it. Morse's enclave opens the request. On Anonymous and Private, it forwards the prompt to the model's host, which reads it. On TEE, it sends the prompt only to a host enclave whose attestation it checked. morse-seal doesn't seal to an E2EE model's own key. See Privacy tiers.
  • That you can skip trusting anyone. You trust the machine the sidecar runs on, GitHub, and the publisher of morse-pins, who decides which images are on the list. Pass --pins-commit to move to a new list only when you choose.

Require sealing on a key

Turn on Sealed only on a key's sheet in the console, and Morse takes only sealed requests with it. A plain request with that key, from an SDK pointed at https://inference.trymorse.ai/v1 or from curl, gets 403 sealed_required. So a key that leaks, or a client someone forgot to point at the sidecar, can't send a prompt the relay reads. Use a second key for anything you don't seal.

Errors

CodeStatusWhen
attestation_failed502No enclave passed every check, so nothing was sent. The message names each failed check.
privacy_floor_unmet400The model has no endpoint at or above the floor. Pick a model at that tier, or lower --floor.
floor_unsupported_route400--floor is set and the route isn't POST /v1/chat/completions or /v1/chat/compact. Run a second sidecar without --floor for it.
sealed_required403A plain request on a key with Sealed only on. Send it through morse-seal or attested().
privacy_veil_missing502With --privacy-veil, a reply the enclave didn't mark X-Privacy-Veil: applied. The sidecar withholds it.

Every other error comes from Morse as it would without the sidecar. See Errors.