seal

Get started

Markdown

Seal docs

Seal keeps your app's API keys and database passwords inside a hardware enclave. Your servers hold a blob instead, so a hacker who takes one over finds nothing worth stealing.

Your app needs keys: an OpenAI key, a Stripe key, a database password. Wherever you keep them, the app ends up holding them in memory. Anyone with a shell on the server can read them.

Seal moves the key into an enclave, a program running inside a hardware TEE that the server itself can't look into. Your app holds a blob instead. Try it, then give a hacker root:

Your servercheckout appOPENAI_API_KEY=sk-proj-7Hq2…b9Xc
Upstream OpenAIapi.openai.com

root# cat /proc/$(pgrep checkout)/environ | tr '\0' '\n' | grep OPENAI

Press “Give a hacker root” to run it.

FigureWithout Seal, the key sits in your server's environment and memory, and every request carries it from there.

Start here#

How it works#

  1. You seal a key once, with the CLI. You get back a blob, a line of text starting with seal1..
  2. Your app opens a session on the blob and hands the client it already uses a local URL and a stand-in key.
  3. The enclave checks who's asking, adds the real key on the way out, and masks it in the response.
Python
with seal.session(os.environ["OPENAI_API_BLOB"]) as s:
    client = OpenAI(base_url=s.url, api_key=s.key)

What it protects#

Root on your server can

  • Use the key through the enclave, as your app, while they're in.

Root can't

  • Take the key away.
  • Send it anywhere but its destination.
  • Keep access once you remove the grant.

What an attacker gets covers every case, Seal included.

Browse the docs#