Why the coordinator is not sandboxed
A sandbox confines one agent, which runs code that a prompt or a repository can steer. The coordinator, zentri-server, is a different kind of process. It holds the shared state of every session in every project, and it never runs an agent’s commands. Agents send it intents, claims, notes, plans, and diffs as data.
So the coordinator runs as an ordinary service, outside any sandbox, with its own protections. The sandbox narrows the agent’s path to the coordinator. In an openshell sandbox only /usr/local/bin/zentri may reach the coordinator, and only on /v1/**, /mcp, and GET /healthz. The sandboxing model covers that rule.
Zentri never collects, stores, proxies, or resells model access or a model credential. Each agent uses its owner’s own credentials, so the coordinator has none to lose.
How it works
Section titled “How it works”The container
Section titled “The container”The Compose file in deploy/docker-compose.yml runs the server and migrate services with these settings:
user: nonrootread_only: truecap_drop: - ALLsecurity_opt: - no-new-privileges:trueThe image is distroless (static-debian13:nonroot), with no shell. The Compose file binds every published port to 127.0.0.1, for the coordinator, Postgres, and ollama. scripts/e2e-m1.sh checks the Compose config for read_only, cap_drop, no-new-privileges, and the loopback ports.
The database role
Section titled “The database role”migrate runs zentri-server migrate up as the database owner. server runs zentri-server serve --no-migrate as zentri_coordinator, a login role in the group zentri_app. The server’s environment holds only that role’s password.
zentri_app reads and inserts, and it updates only the tables and columns whose rows change state. It has no TRUNCATE and no DDL. It deletes nothing but a Slack link, and every unlink goes in the audit log. A claim, a session, or a token ends when the coordinator sets released_at, ended_at, or revoked_at, so its row stays.
The audit log
Section titled “The audit log”Each audit row stores SHA-256(prev_hash ‖ canonical JSON of the row), so each hash covers every row before it. Appends take a transaction advisory lock, so two writers cannot fork the chain. zentri_app has only SELECT and INSERT on audit_log, so the coordinator cannot rewrite a row.
A database superuser can still rewrite rows. zentri-server audit verify walks the log, recomputes every hash, and exits 1 when the chain is broken. The tests TestAuditChainDetectsTampering, TestAppRoleCannotRewriteAudit, and TestConcurrentAppendsKeepTheChain cover the chain and the grant.
Tokens and authorization
Section titled “Tokens and authorization”The coordinator stores the SHA-256 hash of each token, never the token. A token is a 256-bit random secret, so it needs no slow hash. Logs redact any string that starts with zt_u_, zt_s_, zt_a_, or zt_i_.
| Token | Prefix | Expires after |
|---|---|---|
| User token | zt_u_... |
90 days |
| Admin token, made at bootstrap | zt_a_... |
No expiry is set |
| Session token | zt_s_... |
8 hours, refreshed up to 24 hours after issue, and revoked at zt done |
| Integration token | zt_i_... |
365 days |
Every route calls authorize() with the caller’s principal and the resource. A session token is bound to one session, so it cannot read or change another session’s claims or notices. A caller from another org gets 404, so it cannot learn that a resource exists. TestAuthorizationEveryRoute and TestSessionTokenCannotTouchOtherSession cover these rules.
Credentials it does not hold
Section titled “Credentials it does not hold”The coordinator holds no model credential, no git credential, and no Slack credential. It cannot push code, and it never calls an agent’s model provider. It reads only the operator’s own secrets:
ZENTRI_DATABASE_URL, with thezentri_coordinatorpassword.ZENTRI_LLM_API_KEY_FILEandZENTRI_EMBED_API_KEY_FILE, for the operator’s LLM and embedding endpoints, when they need a key.ZENTRI_DATA_KEY_FILE, the data key for raw prompts.ZENTRI_BOOTSTRAP_ADMIN_TOKEN_FILE, read once to create the first admin.
It reads each key from a file. The database password is the one secret in an environment variable.
Raw prompts are sealed
Section titled “Raw prompts are sealed”The coordinator stores the raw prompt of an intent only when it has a data key. It seals the prompt with AES-256-GCM, with the project and the intent as associated data. A sealed prompt copied to another project or intent fails to open. The key is 32 bytes, read from ZENTRI_DATA_KEY_FILE as raw bytes, hex, or base64.
Without a data key, raw prompts are not stored, and the LLM judge, which reads them, does not run. TestRawPromptIsSealedToItsProjectAndIntent and TestSealerRoundTripAndBinding cover the sealing.
Rate and size limits
Section titled “Rate and size limits”Each token has its own buckets, keyed by the token’s hash. A request that fails to authenticate counts against its client IP’s bucket.
| Bucket | Steady rate | Burst |
|---|---|---|
| Session token | 20 a second | 60 |
| User token | 10 a second | 30 |
| Anonymous or failed authentication, per IP | 5 a second | 20 |
| Claim requests | 1 a second | 60 |
| Notes | 10 a minute | 10 |
| Plans | 30 a minute | 30 |
| Snapshots | 30 a minute | 30 |
A request body may be at most 1 MiB. A prompt may be at most 16 KiB, and an MCP tool result at most 32 KiB. A call to the operator’s model times out after 5 seconds by default. /mcp shares the same buckets and the same body limit.
Metrics
Section titled “Metrics”On a loopback listen address, /metrics is public. Beyond loopback, it needs an admin user token or an integration token with the scope metrics:read. The series are totals for the whole server, with no org or project labels.
What a compromise would expose
Section titled “What a compromise would expose”This section follows from what the coordinator stores and from its grants. No test has run an attack on it.
An attacker who takes over the coordinator process could read the following:
- The coordination state of every org on that coordinator. That state covers intents, claims, notices, plans, questions, decisions, router configs, and the audit log.
- The diffs that sessions send, which hold code. A peer session reads them anyway, and a secret scanner redacts known credential shapes before storage.
- Token hashes. A hash does not authenticate.
- The operator’s secrets in the list above. With the data key, an attacker could also open the stored raw prompts.
The attacker could also give false answers and write false coordination state. Examples include releasing a claim, posting notices, or passing every merge check. The role still cannot delete rows or rewrite the audit log.
The attacker would get no user’s model credential or git credential, because the coordinator holds none. A copy of the database without the data key does not open the raw prompts.
Recommendations
Section titled “Recommendations”ADR-0004 decision 9 gives operators this guidance:
- Run the coordinator on a separate host or container that sandboxes reach only through the policy allowlist.
- Choose
bridgesupervisor networking on Docker.
The first holds as written. The second does not hold on native Linux. There a sandbox in bridge mode cannot reach a coordinator on the host’s loopback, and a CI run in bridge mode failed with ControlSupervisorStartFailed. On native Linux keep the default supervisor_network_mode = "host". Bridge mode there needs the coordinator to listen on the Docker bridge, which no one has tested. On Docker Desktop, bridge mode is the one that ran.
Use it
Section titled “Use it”Check the audit chain from the repository root:
docker compose -f deploy/docker-compose.yml run --rm --no-deps server audit verifyThe command prints the number of rows checked and the hash of the last row. Keep that head hash outside the database. Comparing it with a later run shows whether rows were removed from the end, which the chain alone cannot show.
To store raw prompts and turn on the LLM judge, make a data key:
openssl rand -hex 32 > zentri-data-keychmod 600 zentri-data-keyMount the file read-only into the server with a Compose override file. Then set ZENTRI_DATA_KEY_FILE to its path inside the container, such as /run/secrets/zentri-data-key. deploy/.env.example describes each variable.
To scrape /metrics beyond loopback, an admin issues an integration token with the scope metrics:read:
curl -s -H "Authorization: Bearer zt_a_..." \ -H "Content-Type: application/json" \ -d '{"label":"prometheus","scope":"metrics:read"}' \ "$ZENTRI_SERVER/v1/integration-tokens"The response holds the new token in token. The coordinator shows it once.
Keep the Compose ports on 127.0.0.1 unless people on other machines need the coordinator. Security hardening covers that case.
Limitations
Section titled “Limitations”- A database superuser can rewrite any row.
zentri-server audit verifyreports the change only when you run it. - Rows cut from the end of the log leave a valid chain. Only a head hash that you saved shows the loss. Nothing in Zentri exports the head hash for you.
- Most rate limits live in each process’s memory, so several replicas would each keep their own budgets. Only the claim request limit is counted in Postgres and shared.
/metricsreports totals for the whole server. An admin of any org on a shared coordinator reads the totals of all orgs.- The coordinator holds code, because peer sessions read each other’s diffs. The secret scanner knows a fixed set of credential shapes, so a secret of another shape is stored.
- In
local-devno policy stands between the agent and the coordinator. The agent runs as your user, so it can read the session token file and reach the coordinator with any program.
Related pages
Section titled “Related pages”- The sandboxing model explains the rule that limits a sandbox’s path to the coordinator.
- Security hardening covers the coordinator’s host and network.
- Docker compose walks through the Compose file.
- Production setup covers a coordinator for a team.
- The three catches explains the merge check that the coordinator answers.
- The zentri-server CLI reference lists
audit verifyand the other server commands. - The environment reference lists every
ZENTRI_*variable.