Upload 2 files
Browse files- README.md +11 -5
- index.html +99 -18
README.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
| 1 |
---
|
| 2 |
-
title: Gatekeeper
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Gatekeeper quickstart
|
| 3 |
+
emoji: 🛡️
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
short_description: Private LLM API with attestation checks before every request
|
| 9 |
+
license: apache-2.0
|
| 10 |
+
tags:
|
| 11 |
+
- confidential-computing
|
| 12 |
+
- attestation
|
| 13 |
+
- openai-compatible
|
| 14 |
---
|
| 15 |
|
| 16 |
+
Quickstart for Gatekeeper, the local verifier for Super Protocol Confidential Router (OpenAI-compatible LLM API running in hardware TEEs).
|
index.html
CHANGED
|
@@ -1,19 +1,100 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>Gatekeeper quickstart — private LLM API with attestation checks</title>
|
| 7 |
+
<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.">
|
| 8 |
+
<style>
|
| 9 |
+
:root{--bg:#0b0f17;--panel:#121826;--line:#243047;--text:#e6e9ef;--muted:#9aa4b2;--accent:#3b82f6}
|
| 10 |
+
*{box-sizing:border-box}
|
| 11 |
+
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
|
| 12 |
+
main{max-width:820px;margin:0 auto;padding:40px 20px 64px}
|
| 13 |
+
h1{font-size:30px;margin:0 0 8px}
|
| 14 |
+
h2{font-size:20px;margin:36px 0 10px}
|
| 15 |
+
p,li{color:var(--text)}
|
| 16 |
+
.muted{color:var(--muted)}
|
| 17 |
+
a{color:#7fb0ff}
|
| 18 |
+
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}
|
| 19 |
+
code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
| 20 |
+
.note{border-left:3px solid var(--accent);background:var(--panel);padding:12px 16px;border-radius:0 8px 8px 0}
|
| 21 |
+
table{border-collapse:collapse;width:100%;font-size:14.5px}
|
| 22 |
+
td,th{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left;vertical-align:top}
|
| 23 |
+
th{color:var(--muted);font-weight:600}
|
| 24 |
+
</style>
|
| 25 |
+
</head>
|
| 26 |
+
<body>
|
| 27 |
+
<main>
|
| 28 |
+
<h1>Gatekeeper quickstart</h1>
|
| 29 |
+
<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>
|
| 30 |
+
|
| 31 |
+
<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>
|
| 32 |
+
|
| 33 |
+
<h2>1. Install and start Gatekeeper</h2>
|
| 34 |
+
<pre><code>curl -fsSL https://github.com/Super-Protocol/confidential-router/releases/latest/download/install.sh | sh
|
| 35 |
+
export PATH="$HOME/.local/bin:$PATH"
|
| 36 |
+
gatekeeper init
|
| 37 |
+
gatekeeper endpoint add router --upstream https://api.router.superprotocol.com --listen 127.0.0.1:8787
|
| 38 |
+
gatekeeper endpoint trust add router --from-upstream
|
| 39 |
+
gatekeeper run</code></pre>
|
| 40 |
+
|
| 41 |
+
<h2>2. Point your client at it</h2>
|
| 42 |
+
<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>
|
| 43 |
+
<pre><code>from openai import OpenAI
|
| 44 |
+
|
| 45 |
+
client = OpenAI(
|
| 46 |
+
base_url="http://127.0.0.1:8787/v1", # local Gatekeeper
|
| 47 |
+
api_key="sk-tee-v1-...",
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
resp = client.chat.completions.create(
|
| 51 |
+
model="<model-id>", # from GET /v1/models
|
| 52 |
+
messages=[{"role": "user", "content": "Summarize this claim file: ..."}],
|
| 53 |
+
)
|
| 54 |
+
print(resp.choices[0].message.content)</code></pre>
|
| 55 |
+
<p>Successful responses carry the header <code>X-Gatekeeper-Verdict: allow</code>.</p>
|
| 56 |
+
|
| 57 |
+
<h2>3. What Gatekeeper checks</h2>
|
| 58 |
+
<p>Before the first request and every five minutes after, six stages run in order:</p>
|
| 59 |
+
<table>
|
| 60 |
+
<tr><th>Stage</th><th>What it checks</th></tr>
|
| 61 |
+
<tr><td><code>fetch</code></td><td>Downloads the evidence bundle from <code>/.well-known/swarm-evidence</code></td></tr>
|
| 62 |
+
<tr><td><code>cert-chain</code></td><td>The signing certificate chains correctly</td></tr>
|
| 63 |
+
<tr><td><code>untrusted-root</code></td><td>The chain ends in the trusted Super Swarm root CA</td></tr>
|
| 64 |
+
<tr><td><code>jws</code></td><td>The RS256 signature over the evidence is valid</td></tr>
|
| 65 |
+
<tr><td><code>tls-fingerprint</code></td><td>The TLS certificate you actually connected to matches the one in the evidence</td></tr>
|
| 66 |
+
<tr><td><code>policy</code></td><td>The evidence digest matches the one you pinned</td></tr>
|
| 67 |
+
</table>
|
| 68 |
+
<p>If the evidence digest changes (for example after a redeploy), Gatekeeper stops forwarding until you approve the new digest.</p>
|
| 69 |
+
|
| 70 |
+
<h2>4. Handle a refusal</h2>
|
| 71 |
+
<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>
|
| 72 |
+
<pre><code>import openai
|
| 73 |
+
|
| 74 |
+
try:
|
| 75 |
+
resp = client.chat.completions.create(model=MODEL, messages=msgs)
|
| 76 |
+
except openai.APIStatusError as e:
|
| 77 |
+
if e.status_code == 503:
|
| 78 |
+
# Gatekeeper refused: evidence changed or a check failed.
|
| 79 |
+
# Don't fall back to an unverified endpoint.
|
| 80 |
+
alert_oncall(e.response.json())
|
| 81 |
+
raise</code></pre>
|
| 82 |
+
|
| 83 |
+
<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>
|
| 84 |
+
|
| 85 |
+
<h2>Try it without installing</h2>
|
| 86 |
+
<ul>
|
| 87 |
+
<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>
|
| 88 |
+
<li><a href="https://huggingface.co/datasets/superprotocol-corp/confidential-router-evidence" target="_top">Evidence samples dataset</a> — real bundles with field descriptions</li>
|
| 89 |
+
<li><a href="https://huggingface.co/collections/superprotocol-corp/confidential-router-models-6b00857227ebb8450868eafb" target="_top">Models on Confidential Router</a></li>
|
| 90 |
+
</ul>
|
| 91 |
+
|
| 92 |
+
<h2>More</h2>
|
| 93 |
+
<ul>
|
| 94 |
+
<li>Docs: <a href="https://docs.router.superprotocol.com">docs.router.superprotocol.com</a></li>
|
| 95 |
+
<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>
|
| 96 |
+
<li><a href="https://superprotocol.com">superprotocol.com</a></li>
|
| 97 |
+
</ul>
|
| 98 |
+
</main>
|
| 99 |
+
</body>
|
| 100 |
</html>
|