Gatekeeper quickstart

Use any OpenAI SDK with a model that runs inside hardware trusted execution environments, and check the deployment before your first prompt leaves the machine.

Confidential Router is an OpenAI-compatible API for open models served from attested confidential GPUs. Gatekeeper is a small local proxy: it fetches the endpoint's signed Deployment Evidence, verifies it, and only then forwards your request. If anything does not check out, it refuses with an HTTP 503 instead of sending data.

1. Install and start Gatekeeper

curl -fsSL https://github.com/Super-Protocol/confidential-router/releases/latest/download/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
gatekeeper init
gatekeeper endpoint add router --upstream https://api.router.superprotocol.com --listen 127.0.0.1:8787
gatekeeper endpoint trust add router --from-upstream
gatekeeper run

2. Point your client at it

Only the base URL changes. Router keys start with sk-tee-v1-; access is by invite on the Router page.

from openai import OpenAI

client = OpenAI(
    base_url="http://127.0.0.1:8787/v1",  # local Gatekeeper
    api_key="sk-tee-v1-...",
)

resp = client.chat.completions.create(
    model="<model-id>",  # from GET /v1/models
    messages=[{"role": "user", "content": "Summarize this claim file: ..."}],
)
print(resp.choices[0].message.content)

Successful responses carry the header X-Gatekeeper-Verdict: allow.

3. What Gatekeeper checks

Before the first request and every five minutes after, six stages run in order:

StageWhat it checks
fetchDownloads the evidence bundle from /.well-known/swarm-evidence
cert-chainThe signing certificate chains correctly
untrusted-rootThe chain ends in the trusted Super Swarm root CA
jwsThe RS256 signature over the evidence is valid
tls-fingerprintThe TLS certificate you actually connected to matches the one in the evidence
policyThe evidence digest matches the one you pinned

If the evidence digest changes (for example after a redeploy), Gatekeeper stops forwarding until you approve the new digest.

4. Handle a refusal

A failed check returns 503 with an OpenAI-shaped error object whose stage field names the failing step. Treat it as a security event, not a transient error.

import openai

try:
    resp = client.chat.completions.create(model=MODEL, messages=msgs)
except openai.APIStatusError as e:
    if e.status_code == 503:
        # Gatekeeper refused: evidence changed or a check failed.
        # Don't fall back to an unverified endpoint.
        alert_oncall(e.response.json())
        raise
Behind a TLS-inspecting corporate proxy, tls-fingerprint fails by design: the certificate your machine sees is the proxy's, not the endpoint's. That is the check doing its job.

Try it without installing

More