/sanctuary-framework:sanctuaryfrom sanctuary-framework
Provides security, custody, and privacy infrastructure for AI agents: encrypted state storage, self-custodied identity, selective disclosure, zero-knowledge proofs, portable reputation, federation, and posture auditing via MCP tools.
Ships in sanctuary-framework. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Sanctuary provides cooperative tools for encrypted state, self-custodied identity, selective disclosure, portable reputation, zero-knowledge proofs, federation, posture auditing, and signed posture assertions. The tools in this skill are the Charter layer, the cooperative MCP surface. The Castle Wall (kernel-level egress enforcement) is armed separately and is proven on macOS for one host and one OS version, proven on Linux for Ubuntu 24.04 (x86-64) only; Windows is roadmapped. Capability bounds are recorded in the Assurance Matrix.
Software-test evidence and captured operational drills are distinct. Installed enforcement and containment remain partial or unproven unless the relevant matrix row cites a captured drill. An SHR signature authenticates the signer's posture assertions. It does not prove that OS enforcement is installed or armed.
npx -y @sanctuary-framework/[email protected] protect --claude-code --no-open --no-dashboard
npx -y @sanctuary-framework/[email protected] doctor --json
-y skips npm's install prompt; without it npx asks before fetching the package in a terminal. --no-dashboard skips the per-call dashboard, which otherwise serves in the foreground until you stop it; wrap still persists the agent record so a separately-running sanctuary dashboard (or a later wrap) sees the harness; start it later with sanctuary dashboard. --no-open runs headless: it skips opening the dashboard in a browser and switches custody confirmation to the non-interactive mode protect already uses whenever stdin is not a terminal.
Substitute --openclaw, --hermes, --cursor, --cline, --mastra, or --wrap <path-to-config> for the harness you run. With protect, the MCP server entries in the config are rewritten to point at Sanctuary. The harness's own built-in tools are not MCP calls and are not touched. The rewrite is tested on representative harness paths and is not proven for every harness version (Assurance Matrix, Agent wrapping). A plain npx -y @sanctuary-framework/[email protected] entry beside other MCP servers starts the server but does not gate calls to those servers. doctor --json is read-only. The passphrase stays in the platform credential store: never put a passphrase or recovery key in a harness configuration, never read staged recovery material, and never ask the operator to paste it into chat.
Run this only to remove Sanctuary on purpose. It is not part of installation or verification.
npx -y @sanctuary-framework/[email protected] uninstall
uninstall removes the enforcement footprint and is designed to preserve fortress state, credentials, recovery material, and the audit log. It refuses --remove-operator-data and reports residue requiring operator action. uninstall does not restore the harness configuration; sanctuary protect --unwrap restores it from the backup. No Assurance Matrix row cites a captured install-and-removal drill, so what uninstall preserves and removes is unproven.
Inspect cooperative posture and create an identity with the following steps. OS enforcement requires separate installation, arming, and verification.
Use the exact names returned by MCP tools/list. The sanctuary/ prefix throughout this skill is a possible client display namespace; it is not a universal wire prefix.
sanctuary/sovereignty_audit to see your current protection score, gaps, and prioritized recommendations.sanctuary/identity_create to establish a cryptographic Ed25519 identity. This is your agent's foundation for signing, verification, and non-repudiation.sanctuary/shr_generate to create your first Sovereignty Health Report, a signed, self-attested posture report. It does not independently prove runtime enforcement.If you're running OpenClaw, Sanctuary adds protections that OpenClaw doesn't provide:
What OpenClaw gives you:
requireApproval in before_tool_call hooks: binary approve/deny gatingtools.sandbox.tools.alsoAllow: sandbox tool allow/deny listsWhat Sanctuary adds on top:
MEMORY.md, daily notes, and .env secrets are plaintext in OpenClaw. Sanctuary encrypts state written into its encrypted stores at rest with AES-256-GCM (Argon2id key derivation).requireApproval is binary. Sanctuary's three-tier Principal Policy auto-allows routine ops (Tier 3), escalates anomalies (Tier 2), and requires human approval for irreversible ops (Tier 1).One-command setup:
npx -y @sanctuary-framework/[email protected] protect --openclaw --no-open --no-dashboard
Then run sanctuary/sovereignty_audit to see your protection posture with OpenClaw-specific gap analysis.
| Tool | Purpose |
|---|---|
sanctuary/sovereignty_audit | Full protection gap analysis with scoring, OpenClaw detection, and prioritized recommendations |
Run sanctuary/sovereignty_audit to get a scored report (0-100) across security, isolation, and privacy, with specific gaps identified and recommended next steps. It reads your live configuration and profile: optional features that default off (context gating, zero-knowledge proofs) count toward the score only once you enable them, so a fresh install scores below the top verdict and the report names the steps to close each gap. It detects OpenClaw configurations including requireApproval hooks, sandbox policies, plaintext memory, and exposed .env files.
| Tool | Purpose |
|---|---|
sanctuary/memory_insert | Store a memory record in the encrypted vault (saves to the agent's own memory run without an approval prompt under the default policy within a bounded save allowance; beyond it an ordinary Tier 2 approval is requested; audited with the agent named when known, otherwise marked as unknown; policy can require approval per insert) |
sanctuary/memory_search | Find records by content. |
sanctuary/memory_get | Read a record back byte-faithfully (decrypts and re-verifies the stored content hash; proves exact content, not signer data). |
sanctuary/sdw_memory_provenance | Prove verified provenance for a record: per-writer signing status and the fortress-recorded origin/admission bindings (requires operator approval under the default policy (not named in a policy tier; the gate's safe default)). |
First-use proof and restart persistence run through these existing
policy-enforcing tools, never a parallel CLI: memory_insert → memory_search
→ memory_get (proves exact content), then sdw_memory_provenance to confirm
the record's verified provenance. On a
second host the fortress opens from that host's exact-fortress stored credential
with no secret typed. See Rung 1: fresh-host onboarding.
For a copied fortress with no local stored credential, or a lost passphrase,
lead with the private hidden-prompt recovery path:
sanctuary reset-passphrase --mode recovery-key --fortress <path>. It preserves
the master, identities, audit history, and memory. Never recommend nuke while a
human-held recovery key or another configured recovery factor can work; nuke is
the destructive last resort.
| Tool | Purpose |
|---|---|
sanctuary/identity_create | Generate a new Ed25519 identity |
sanctuary/identity_list | List managed identities |
sanctuary/identity_sign | Sign data with an identity's private key (Tier 1) |
sanctuary/identity_verify | Verify an Ed25519 signature |
sanctuary/identity_rotate | Rotate an identity's keys with signed chain (Tier 1) |
sanctuary/state_write | Write encrypted state (AES-256-GCM, Merkle integrity) |
sanctuary/state_read | Read and decrypt state with integrity verification |
sanctuary/state_list | List keys in a namespace (metadata only) |
sanctuary/state_delete | Delete encrypted state (best-effort overwrite and unlink; physical erasure unproven; Tier 1) |
sanctuary/state_export | Export all state as encrypted portable bundle (Tier 1) |
sanctuary/state_import | Import state bundle with conflict resolution (Tier 1) |
sanctuary/shr_generate | Generate signed, machine-readable Sovereignty Health Report |
sanctuary/shr_verify | Verify a counterparty's SHR |
Tier 1 marks operations the shipped default Principal Policy (DEFAULT_POLICY, applied when no policy file exists) sends to a human. Some tiers are configurable. Non-relaxable operations, including raw signing and sensitive disclosure, remain Tier 1 even in an operator-authored policy.
First use:
sanctuary/identity_create: create your primary identitysanctuary/state_write: store your first encrypted statesanctuary/shr_generate: generate your SHR to present to counterparties| Tool | Purpose |
|---|---|
sanctuary/handshake_initiate | Start a handshake |
sanctuary/handshake_respond | Respond to incoming handshake |
sanctuary/handshake_complete | Complete handshake (initiator side) |
sanctuary/handshake_status | Check handshake session status |
sanctuary/bridge_commit | Bind a Concordia outcome to a Sanctuary disclosure commitment |
sanctuary/bridge_verify | Verify a bridge commitment against a revealed outcome |
sanctuary/bridge_attest | Record a negotiation as a reputation attestation |
Before transacting with a counterparty:
sanctuary/handshake_initiate: start a handshakesanctuary/handshake_complete: verify their protection postureverified-sovereign or verified-degraded| Tool | Purpose |
|---|---|
sanctuary/proof_commitment | Create a SHA-256 commitment |
sanctuary/proof_reveal | Verify a commitment against revealed value |
sanctuary/disclosure_set_policy | Set disclosure policy rules |
sanctuary/disclosure_evaluate | Evaluate a disclosure request against policy |
sanctuary/zk_commit | Create a Pedersen commitment on Ristretto255 |
sanctuary/zk_prove | Create a ZK proof of knowledge of a commitment's opening |
sanctuary/zk_verify | Verify a ZK proof of knowledge |
sanctuary/zk_range_prove | Prove a committed value is in [min, max] without revealing it |
sanctuary/zk_range_verify | Verify a ZK range proof |
Zero-knowledge workflow:
sanctuary/zk_commit: create a Pedersen commitment to a secret valuesanctuary/zk_prove: prove you know the value without revealing itsanctuary/zk_range_prove: prove the value is in a range without revealing itsanctuary/zk_verify or sanctuary/zk_range_verify to check| Tool | Purpose |
|---|---|
sanctuary/reputation_record | Record signed interaction attestation (weighted by the signer's verification tier; self-attested and unverified signers are capped) |
sanctuary/reputation_query | Query reputation with filters |
sanctuary/reputation_query_weighted | Query weighted reputation |
sanctuary/reputation_export | Export reputation as portable bundle (Tier 1) |
sanctuary/reputation_import | Import reputation bundle (verify signatures; Tier 1) |
sanctuary/reputation_publish | Publish a signed sovereignty report to Verascore (the report leaves this machine; call it only on explicit operator instruction) |
sanctuary/bootstrap_create_escrow | Create escrow for trust bootstrapping |
sanctuary/bootstrap_provide_guarantee | Principal guarantee certificate (Tier 1) |
Building portable reputation:
sanctuary/reputation_record: create a signed attestationsanctuary/reputation_query_weighted: see weighted scoressanctuary/reputation_export: bundle your reputationsanctuary/reputation_import: bring your track record with you| Tool | Purpose |
|---|---|
sanctuary/exec_attest | Generate execution environment attestation |
sanctuary/monitor_health | Sovereignty Health Report (human-readable) |
sanctuary/monitor_audit_log | Query the audit log |
sanctuary/principal_policy_view | View current principal policy (Tier 1) |
sanctuary/principal_baseline_view | View behavioral baseline (Tier 1) |
sanctuary/manifest | Generate Sanctuary Interface Manifest (SIM) |
Principal Dashboard:
Enable the dashboard in config (dashboard.enabled: true) to get a web UI at http://localhost:3501 (or the next free port, trying up to twenty ports from 3501) where you can approve or deny operations, monitor the audit log, and view behavioral baselines. The sanctuary protect install flow starts the dashboard for you unless you pass --no-dashboard.
Webhook Approval Channel:
Enable webhook approvals (webhook.enabled: true, webhook.url, webhook.secret) to route approval requests to external systems (Slack, Discord, PagerDuty, custom HTTP endpoints).
| Tool | Purpose |
|---|---|
sanctuary/federation_peers | List, register, or remove federation peers |
sanctuary/federation_trust_evaluate | Evaluate trust level for a federation peer |
sanctuary/federation_status | Federation subsystem status |
Sanctuary ships as five named mechanisms: Castle Wall (the perimeter: OS-level egress enforcement), Sentinels (observation, not enforcement), Charter (the cooperative MCP surface this skill uses), Heralds (recognition by other sovereigns: Concordia receipts and Verascore reputation, both optional), and Mantle (installation binding; no Assurance Matrix row covers it and confinement to one machine is not claimed).
Within Charter, the tools are grouped in four capability surfaces:
Beneath the cooperative surface, on macOS, the Castle Wall enforces a signed operator policy with a clean per-uid allow/deny demonstration that survives attended reboot cycles, so the allow/deny decision is made below the agent rather than by it; that proof is one host and one OS version, not an audited per-rule, per-flow trail. On Ubuntu 24.04 (x86-64), a fresh install of the shipped package enforces a signed operator policy per user account: blocked destinations stay blocked and allowed ones connect, through five reboots, on three fresh servers, with the evidence checked by two independent reviewers. Fault-injection witnesses, a real-agent harness, and every other distribution or architecture remain unproven. See the repository README for the current per-platform enforcement status and its proven bounds.
User state under ~/.sanctuary/state/ is encrypted with AES-256-GCM. Keys are derived via Argon2id. Integrity is verified via Merkle trees. Identity is Ed25519 with key rotation support. Operator policy and harness backup configs can be plaintext, so plaintext claims must stay scoped to user state.
111 registered MCP tools (measured 2026-10-13). Three approval channels (stderr, dashboard, webhook). Concordia bridge. Protection-posture audit. Context gating. Apache 2.0. The current prerelease is v1.9.0-rc.4 on the npm next tag; the current published stable version on npm is @sanctuary-framework/[email protected].
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub eriknewton/sanctuary-framework --plugin sanctuary-frameworkOther plugins' skills for the same job