# Sanctuary

> Sanctuary is an open-source MCP server for security. Local MCP server adding encrypted keys, approval gates and an audit chain around AI agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** macOS, Linux, CLI, Self-hosted
- **Repository:** https://github.com/eriknewton/sanctuary-framework
- **MCP Registry name:** ai.sanctuaryprotocol/sanctuary
- **Categories:** [security](https://ai-powered.com/categories/security), [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm)
- **Listing updated:** 2026-11-23

## About

Sanctuary targets the risk that an agent on your machine can use every credential and permission your account has. Its answer is a layer under the agent: keys held under your passphrase, a policy that is frozen at startup and that the agent cannot read, and an append-only, hash-chained record of what the agent did. Approval gates have three tiers, with a human required on irreversible actions.

The README is unusually explicit about what is proven. Operating-system egress enforcement is proven on macOS and, in a separate Castle Wall Linux package, on Ubuntu 24.04 (x86-64) only; Windows is roadmapped. The audit record and export are marked partial, and it does not claim a filesystem or process sandbox.

One command wraps Claude Code, and the README also names Cursor, Hermes, OpenClaw, Cline and Mastra, with Mastra fixture-tested only. It needs Node.js 22 or newer.

## Features

- **Encrypted local keys:** Ed25519 identity and Argon2id unlock keep keys and state encrypted under your passphrase.
- **Approval gates:** Three approval tiers with a human on the irreversible ones.
- **Hash-chained audit record:** An append-only log of what the agent did, rated partial by the project.
- **Egress policy wall:** Signed operator policy allows or denies outbound traffic below the agent on macOS and Ubuntu 24.04.
- **Harness wrapping:** One command protects Claude Code and other named harnesses.
- **Evidence matrix:** An Assurance Matrix ties each claim to a captured drill.

## Good for

- Put approval gates in front of an autonomous coding agent
- Restrict where an agent account's network traffic can go
- Keep agent keys and state encrypted on your own hardware
- Review a tamper-evident log of an agent's actions

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.sanctuary]
command = "npx"
args = ["-y", "@sanctuary-framework/mcp-server"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user sanctuary npx -- -y @sanctuary-framework/mcp-server

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "sanctuary": {
      "command": "npx",
      "args": [
        "-y",
        "@sanctuary-framework/mcp-server"
      ]
    }
  }
}
```

## FAQ

### Which platforms are covered?

macOS is proven; Linux is proven on Ubuntu 24.04 (x86-64) only via a separate package; Windows enforcement is roadmapped.

### Does Sanctuary need a vendor service?

No. The README says no vendor sits in the path or can decrypt your state.

### Which agents can Sanctuary wrap?

Claude Code, Cursor, Hermes, OpenClaw, Cline and Mastra, with wrapping tested on representative paths only.

### What does Sanctuary not claim?

A filesystem or process sandbox for the agent, or an audited per-rule trail.

### Is Sanctuary free?

Yes. Sanctuary is open source, so you can use and self-host it for free.

### How do I add Sanctuary to Claude Code?

Run this command in your terminal: claude mcp add sanctuary -- npx -y @sanctuary-framework/mcp-server

### What are the best alternatives to Sanctuary?

The closest alternatives to Sanctuary are REA, headroom, omniget, next-ai-draw-io and Claude Code Ultimate Guide.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [headroom](https://ai-powered.com/mcp/headroom-3): headroom is an open-source MCP server for ai models and llm tooling.
- [omniget](https://ai-powered.com/mcp/omniget): omniget is an open-source MCP server for ai models and llm tooling.
- [next-ai-draw-io](https://ai-powered.com/mcp/next-ai-draw-io-2): next-ai-draw-io is an open-source MCP server for ai models and llm tooling.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [mcp-for-blender](https://ai-powered.com/mcp/mcp-for-blender): mcp-for-blender is an open-source MCP server for design and media.
- [unity-mcp](https://ai-powered.com/mcp/unity-mcp-2): unity-mcp is an open-source MCP server for ai models and llm tooling.
- [tyk](https://ai-powered.com/mcp/tyk): tyk is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/sanctuary
