Download index.html from superprotocol-corp/gatekeeper-quickstart: direct link, hf CLI and curl.
- Browser
- Download file 5.97 kB
-
https://huggingface.co/spaces/superprotocol-corp/gatekeeper-quickstart/resolve/main/index.html
- Command line
-
hf download hf://spaces/superprotocol-corp/gatekeeper-quickstart/index.html
-
curl -L -o index.html https://huggingface.co/spaces/superprotocol-corp/gatekeeper-quickstart/resolve/main/index.html
5.97 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Gatekeeper quickstart — private LLM API with attestation checks</title> | |
| <meta name="description" content="Put Gatekeeper in front of Super Protocol Confidential Router: an OpenAI-compatible LLM API running in hardware TEEs. Gatekeeper verifies signed deployment evidence before every request and fails closed."> | |
| <style> | |
| :root{--bg:#0b0f17;--panel:#121826;--line:#243047;--text:#e6e9ef;--muted:#9aa4b2;--accent:#3b82f6} | |
| *{box-sizing:border-box} | |
| body{margin:0;background:var(--bg);color:var(--text);font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,sans-serif} | |
| main{max-width:820px;margin:0 auto;padding:40px 20px 64px} | |
| h1{font-size:30px;margin:0 0 8px} | |
| h2{font-size:20px;margin:36px 0 10px} | |
| p,li{color:var(--text)} | |
| .muted{color:var(--muted)} | |
| a{color:#7fb0ff} | |
| pre{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:14px 16px;overflow-x:auto;font:13.5px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace} | |
| code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace} | |
| .note{border-left:3px solid var(--accent);background:var(--panel);padding:12px 16px;border-radius:0 8px 8px 0} | |
| table{border-collapse:collapse;width:100%;font-size:14.5px} | |
| td,th{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left;vertical-align:top} | |
| th{color:var(--muted);font-weight:600} | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <h1>Gatekeeper quickstart</h1> | |
| <p class="muted">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.</p> | |
| <p><a href="https://superprotocol.com/developers/router">Confidential Router</a> 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.</p> | |
| <h2>1. Install and start Gatekeeper</h2> | |
| <pre><code>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</code></pre> | |
| <h2>2. Point your client at it</h2> | |
| <p>Only the base URL changes. Router keys start with <code>sk-tee-v1-</code>; access is by invite on the <a href="https://superprotocol.com/developers/router">Router page</a>.</p> | |
| <pre><code>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)</code></pre> | |
| <p>Successful responses carry the header <code>X-Gatekeeper-Verdict: allow</code>.</p> | |
| <h2>3. What Gatekeeper checks</h2> | |
| <p>Before the first request and every five minutes after, six stages run in order:</p> | |
| <table> | |
| <tr><th>Stage</th><th>What it checks</th></tr> | |
| <tr><td><code>fetch</code></td><td>Downloads the evidence bundle from <code>/.well-known/swarm-evidence</code></td></tr> | |
| <tr><td><code>cert-chain</code></td><td>The signing certificate chains correctly</td></tr> | |
| <tr><td><code>untrusted-root</code></td><td>The chain ends in the trusted Super Swarm root CA</td></tr> | |
| <tr><td><code>jws</code></td><td>The RS256 signature over the evidence is valid</td></tr> | |
| <tr><td><code>tls-fingerprint</code></td><td>The TLS certificate you actually connected to matches the one in the evidence</td></tr> | |
| <tr><td><code>policy</code></td><td>The evidence digest matches the one you pinned</td></tr> | |
| </table> | |
| <p>If the evidence digest changes (for example after a redeploy), Gatekeeper stops forwarding until you approve the new digest.</p> | |
| <h2>4. Handle a refusal</h2> | |
| <p>A failed check returns 503 with an OpenAI-shaped <code>error</code> object whose <code>stage</code> field names the failing step. Treat it as a security event, not a transient error.</p> | |
| <pre><code>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</code></pre> | |
| <div class="note">Behind a TLS-inspecting corporate proxy, <code>tls-fingerprint</code> fails by design: the certificate your machine sees is the proxy's, not the endpoint's. That is the check doing its job.</div> | |
| <h2>Try it without installing</h2> | |
| <ul> | |
| <li><a href="https://huggingface.co/spaces/superprotocol-corp/evidence-inspector" target="_top">Evidence Inspector</a> — verify a live evidence bundle in your browser</li> | |
| <li><a href="https://huggingface.co/datasets/superprotocol-corp/confidential-router-evidence" target="_top">Evidence samples dataset</a> — real bundles with field descriptions</li> | |
| <li><a href="https://huggingface.co/collections/superprotocol-corp/confidential-router-models-6b00857227ebb8450868eafb" target="_top">Models on Confidential Router</a></li> | |
| </ul> | |
| <h2>More</h2> | |
| <ul> | |
| <li>Docs: <a href="https://docs.router.superprotocol.com">docs.router.superprotocol.com</a></li> | |
| <li>Walkthrough: <a href="https://dev.to/nukri_basharuli_e44af0e65/point-your-openai-client-at-a-model-that-cant-read-your-prompts-and-check-that-before-the-first-2mmb">Point your OpenAI client at a model that can't read your prompts</a></li> | |
| <li><a href="https://superprotocol.com">superprotocol.com</a></li> | |
| </ul> | |
| </main> | |
| </body> | |
| </html> | |