Security
Tripwire governs structured file actions (file_read, file_write, file_patch, file_changeset) and owner-defined commands (run_command) that an agent sends through its MCP tools or CLI. This page says what that does and does not protect, then maps each claim to the test that checks it.
Trust boundary
| Party | Trusted to | Not trusted to |
|---|---|---|
| Owner | Set the task, policy and review threshold; approve proposals | Nothing: the owner is the authority |
| Agent (MCP client) | Request file actions | Approve anything, change the profile, pick its own task |
| Models (TF-IDF, optional Liquid) | Raise an action to owner review | Lower a decision the policy has made |
| Other processes as the same OS user | Nothing | They can read private state; see limits below |
What the gateway enforces
| Property | How | Test |
|---|---|---|
| Paths outside policy are denied before any file access | Capability policy: readable/writable roots, protected paths, byte limits | tests/test_capabilities.py::test_hostile_paths_blocked |
| Unknown tools and malformed actions are denied | Policy fails closed | tests/test_capabilities.py::test_unknown_tools_and_malformed_actions_block |
Writes need approval unless inside an auto_write_roots subtree | Policy v2 | tests/test_capabilities.py::test_writes_require_approval_and_obey_limit, tests/test_fusion.py::test_auto_roots |
| Symlinks, hard links to outside files and oversized files are refused | No-follow path resolution, link-count check, byte bounds | tests/test_runtime.py::test_symlinks_and_limits, ::test_hard_link_to_external_file_is_denied |
| An approval is single-use and consumed before file I/O | Atomic consume in the approval store | tests/test_gateway.py::test_approval_consumed_once, tests/test_runtime.py::test_approval_binding_single_use_and_failure_consumption |
| An approval is bound to task, context, exact action and active profile | Review hash over all four | tests/test_fusion.py::test_patch_and_review_binding, tests/test_gateway.py::test_execution_snapshots_caller_action_before_assessment |
| Approvals expire within five minutes | Expiry timestamp checked at consume | tests/test_runtime.py::test_expiry_and_db_placement |
| Changing the profile invalidates pending proposals and tickets, even if later reverted | Profile digest in the review hash | tests/test_gateway.py::test_reject_and_profile_change_invalidate, ::test_reverted_profile_requires_fresh_approval |
| Two gateway instances sharing a state directory cannot both approve or run one proposal | File lock on the state directory | tests/test_gateway.py::test_separate_gateways_serialize_approval_and_replay |
| A rejected proposal cannot be resubmitted; a completed one needs a fresh approval | resubmit creates a new review | tests/test_gateway.py::test_resubmit_requires_fresh_approval_and_rejection_stays_blocked |
| A stale patch (source changed since the read) is refused | expected_sha256 checked under the write lock | tests/test_fusion.py::test_review_for_read_and_stale_patch |
| If the audit record cannot be written, no I/O happens | Audit precedes execution | tests/test_runtime.py::test_audit_failure_prevents_io |
| The operator console rejects bad origin, host, auth and oversized bodies | Loopback bind, per-run secret, strict JSON, security headers | tests/test_operator_console.py::test_auth_origin_host_and_bounds, ::test_strict_json_and_security_headers |
| Untrusted text (paths, diffs) is rendered as text nodes, never HTML | textContent only | tests/test_operator_console.py::test_ui_uses_text_nodes_for_untrusted_content |
| A blocked action never reaches the remote Liquid model | Block is decided before advice | tests/test_gateway.py::test_block_skips_liquid |
| A change set takes the strictest decision of its files; one blocked file blocks the set | Per-file policy, combined | tests/test_changeset.py::test_policy_combines_files, tests/test_fusion_parity.py::test_fusion_browser_parity |
| One stale or missing precondition rejects the whole change set before any write | All files inspected first | tests/test_changeset.py::test_one_stale_file_rejects_the_whole_set, ::test_create_refuses_existing_file_and_missing_folder |
| A change set that fails part-way, or a crash during one, leaves the original files | Journal of originals outside the workspace, rollback, recovery on start | tests/test_changeset.py::test_failure_midway_rolls_back, ::test_crash_journal_is_recovered |
| Recovery never overwrites a file someone else changed meanwhile | Restores only files holding the proposed content; conflicts block new sets | tests/test_changeset.py::test_recovery_conflict_keeps_journal_and_blocks_new_sets |
| Agent status and resume tools cannot approve; resume runs only the exact stored action | No approval path in agent tools; resume re-enters the normal gateway check | tests/test_proposal_status.py::test_pending_then_approved_then_resumed, tests/test_mcp_gateway.py::test_mcp_changeset_status_and_resume |
| An expired approval returns the proposal to the inbox; it is never run on a dead token | Token expiry checked before use | tests/test_proposal_status.py::test_expired_approval_returns_to_inbox |
| An agent can run only commands the owner defined, by name, without changing their arguments | run_command takes only a name; argv comes from the profile | tests/test_commands.py::test_decisions, tests/test_fusion_parity.py::test_fusion_browser_parity |
| Commands run without a shell, in the workspace, without the gateway's secrets in their environment | Fixed argv, reduced environment | tests/test_commands.py::test_runs_without_shell_in_workspace_with_reduced_env |
| A command that overruns is killed with its child processes | Own process group, killed on timeout | tests/test_commands.py::test_timeout_kills_the_process_group |
| A delete or rename in a change set needs the source digest; a rename never overwrites a target | Digest checked before the first write; target must be absent; journaled rollback covers both | tests/test_changeset.py::test_rename_onto_existing_or_stale_source_is_refused, ::test_failed_rename_and_delete_roll_back, ::test_crash_during_rename_is_recovered |
| Proxy enforce mode never forwards review or block calls | Decision made before forwarding; the proxy answers with an error result | tests/test_proxy.py::test_enforce_stops_review_and_block_without_forwarding, ::test_unparseable_and_batched_calls_are_not_forwarded |
| The proxy log holds digests, not argument values, in private state | SHA-256 of canonical JSON plus sorted keys; state 700, log 600, no symlinks | tests/test_proxy.py::test_log_never_contains_argument_values, ::test_state_dir_must_be_private |
| A proxied server gets only named environment variables; the proxy's local model fails closed | PATH, HOME, LANG plus upstream.env; model errors raise allow to review | tests/test_proxy.py::test_upstream_env_only_passes_named_variables, ::test_local_model_raises_and_fails_closed |
| Gateways sharing a state directory do not corrupt its database | Runner never opens and closes an existing database file; every connection is closed | tests/test_runtime.py::test_runner_never_opens_an_existing_database_file (stress probe in EVIDENCE 2026-11-18) |
| Policy rehearsal never runs actions, saves the profile or calls Liquid | Assessment only | tests/test_rehearsal.py::test_rehearsal_does_not_change_state |
Run them with make unit. The tests exercise the real gateway on temporary directories; they do not mock the file system.
What it does not do
- It is not a sandbox. It governs actions sent through its tools. An agent that also has a native shell or editor can bypass it. Deny native file tools in the client and isolate the process (container, separate OS user) if you need enforcement. Telling the model to prefer Tripwire is a convenience, not a boundary.
- The console is an owner interface, not isolation from hostile code running as the same OS user. The login file and state directory are credentials; keep them out of the agent's reach and outside the workspace.
- The proxy governs only calls routed through it, matches rules by tool name only, does not inspect upstream responses, and has no approval flow in enforce mode (ADR-0023).
- Commands are not sandboxed. An owner-defined command runs as your user and executes project code, including files the agent changed with approval or wrote automatically. Approve each run, keep
autooff for commands that run agent-writable code, and use a container if you need isolation. - A change set is not a filesystem transaction. Files are replaced one by one; another process can observe the set half-applied, and a power loss before the rollback finishes is recovered at the next gateway start, not instantly. Recovery leaves alone any file that changed outside Tripwire and reports it.
- Independent writers are not coordinated. The gateway serializes its own writes. Another process editing the same file between the digest check and the replace is outside its promise.
- After-approval failures are possible. If the audit write fails after the operation, the outcome is uncertain; inspect the target before asking again.
- The models are weak signals. The bundled TF-IDF model is trained on a public benchmark of tool-call injections, not on your project, and its measured limits are in the evaluation. It can only raise an action to review; it is never the reason something is allowed.
Data flow
Audit metadata (tool, path, outcome) is stored in the private state directory. File contents are not audited. Proposal state holds the submitted action and context so the owner can review them. If the profile sets liquid: required, the task, action and context are sent to the configured OpenRouter model for each assessed action (at most 500 calls per gateway process, then actions wait for approval; ADR-0021); the key is read from the process environment only. With liquid: off, nothing leaves the machine.
Reporting
Open a private security advisory on the GitHub repository, or an issue without exploit details.