Five-layer local execution sandbox.
Castor isolates path traversal, shell execution, AST writes, and network egress across every worker turn, with verifiable air-gapped builds for regulated deployments.
What we assume can go wrong.
A coding agent is a confused deputy with a shell. The threat model starts there, not at the model's good intentions.
Escape the workspace
A prompt asks the worker to read ~/.ssh or write outside the repo. Five layers refuse it.
Destructive command
A generated command targets the wrong root. The lexical scanner blocks it before execution.
Break the repo
A hallucinated edit lands on disk. The AST gate parses the buffer in memory and rolls back on error.
Exfiltrate code
A tool call reaches an external host. The sovereign build removes outbound web tools; the default build does not.
Binary or PDF bytes
A file is not text. The magic-number sniffer refuses to dump binary bytes into a string buffer.
A dependency moves
Pinned engine versions, a signed bundle, and a reproducible build are pilot deliverables.
The layers, in order.
The path pipeline runs before any file operation. The shell scanner runs before any child process. The AST gate runs before any write hits disk.
| Layer | Control | What it refuses | Platform |
|---|---|---|---|
| L1 | Canonical root anchor | Resolves the workspace to one canonical root. | All |
| L2 | Symlink realpath | A symlink that points outside the root. | All |
| L3 | Out-of-tree refusal | Any read, write, or list outside the root. | All |
| L4 | Traversal normalisation | Null bytes, ~, device names, ... | All |
| L5 | Binary sniffer | Dumping binary bytes into text buffers. | All |
| Shell | Lexical scanner + dead-man fuse | Destructive targets, protected roots, fork bombs, elevation. | All |
| Kernel | Landlock ruleset | Shell children leaving the workspace root. | Linux 5.13+ |
| AST | 27-grammar tree-sitter gate | Malformed code before it touches disk. | All |
What leaves the machine today.
This is the sentence most vendors blur. We will not. The default build includes outbound web tools. The sovereign pilot removes them at compile time and attests the boundary.
Local loop, with web tools
- No telemetry beacon, no auto-updater, no crash reporter
- Engine, status, and proxy ports bound to
127.0.0.1 web_searchandweb_fetchare part of the lean tool core- The cloud architect sees the plan and the short result
If a diff cannot leave the building, the default hybrid deployment is not the right shape. The sovereign pilot is.
Compile-time egress boundary
- Build profile with outbound web tools excluded
- Local orchestrator: opencode, goose, aider, or your host
- Loopback-only listeners, verified with
ss/netstat - Hash-chained audit ledger with a verification command
- Egress attestation and a signed runbook
The audit trail is evidence, not decoration.
Every tool call, path verdict, edit, and execution is recorded as a JSONL event. Today the ledger is append-only. The pilot adds a hash chain and a verification command so an assessor can prove nothing was removed.
- Per-turn token and timing metrics
- Per-tool verdict: allowed, refused, or failed
- Per-task terminal status, including cancellations
- Hash chain and
castor audit verifyin the pilot
{
"task": "auth-refactor",
"turn": 12,
"tool": "edit_file",
"path": "src/auth/session.ts",
"verdict": "allowed",
"ast": "pass",
"prompt_tokens": 14820,
"cache_read": 13902,
"completion_tokens": 412,
"ts": "2026-11-30T22:14:08Z"
}What we do not claim.
A security page that only lists strengths is a liability. These are the gaps, stated plainly.
- No SOC 2, ISO 27001, CMMC, or cATO certificate.
- No SSO in the open-source engine; it is pilot scope.
- No hash-chained ledger in the current release; it is pilot scope.
- No shrink-wrapped air-gapped installer; it is built in the pilot.
- No claim that the default build is zero-egress: web tools are compiled in.
- No claim that Landlock covers Windows or macOS; the lexical gates do.
- No claim that a blocked vector proves safety; it proves a regression test passed.
- No claim that local model quality equals the frontier; the proof page shows the gap.
Bring your auditor. We'll bring the boundary.
The sovereign pilot is built around the evidence your assessor needs to run.