Reference

Commands

CommandPurpose
tripwire connectSet up a project and print the MCP config for a client
tripwire initCreate an owner profile and state directory
tripwire consoleStart the loopback operator console (inbox, policies, activity)
tripwire mcpStart the stdio MCP server for an agent
tripwire assessEvaluate an action against a profile without running it
tripwire runRun an action; returns a proposal id (exit 2) if review is needed
tripwire approveApprove a proposal from the command line
tripwire proposalShow a proposal's state and next step, or resume it once approved
tripwire rehearseShow which saved decisions a draft profile would change; export scenarios
tripwire proxyPut Tripwire in front of any MCP server: log (shadow) or enforce tool-call rules
tripwire proxy-reportSummarize the proxy's decision log, including how many calls enforcement would stop
tripwire checkEvaluate an action against a bare policy file
tripwire reviewAsk Liquid d1.1 to review task intent (external, opt-in)
tripwire demoWalk through read, approval and write in a temporary directory
tripwire-researchDataset, labelling and evaluation commands; see Research
tripwire connect --workspace /abs/project \
                 --client codex|claude-code|claude-desktop|cursor|opencode|opencode-v2|generic \
                 [--template coding-review|docs|tests|read-only] [--auto-folder DIR ...] [--liquid] \
                 [--test-command 'python3 -m pytest -q'] \
                 [--state-dir DIR] [--task TEXT] [--write NEW_FILE] [--dry-run] [--format text|json]
tripwire init    --workspace /abs/project --state-dir /private/state --task 'Review source'
tripwire console --workspace /abs/project --state-dir /private/state --profile /private/state/profile.json
tripwire mcp     --workspace /abs/project --state-dir /private/state --profile /private/state/profile.json
tripwire assess  --profile /private/state/profile.json --request action.json --context-file context.txt --format json
tripwire run     --profile /private/state/profile.json --request action.json --workspace /abs/project --state-dir /private/state
tripwire approve --proposal PROPOSAL_ID --profile /private/state/profile.json --workspace /abs/project --state-dir /private/state
tripwire proposal status|resume --id PROPOSAL_ID [--wait SECONDS] --workspace ... --state-dir ... --profile ...
tripwire rehearse --draft draft.json [--scenarios FILE ...] [--examples coding-review|docs|tests|read-only] \
                  [--no-saved] [--export NEW_FILE] \
                  --workspace ... --state-dir ... --profile /private/state/profile.json

connect creates a profile from a template only when none exists: coding-review (default), docs, tests or read-only, each with scratch/ as the only automatic write folder. --auto-folder replaces that choice (repeat it; --auto-folder "" for none); each automatic folder is also made readable and writable. It prints the client's own mcp add command for Codex and Claude Code, and says how each client format was checked: OpenCode V1 was run end to end, Claude Code reported the server Connected, the others only match their documentation. connect keeps an existing profile (and ignores --task, --template and --auto-folder then), refuses a state directory inside the project or one that others can read, and refuses to overwrite an existing --write target. assess never executes. --liquid requests live advice only when the profile requires it. run --resubmit asks for a fresh review after a completed or failed proposal. The older --policy plus approval-file mode, without --profile, is separate from the inbox.

Actions

{ "tool": "file_read",  "args": { "path": "docs/example.md" } }
{ "tool": "file_write", "args": { "path": "scratch/notes.md", "content": "..." } }
{ "tool": "file_patch", "args": { "path": "src/a.py", "expected_sha256": "<digest from the read>",
                                  "edits": [ { "old": "x = 1", "new": "x = 2" } ] } }
{ "tool": "run_command", "args": { "name": "tests" } }
{ "tool": "file_changeset", "args": { "title": "Fix rounding", "goal": "Fix the bug and test it",
    "changes": [ { "path": "src/a.py", "expected_sha256": "<digest>", "edits": [ ... ] },
                 { "path": "tests/test_a.py", "content": "new file" },
                 { "path": "src/old.py", "expected_sha256": "<digest>", "delete": true },
                 { "path": "src/b.py", "expected_sha256": "<digest>", "to": "src/c.py" } ] } }

A patch has at most 20 edits; each old string must match exactly once. The digest comes from the preceding read, so a file that changed in between is refused.

A change set has a title (up to 120 characters), a goal (up to 2,000) and 1 to 10 changes to distinct paths. Each change patches an existing file, creates a new one (the file must not exist; its folder must), deletes a file whose digest matches, or renames one (the target must not exist; content is unchanged). A delete is checked as a write to its path and a rename as a write to both paths; no path may appear twice. The policy decision is the strictest of its files: one blocked file blocks the set, any file needing review makes the whole set a single proposal. Approval binds to the exact manifest. Before writing, every precondition is checked; the originals are journaled outside the workspace, and a failure part-way restores them. After a crash, the gateway rolls the set back on its next start; a file edited outside Tripwire in the meantime is left alone and new change sets are refused until the conflict is resolved (ADR-0017).

MCP tools

ToolWhat it does
tripwire_checkEvaluate an action against the policy without running it
tripwire_assessPolicy plus advisory signals, without running it
tripwire_read_fileRead a file; returns content and sha256
tripwire_write_fileWrite a file (automatic under an auto-write root, otherwise a proposal)
tripwire_patch_fileApply bounded edits against a known digest (proposal unless in an auto-write root)
tripwire_propose_changesPropose a multi-file change set, reviewed as one and applied all-or-nothing
tripwire_proposal_statusA proposal's state and next step; wait_seconds (up to 120) waits for the owner
tripwire_resumeRun the exact stored action of an approved proposal, once
tripwire_run_commandRun an owner-defined command (for example the tests) by name; returns exit code and output

File tools accept resubmit: true to request fresh review after a completed or failed proposal. Agents have no tool to approve a proposal, retask the agent, or edit the profile.

Proposal states (ADR-0018): waiting_for_owner, approved (with approval_expires_in), rejected, completed, failed, changed_profile (the owner edited the profile), and stale_source (a patched file changed since the proposal). An approval whose one-time token expires returns the proposal to the inbox instead of failing it. Approvals last 300 seconds by default (--ttl 1 to 300; ADR-0020).

Policy rehearsal

tripwire rehearse and the console's "Rehearse draft on saved proposals" button assess every saved proposal (and any scenario files) under the current and the draft profile, then list the decisions that change, with the rule and reason, and the profile differences (ADR-0019). Nothing runs and Liquid is never called: a draft that requires Liquid shows review for actions Liquid would otherwise check, and the report notes this. Scenario files are {"version": 1, "scenarios": [{"name", "action", "context"}]}; a workbench scenario export is also accepted. --examples NAME adds a packaged set of 15 to 17 typical actions for that template (reads, scratch notes, patches, change sets, the test command, protected reads and injected-instruction writes), so a draft can be rehearsed before any proposal exists. The workbench edits commands as lines like tests: python3 -m pytest -q.

MCP proxy

tripwire proxy sits in front of any MCP server, not just Tripwire's own tools (ADR-0023). It starts the upstream server, relays every message unchanged and inspects each tools/call by tool name.

tripwire proxy --config proxy.json --state-dir /private/proxy-state
tripwire proxy-report --state-dir /private/proxy-state [--format text|json]

Config (JSON, at most 64 KiB, unknown or duplicate keys rejected):

Shadow mode forwards every call and logs what enforcement would have done; enforce mode forwards only allow and answers review and block itself with an error result. There is no approval flow in the proxy yet: after reading the shadow report, the owner adds allow rules. The log (proxy-decisions.jsonl, state directory mode 700, file mode 600, append-only) records time, mode, tool, a SHA-256 of the arguments and their keys, the rule, the decision, whether it was forwarded and the local-model status, never argument values. Messages that are not strict JSON and batches containing a tools/call are refused, because they cannot be inspected reliably.

Profile

{
  "version": 1,
  "name": "Coding review",
  "task": "Review the project and propose small, relevant improvements.",
  "policy": {
    "version": 2,
    "read_roots": ["docs", "src", "tests", "notes", "scratch"],
    "read_files": ["README.md"],
    "write_roots": ["notes", "src", "tests", "scratch"],
    "auto_write_roots": ["scratch"],
    "max_read_bytes": 65536,
    "max_write_bytes": 16384
  },
  "fusion": { "local_model": true, "liquid": "off", "review_at": 0.9223001771823532 }
}

Examples: coding, personal assistant. Keep the live profile in an owner-controlled regular file outside the workspace. Applying a change reloads it and invalidates pending proposals and tickets.

HTTP check service

A separate service, python -m tripwire.guard.service --artifact-dir dist/guard (container: see the Dockerfile), scores tool calls with the TF-IDF classifier for use by a trusted application. It is not part of the gateway.

EndpointMethodPurpose
/healthz, /readyzGETLiveness and readiness
/v1/metadataGETModel and threshold provenance
/v1/examplesGETCurated examples
/v1/checksPOSTScore a proposed call
/v1/decisionsPOSTDecide and apply the severity floor
/metricsGETCounters

Build the artifact with make guard. Latency on a Linux development sample is in the evaluation.