Setup

Requires Python 3.11 on a POSIX system. Tripwire governs file actions sent through its MCP tools; it does not intercept an agent's native shell or editor, so you also need to restrict those (see the last section).

Install

From a checkout:

python3.11 -m venv .venv
.venv/bin/python -m pip install -e .
.venv/bin/tripwire demo

Or from the downloadable wheel (checksums in SHA256SUMS):

python3.11 -m venv .venv
.venv/bin/python -m pip install tripwire-0.7.0-py3-none-any.whl
.venv/bin/tripwire demo

tripwire demo uses a temporary directory to show a source read, an automatic scratch write, a protected patch, owner approval, execution, replay rejection and a blocked protected path.

Connect a project

tripwire connect sets up a project for one MCP client. Preview first; --dry-run creates nothing:

tripwire connect --workspace /abs/project --client codex --dry-run
tripwire connect --workspace /abs/project --client codex --task 'Fix the login bug'
tripwire connect --workspace /abs/project --client claude-code --template docs --auto-folder notes/drafts

Clients: codex, claude-code, claude-desktop, cursor, opencode (V1 config), opencode-v2, generic. The output says how that client's format was checked: OpenCode V1 has been run end to end, Claude Code registered the server and reported it Connected, and the rest match the client's documentation but have not been run here. The command:

--write PATH also saves the config to a new file. Tripwire never edits or overwrites an existing client config; you paste or merge the entry yourself. --format json prints the same plan as JSON.

Templates for a new profile (--template):

TemplateReadsWrites (approval)Automatic writes
coding-review (default)docs/, src/, tests/, notes/, scratch/, README.mdnotes/, src/, tests/scratch/
docsdocs/, src/, scratch/, README.mddocs/scratch/
testssrc/, tests/, scratch/, README.mdtests/scratch/
read-onlydocs/, src/, tests/, scratch/, README.mdnonescratch/

--test-command 'python3 -m pytest -q' lets the agent ask to run your tests as the command tests; every run waits for your approval and you see the exact command first. --auto-folder DIR (repeatable) replaces the automatic folders; --auto-folder "" means none. Before changing an existing profile, rehearse the draft: tripwire rehearse --draft draft.json ... or the console's Rehearse button shows which saved decisions would change. Change it in the console's Policies view or in the workbench.

Start the console in its own terminal with the command connect printed, then restart your client. The console prints the path of a private login file; open it to get into the inbox.

Manual setup

connect is a convenience over these steps:

tripwire init --workspace /abs/project --state-dir /private/state --task 'Review the project'
mkdir -p /abs/project/notes /abs/project/scratch
tripwire console --workspace /abs/project --state-dir /private/state --profile /private/state/profile.json

and an MCP entry that launches /absolute/venv/bin/tripwire mcp --workspace /abs/project --state-dir /private/state --profile /private/state/profile.json over stdio. The dashboard-review example ships a working OpenCode config.

First task

Ask the agent to read a small source file with tripwire_read_file, write findings to scratch/, then propose a tripwire_patch_file using the digest from the read. The patch appears in the inbox. Preview it, approve it, then ask the agent to retry the same call. Open Activity to see what ran. A request for .env is denied.

Watch this exact sequence with OpenCode.

Make it enforceable

The gateway is only a boundary for actions that go through it. For real enforcement:

See Security for what is and is not covered.