@sanctuary-framework/mcp-server 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,9 +10,9 @@ Sanctuary gives agents (and their human principals) encrypted state, sovereign i
10
10
 
11
11
  **L2 Operational Isolation** — Environment attestation, health monitoring, encrypted audit log, and **Principal Policy** — a human-controlled, agent-immutable approval system that defends against prompt injection by gating high-risk operations.
12
12
 
13
- **L3 Selective Disclosure** — Cryptographic commitments let an agent prove a claim without revealing it. Disclosure policies define what information flows where, evaluated per-field against context-specific rules.
13
+ **L3 Selective Disclosure** — SHA-256 commitments, Pedersen commitments on Ristretto255, zero-knowledge proofs of knowledge (Schnorr/Fiat-Shamir), and ZK range proofs (bit-decomposition with CDS OR-proofs). Disclosure policies define what information flows where.
14
14
 
15
- **L4 Verifiable Reputation** — Signed attestations of interaction outcomes (EAS-compatible). Queryable aggregates. Export/import for cross-platform portability. Trust bootstrapping via escrow and principal guarantees.
15
+ **L4 Verifiable Reputation** — Signed attestations (EAS-compatible) with sovereignty-gated tiers. Weighted scoring based on counterparty sovereignty posture. Export/import for cross-platform portability. Trust bootstrapping via escrow and principal guarantees. Sovereignty handshakes and MCP-to-MCP federation.
16
16
 
17
17
  ## Quick start
18
18
 
@@ -91,25 +91,51 @@ Once connected, your agent has access to these tools:
91
91
  ### L3 — Selective Disclosure
92
92
  | Tool | Description |
93
93
  |------|-------------|
94
- | `sanctuary/proof_commitment` | Create a cryptographic commitment to a value |
94
+ | `sanctuary/proof_commitment` | Create a SHA-256 cryptographic commitment |
95
95
  | `sanctuary/proof_reveal` | Verify a commitment against revealed value |
96
96
  | `sanctuary/disclosure_set_policy` | Define disclosure rules for different contexts |
97
97
  | `sanctuary/disclosure_evaluate` | Evaluate a disclosure request against policy |
98
+ | `sanctuary/zk_commit` | Create a Pedersen commitment on Ristretto255 |
99
+ | `sanctuary/zk_prove` | ZK proof of knowledge of a commitment's opening |
100
+ | `sanctuary/zk_verify` | Verify a ZK proof of knowledge |
101
+ | `sanctuary/zk_range_prove` | Prove a value is in [min, max] without revealing it |
102
+ | `sanctuary/zk_range_verify` | Verify a ZK range proof |
98
103
 
99
104
  ### L4 — Verifiable Reputation
100
105
  | Tool | Description |
101
106
  |------|-------------|
102
- | `sanctuary/reputation_record` | Record signed interaction attestation |
107
+ | `sanctuary/reputation_record` | Record signed interaction attestation (sovereignty-weighted) |
103
108
  | `sanctuary/reputation_query` | Query aggregated reputation data |
109
+ | `sanctuary/reputation_query_weighted` | Query with sovereignty-tier weighting |
104
110
  | `sanctuary/reputation_export` | Export portable reputation bundle |
105
111
  | `sanctuary/reputation_import` | Import bundle with signature verification |
106
112
  | `sanctuary/bootstrap_create_escrow` | Create escrow for trust bootstrapping |
107
113
  | `sanctuary/bootstrap_provide_guarantee` | Principal signs guarantee for agent |
114
+ | `sanctuary/handshake_initiate` | Start a sovereignty handshake |
115
+ | `sanctuary/handshake_respond` | Respond to incoming handshake |
116
+ | `sanctuary/handshake_complete` | Complete handshake (initiator side) |
117
+ | `sanctuary/handshake_status` | Check handshake session status |
118
+
119
+ ### Federation (MCP-to-MCP)
120
+ | Tool | Description |
121
+ |------|-------------|
122
+ | `sanctuary/federation_peers` | List, register, or remove federation peers |
123
+ | `sanctuary/federation_trust_evaluate` | Evaluate trust level for a federation peer |
124
+ | `sanctuary/federation_status` | Federation subsystem status |
125
+
126
+ ### Concordia Bridge
127
+ | Tool | Description |
128
+ |------|-------------|
129
+ | `sanctuary/bridge_commit` | Bind a Concordia negotiation outcome to a Sanctuary L3 commitment |
130
+ | `sanctuary/bridge_verify` | Verify a bridge commitment against a revealed outcome |
131
+ | `sanctuary/bridge_attest` | Record a negotiation as an L4 reputation attestation |
108
132
 
109
133
  ### Meta
110
134
  | Tool | Description |
111
135
  |------|-------------|
112
136
  | `sanctuary/manifest` | Sanctuary Interface Manifest (SIM) — machine-readable capabilities |
137
+ | `sanctuary/shr_generate` | Generate signed, machine-readable sovereignty health report |
138
+ | `sanctuary/shr_verify` | Verify a counterparty's SHR |
113
139
 
114
140
  ## Configuration
115
141
 
@@ -120,6 +146,15 @@ Environment variables:
120
146
  | `SANCTUARY_PASSPHRASE` | Passphrase for master key derivation | _(none — uses recovery key)_ |
121
147
  | `SANCTUARY_STORAGE_PATH` | Storage directory path | `~/.sanctuary` |
122
148
  | `SANCTUARY_TRANSPORT` | Transport mode (`stdio` or `http`) | `stdio` |
149
+ | `SANCTUARY_DASHBOARD_ENABLED` | Enable web dashboard (`true`/`false`) | `false` |
150
+ | `SANCTUARY_DASHBOARD_PORT` | Dashboard port | `3501` |
151
+ | `SANCTUARY_DASHBOARD_AUTH_TOKEN` | Bearer token (`"auto"` to generate) | — |
152
+ | `SANCTUARY_DASHBOARD_TLS_CERT` | TLS certificate path | — |
153
+ | `SANCTUARY_DASHBOARD_TLS_KEY` | TLS private key path | — |
154
+ | `SANCTUARY_WEBHOOK_ENABLED` | Enable webhook approvals | `false` |
155
+ | `SANCTUARY_WEBHOOK_URL` | Webhook target URL | — |
156
+ | `SANCTUARY_WEBHOOK_SECRET` | HMAC-SHA256 shared secret | — |
157
+ | `SANCTUARY_WEBHOOK_CALLBACK_PORT` | Callback listener port | `3502` |
123
158
 
124
159
  ## Principal Policy (prompt injection defense)
125
160
 
@@ -131,7 +166,7 @@ The Principal Policy is the human-controlled, agent-immutable configuration that
131
166
 
132
167
  **Tier 3 — Always allowed (audit only):** Standard read/write/sign operations pass through without interruption, but every operation is audit-logged.
133
168
 
134
- The policy file lives at `~/.sanctuary/principal-policy.yaml`. It is loaded once at startup and frozen — no MCP tool can modify it. The agent cannot see the policy rules in denial responses (preventing attacker learning). Approval requests flow through stderr (outside the MCP protocol), so the agent cannot intercept or forge approvals.
169
+ The policy file lives at `~/.sanctuary/principal-policy.yaml`. It is loaded once at startup and frozen — no MCP tool can modify it. The agent cannot see the policy rules in denial responses (preventing attacker learning). Approval requests flow through out-of-band channels the agent cannot access. Three channels are available: **stderr** (default, auto-deny), **dashboard** (browser-based web UI with real-time SSE, optional bearer token auth and TLS), and **webhook** (POST to external endpoints like Slack or Discord with HMAC-SHA256 signatures).
135
170
 
136
171
  On first session, non-Tier-3 operations require approval (no baseline exists yet). As the system learns normal patterns, approval fatigue decreases — you only get asked about genuinely unusual behavior.
137
172
 
@@ -181,18 +216,30 @@ src/
181
216
  │ └── tools.ts # MCP tool definitions
182
217
  ├── l2-operational/ # L2: Attestation + monitoring
183
218
  │ └── audit-log.ts # Encrypted append-only audit log
184
- ├── l3-disclosure/ # L3: Commitments + policies
219
+ ├── l3-disclosure/ # L3: Commitments + ZK proofs + policies
185
220
  │ ├── commitments.ts # SHA-256 commitment schemes
221
+ │ ├── zk-proofs.ts # Pedersen/Ristretto255, Schnorr proofs, range proofs
186
222
  │ ├── policies.ts # Disclosure policy engine
187
223
  │ └── tools.ts # MCP tool definitions
188
- ├── l4-reputation/ # L4: Reputation + bootstrap
224
+ ├── l4-reputation/ # L4: Reputation + bootstrap + tiers
189
225
  │ ├── reputation-store.ts # Signed attestations, escrow, guarantees
226
+ │ ├── tiers.ts # Sovereignty-gated reputation tiers
190
227
  │ └── tools.ts # MCP tool definitions
228
+ ├── shr/ # Machine-readable sovereignty health reports
229
+ ├── handshake/ # Sovereignty handshake protocol
230
+ ├── federation/ # MCP-to-MCP federation registry
231
+ ├── bridge/ # Concordia bridge (negotiation → sovereignty)
232
+ │ ├── types.ts # Interface contract (ConcordiaOutcome, BridgeCommitment)
233
+ │ ├── bridge.ts # Core: canonicalize, commit, verify
234
+ │ └── tools.ts # MCP tools + BridgeStore
191
235
  ├── principal-policy/ # Principal Policy (prompt injection defense)
192
236
  │ ├── types.ts # Policy, gate, baseline type definitions
193
237
  │ ├── loader.ts # YAML/JSON policy parser + defaults
194
238
  │ ├── baseline.ts # Behavioral baseline tracker (encrypted)
195
239
  │ ├── approval-channel.ts # Stderr + callback approval channels
240
+ │ ├── dashboard.ts # Browser-based approval UI (SSE, auth, TLS)
241
+ │ ├── dashboard-html.ts # Embedded HTML/CSS/JS template
242
+ │ ├── webhook.ts # External webhook approval (HMAC-SHA256)
196
243
  │ ├── gate.ts # Three-tier approval gate
197
244
  │ └── tools.ts # Read-only policy/baseline MCP tools
198
245
  ├── router.ts # MCP SDK tool router (with gate integration)