Open source · Apache-2.0 · v1.6.1 stable on npm

Your agent will know you
better than you know yourself.
Make sure that stays between you.

Sanctuary is the open source standard for secure, private AI: operating-system enforcement is live on macOS today; Linux and Windows are not live enforcement yet, and your data stays under your own keys with current portability bounds called out in the Assurance Matrix. Any agent, local or cloud, solo or fleet. One command to get started. One dashboard to secure them all.

Install Node 22+ · macOS live wall · Linux/Windows cooperative
$ npx @sanctuary-framework/mcp-server
5Castle layers
0Harness changes
Local node

One command. Full stack, running locally.

Sanctuary runs on your hardware with your keys. Policy-gated calls route through local approval surfaces, and Castle Wall enforcement follows the platform bounds in the Assurance Matrix. Point any MCP-compatible agent at it and the cooperative substrate is live.

boot.log stdio://sanctuary
:: bootstrap_local_node generate_ed25519_keypair... id: did:key:z6Mki7f8a...e90   :: init_aes_256_gcm_encryption master_kdf = argon2id(m=64mb, t=3, p=4) mounting vault at ~/.sanctuary/state   :: load_principal_policy tier_1 ops = 5 (approval gated) tier_2 ops = 14 (anomaly gated) tier_3 ops = 43 (audit logged)   :: spawn_approval_dashboard status: gateway_online @ 127.0.0.1:3501   > ready. waiting for harness _
  • 01

    Kernel-level egress wall

    On macOS today, the Castle Wall blocks unauthorized outbound calls at the operating system. A prompt-injected agent cannot route around that path within the proven scope because the kernel itself enforces. Live on macOS: the wall enforces a signed operator policy, with a clean per-account allow/deny demonstration and 5/5 attended reboot survival behind the claim. On Linux the nftables, cgroup, and NFQUEUE modules are tested against a real kernel, DNS, DoH, DoT and raw sockets included, and the shipped daemon does not install that path yet, so Linux is source coverage today rather than live enforcement.

  • 02

    Client-side keys

    Ed25519 identity generated locally. AES-256-GCM on every write. Keys never leave the box and never appear in any MCP response, log, or error.

  • 03

    Local approval dashboard

    Dark-theme web UI on 127.0.0.1:3501. Approve and deny buttons, audit viewer. Optional TLS and webhook channels for headless setups.

Architecture

The Castle Architecture.

Five layers, each with a distinct contract. Operating-system enforcement is live on macOS today; Linux and Windows are not live enforcement yet, observation inside, an encrypted state surface for compliant agents, receipts and reputation across vendors, and an install-time substrate that binds it all to the operator. The layers compose. None of them substitute for another.

Perimeter

Castle Wall

Operating-system-level egress filtering. Network Extension on macOS, where Phase 1 is proven on a signed and notarized build. On Linux the nftables, cgroup v2, and NFQUEUE modules carry plain-DNS, DoH, DoT, and raw-socket bypass coverage against real kernel bindings, and the shipped daemon does not install that path yet.

kernel-binding cgroup-v2 doh-dot-covered
Observation

Sentinels

Internal behavioral observation. Cross-platform auditd-tail, plus an eBPF watcher scaffold on Linux that currently falls back to stub mode because the real probe loader is not implemented. Seven sentinels watching for prompt-injection signatures, anomalous tool sequences, and policy drift. The sentinels surface; the operator decides.

ebpf auditd-tail seven-sentinels
Cooperative surface

Charter (Cooperative MCP)

Encrypted state, hash-chained audit, mandate primitives, canonical policy slots, and substrate selector. Production audit checkpoints are currently unsigned until IC-05 closes. Compliant agents that voluntarily route through Sanctuary get the full surface. On macOS with the wall installed and armed, non-compliant agents still hit the wall and the Sentinels.

approval-gates context-gate audit-log
Accountability

Heralds (Receipts and Reputation)

Cryptographic receipts on cross-castle transactions, portable reputation that survives vendor churn. Concordia structures negotiation and commitments; Verascore prices the reputation. Operators carry the trust record across vendors.

concordia verascore portable
Substrate

Mantle (install-time binding)

Install-time substrate-binding to the operator. The Mantle gives the rest of the castle a verifiable anchor on the operator's machine before the agent runs. Template init rejects orphan agent identifiers that are not bound to a wrapped harness.

install-time substrate-binding verifiable
Interop

Drop it into any harness.

Sanctuary speaks standard MCP. No forks, no adapters, no special case for your stack. Point your harness at the server and every tool in the custody stack becomes available to your agent immediately.

Claude Code mcp · stdio
// .mcp.json
"mcpServers": {
  "sanctuary": {
    "command": "npx",
    "args": ["-y", "@sanctuary-framework/mcp-server"]
  }
}
OpenClaw mcp · stdio
# ~/.openclaw/mcp.yaml
servers:
  sanctuary:
    type: stdio
    command: npx
    args: ["-y", "-p", "@sanctuary-framework/mcp-server",
           "sanctuary-mcp-server"]
CrewAI python · mcp
# crewai native mcps field
agent = Agent(
  role="analyst",
  mcps=["sanctuary"],
  tools=[],
)
LangChain python · adapter
# langchain-mcp-adapters
from langchain_mcp import MCPTool
sanctuary = MCPTool.from_stdio(
  "npx", ["-y", "@sanctuary-framework/mcp-server"],
)
60 seconds

From zero to custody.

Three commands. A local vault, a self-custodied identity, and a running approval dashboard before your coffee cools.

Step 01 · Install

Boot the server

One npx command. No global install, no build step, no config file required.

$ npx @sanctuary-framework/mcp-server
Step 02 · Connect

Wire into your harness

Add Sanctuary as an MCP server in your harness config. No agent code changes.

$ claude mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server
Step 03 · Approve

Open the dashboard

Approve sensitive operations at the local dashboard URL.

$ open http://127.0.0.1:3501
Ship agents you actually control

Put the Sanctuary wall around your agent.

Open source and local-first. Castle Wall enforcement is proven on macOS; Linux is not_implemented in the Assurance Matrix. Telemetry-free and blockchain-free.