How Prusik works under the hood: the tiers and their rules, the per-customer cell, the gate that every tool call passes, and what you can verify yourself.
The words the rest of this page uses.
The only things that differ between tiers are the model, what the firewall sees, and which integrations are reachable.
| Basic | Guarded | Secret | |
|---|---|---|---|
| Model | Frontier model on Vertex, EU region pinned | Open-weight model in NEAR's enclave | Open-weight model in NEAR's enclave |
| Agent loop runs | Server | Server | Browser |
| Sources | Integrations bound to Basic, uploads | Integrations bound to Basic or Guarded, uploads | Uploads only |
| Web access | Free until internal data is read, then through the firewall | Always through the firewall | None |
| Classifier sees | Payload, target, recent turns | Payload and target | Nothing |
| Sandbox | No egress when sources are on | No egress | None |
| Who can read | Google as model host, the classifier vendor, Prusik, the cloud host | The classifier vendor for outbound payloads only, Prusik, the cloud host | Nobody but the user and the enclave, as long as the client code is honest |
One VM per customer. Nothing is shared.
Each customer gets a cell: one virtual machine with its own Postgres database, sandbox, keys and domain. Caddy terminates TLS in front of a FastAPI app bound to localhost. Basic and Guarded conversations use the agent loop on the server. Secret conversations only touch the relay, which adds the NEAR API key, forwards ciphertext and logs metadata.
Browser
|-- Basic / Guarded: WebSocket + REST -------------------.
| |
'-- Secret: encrypts in the browser, sends ciphertext --. |
| |
Cell (one VM per customer) -------------------------------|-|-----
Caddy (TLS) -> FastAPI app on 127.0.0.1 | |
Secret relay <---------------------------------------' |
adds the NEAR key, forwards ciphertext, logs metadata |
Agent loop <-------------------------------------------'
-> Gate: tool policy, tier, taint flags, firewall, approval
-> Classifier outbound payloads only
-> Integrations Gmail, Drive, Calendar, Slack
-> Web tools web_search, web_fetch
-> Sandbox (rootless Podman) no egress when sources are on
-> Model router: Vertex (Basic) | NEAR (Guarded)
Audit log (hash chain) -> anchored in a bucket outside the database
Postgres (one database)
The single most important structural fact: every tool call reaches its handler only through the gate.
One function, called from four places: the top of tool dispatch, the action request arm of the agent loop, the sandbox bridge, and inside the raw HTTP tools once the endpoint pattern is matched. A sandbox script calling a tool is gated exactly like the model calling it.
Every tool and endpoint declares a policy once: its effect (read or write), its boundary (internal or external), its approval rule (none, notify, required) and the taints it sets. A pinned test fails if a tool is added without one.
Inside the gate, first match wins:
Two taint flags, internal data read and untrusted content read, are stored per workspace and set only by the gate from the policy's taints and by file upload. The model cannot set or clear them, and they are never cleared. Inbound mail is untrusted because anyone can send it. Guarded conversations behave as if internal data had been read from the start.
Code first. The classifier answers three narrow questions and never overrides a structural deny.
Fixed checks run in code, always first: HTTPS only, no IP literals, no private, link-local or metadata addresses, a URL cap of 2,000 characters, a search query cap of 400, and no path or query segment over 64 characters that looks like base64 or hex. A request that fails these is denied without a classifier call.
What remains goes to the classifier as three questions, each answered with a calibrated probability:
Code combines the answers. Deny if encoded is yes with confidence at least 0.6. Allow only if every question is clean with confidence at least 0.6. Everything else asks a human through an external-read card that shows the exact URL or query and the firewall's reasons. If the classifier is unavailable, misconfigured, rate-limited or given an oversized input, the answer is ask. Never allow.
The server is a courier.
In Secret the agent loop runs in the browser. Each request is encrypted there, end to end, to NEAR's enclave. The server adds the API key, forwards the ciphertext and records metadata. It never holds plaintext and never holds the key that could read it. Secret conversations have no integrations and no web access, and uploads are the only source.
The guarantee rests on the client code being honest: it holds as long as the code we serve does what this page describes. A signed bundle with reproducible builds, so you can check that yourself, is on the roadmap.
Users always see what a conversation touched.
The audit log is a hash chain anchored in a bucket outside the database. It records turn starts, tool proposals, gate decisions with their reasons and classifier answers, approvals requested and resolved, tool executions with result hash and size, taint changes, model calls with backend, region or attestation reference and token counts, secret requests, sign-ins, admin changes and impersonation.
In the UI every conversation shows a tier badge, a "who can read this" list built from the tier configuration, one chip per integration used, a red web access chip from the first external read onward, and state chips for the taint flags. The tool trace lists every call with its integration, effect and boundary. All of it comes from server state, never from model output.
Four things a security lead can see in a live session.
Eval results for the gate follow the first implementation, starting with the classifier's thresholds on a security suite of injection and exfiltration attempts. We will publish them here.
We will walk your team through the full specification, down to the gate order and the policy table.