You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2188a01
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/GUARD.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,7 +199,7 @@ A URL/HTTP-transport server entry has no `command`, so the stdio MITM relay cann
199
199
Consent does **not** add protection — it records that you accepted its absence. The underlying limitation stands: no relay exists for non-stdio transports (a streamable-HTTP MITM is deferred).
Reverses the wrap by parsing the wrap marker out of the args and reconstructing the original entry. Falls back to the `.bak` if the wrap pattern is malformed (e.g. user hand-edited the config since enable).
202
+
Reconstructs the original entry from a recognized wrap marker. Ambiguous or malformed wrappers are skipped with repair guidance; disable does not automatically restore a `.bak`. Review a trusted client-config backup and recover the original entry before enabling again. See the [wrapper recognition limits](#mcpm-guard-status).
203
203
204
204
### `mcpm guard enable [...] --confine [off]`
205
205
Opt-in OS sandbox for the servers being wrapped (macOS only, shipped in v0.16.0). See **OS confinement (`--confine`)** below. The bare flag enrolls every unwrapped stdio server it wraps at the "standard" tier; `--confine off` is the same as omitting the flag (no enrollment). Respects `--client` / `--server`.
@@ -215,7 +215,7 @@ Wrapper recognition checks the launcher and complete marker, including its origi
215
215
Malformed markers, missing package paths and pre-hash legacy wrappers are ambiguous: status/doctor report them without counting them guarded, and enable/disable/update refuse to rewrite them. Restore the original server from a trusted client-config backup, then enable again. Recognition is static configuration evidence: it does not authenticate binary bytes or forged package metadata, prove an old Node still exists, or prove the client loaded the wrapper. A moved script with an arbitrary alias may need manual recovery because its former identity cannot be inferred.
216
216
217
217
### `mcpm guard demo`
218
-
Runs the in-process `prompt-injection` scenario. The output is byte-identical to what the production relay emits, so screenshotting the demo accurately represents what a real block looks like. Additional scenarios (path-exfil, rug-pull) are planned but not yet shipped.
218
+
Runs the in-process `prompt-injection` scenario through the pattern engine and prints a demonstration-specific summary. It does not start a server subprocess or run the full relay, pin or policy pipeline; the formatted demo is not a capture of production wire output. The CLI exposes only this scenario.
Regenerates the integrity sidecar after manually editing `~/.mcpm/pins.json` (default) or `~/.mcpm/guard-policy.yaml` (`--policy`).
282
+
Regenerates the integrity sidecar for `~/.mcpm/pins.json` (default) or `~/.mcpm/guard-policy.yaml` (`--policy`). Review the file first: `--yes` is required to apply the reset; without it the command prints a warning and exits 1.
283
283
284
284
Required when:
285
285
- You copy `pins.json` between machines
286
286
- You hand-edit `guard-policy.yaml` directly (rather than via `mcpm guard mute/unmute/pause`)
287
287
288
-
The relay refuses to use either file if its sidecar doesn't match — this is the rug-pull defense for the configuration itself.
288
+
A pins mismatch refuses relay startup. A policy mismatch warns and uses shipped
289
+
default actions for the session, discarding stricter block promotions as well as
290
+
mutes and pause state; see [policy fallback](POLICY.md#integrity-sidecar). These
291
+
unkeyed hashes detect stale/corrupt content, not authenticity against a same-user
292
+
writer who can replace both files. Reset only after reviewing the change.
289
293
290
294
### `mcpm guard run --inner --server-name <name> -- <command> [args]`
291
295
**Internal command**, semver-exempt, not for direct user use. Invoked by wrapped client configs. Requires the `--inner` flag and refuses direct invocation without it.
@@ -310,7 +314,7 @@ On macOS, confinement is applied via Seatbelt (`sandbox-exec`). The one shipped
310
314
### Enabling and disabling
311
315
312
316
```
313
-
mcpm guard enable --confine # enroll every wrapped stdio server, standard tier
mcpm guard enable --confine --server foo # scope to one server
315
319
mcpm guard enable --confine off # same as omitting: no enrollment
316
320
```
@@ -326,12 +330,12 @@ mcpm guard enable --confine off # same as omitting: no enrollment
326
330
Confinement never fails silently. The store (`~/.mcpm/guard-confine.yaml`) is the source of truth for "is server X enrolled".
327
331
328
332
-**Confine** when the server is enrolled + the profile hash matches + an OS backend is available.
329
-
-**Run unconfined with a loud notice** when there is no OS backend (Linux / CI / Windows) or the marker/profile is missing on a **non-required** server. Never silent — backend availability is pre-checked, never inferred from a spawn error.
330
-
-**Fail closed (refuse to start, exit 1)** at spawn time on: a profile-hash mismatch (tamper), a malformed hash, a stripped marker on a `require_confine` server, or a wiped store on a `require_confine` server.
333
+
-**Run unconfined with a loud notice**on a **non-required** server when there is no OS backend (Linux / CI / Windows) or the marker/profile is missing. Never silent — backend availability is pre-checked, never inferred from a spawn error.
334
+
-**Fail closed (refuse to start, exit 1)** at spawn time on: a profile-hash mismatch (tamper), a malformed hash, a stripped marker or missing profile/store on a required server, or an unavailable OS backend when either the marker or stored profile requires confinement.
331
335
332
336
### Marker tokens
333
337
334
-
The wrapped config entry carries two new tokens **before** the `--` separator: `--confine-profile-hash <sha256>` (a content hash of the rendered profile, binding the marker to the stored profile) and `--confine-required` (a bare flag, present iff the server is `require_confine`, replicated into the IDE config so it survives a wiped store). Both are **neutral** to `--orig-hash` — excluded from its hash input, and the `--` position is unchanged — so unwrap/disable still work.
338
+
The wrapped config entry carries two new tokens **before** the `--` separator: `--confine-profile-hash <sha256>` (a content hash of the stored profile, binding the marker to that profile) and `--confine-required` (a bare flag, present iff the server is `require_confine`, replicated into the IDE config so it survives a wiped store). Both are **neutral** to `--orig-hash` — excluded from its hash input, and the `--` position is unchanged — so unwrap/disable still work.
0 commit comments