TripWire MCP Server
Sandbox-first command safety layer for MCP-compatible coding agents, protecting commands executed through its safe_exec tool by blocking destructive operations and requiring human approval for ambiguous commands.
README
TripWire
TripWire is a sandbox-first prototype of a command safety layer for MCP-compatible coding agents. It protects only commands sent through its safe_exec MCP tool; it is not host-wide enforcement and cannot protect an agent that bypasses the tool.
Safety model
- Commands execute only in the configured, marker-protected demo sandbox.
- Safe read/test commands run immediately. Known destructive commands and shell/parser evasions are blocked.
- Unresolved environment, command, and home-directory expansion syntax (including
$HOME,%USERPROFILE%,!HOME!,$env:HOME,$(...),~, and~/...) is a policy violation even for an otherwise harmless command such asls $HOME. This is deliberate: TripWire detects syntax but does not resolve shell-dependent paths. - Test/seed/cleanup operations that target a production-marked URL or connection string are blocked when destructive, or held for human review when lower-confidence. Built-in production markers are always active;
TRIPWIRE_PRODUCTION_MARKERScan add comma-separated private markers. This is heuristic detection only: an unlabelled production resource that matches no known marker cannot be identified by this layer. - Ambiguous commands enter a bounded GPT-5.6 Terra tool-calling loop in
livemode, or a visibly labelled deterministic fixture indemomode. The live agent may only requestget_contextandsnapshot_state; it has no execution, rollback, cache, audit, or rule-writing authority. A model allow/flag result always waits for human approval. - A workspace tarball and SQLite backup are created before a pending mutation or cached mutation runs. Rollback is explicit.
- Human review is two-step: authorization creates a short-lived, signed confirmation capability; only an explicit confirmation consumes it and starts execution. A dashboard disconnect before confirmation leaves the command unexecuted. Once confirmation is accepted, execution is authoritative even if the browser loses its response.
- The local JSONL audit log is hash chained and validated by the dashboard. It is tamper-evident, not immutable.
- After an escalated incident is logged, the agent drafts a short dashboard report. Repeated normalized patterns may produce a cache proposal, but a human must explicitly accept it. Proposals never edit safety rules and accepting one starts no command.
Run the judge demo
export TRIPWIRE_API_KEY="replace-with-a-long-random-local-secret"
docker compose up --build
Open http://localhost:8000, enter the same API key to unlock the dashboard, then approve the seeded touch agent-note.txt replay and roll it back. The dashboard seeds replay incidents in its own process, so pending commands remain approvable. The Compose profile runs as a non-root user with a read-only root filesystem, dropped Linux capabilities, resource limits, and required Landlock enforcement. Docker Desktop with WSL2 and a Landlock-capable Linux kernel are required; the service refuses protected execution when its Landlock probe fails.
It also records two non-executing risk-taxonomy examples: rm -rf ~ and a synthetic test cleanup aimed at a production-marked database URL. Credentials in connection strings are redacted from the dashboard, audit record, and model prompt.
For a real reasoning call, set TRIPWIRE_MODE=live and OPENAI_API_KEY; no missing-key fallback is allowed in live mode.
Run the shipped test suite in the same image with:
docker compose run --rm --entrypoint pytest tripwire
Run the scripted acceptance scenario used for a fast judge check with:
docker compose run --rm --entrypoint python tripwire scenario_runner.py
It proves the safe, destructive, human-review, approval, rollback, cached-verdict, model-failure, and audit-chain paths in a fresh temporary sandbox. The interactive dashboard replay remains the best route for the visual demo.
MCP configuration
Add this to the Codex configuration appropriate to your machine, then start the dashboard separately with tripwire-dashboard:
[mcp_servers.tripwire]
command = "tripwire-mcp"
[mcp_servers.tripwire.env]
TRIPWIRE_MODE = "demo"
TRIPWIRE_SANDBOX_ROOT = "./demo/workspace"
TRIPWIRE_STATE_ROOT = "./demo/state"
TRIPWIRE_API_KEY = "replace-with-a-long-random-local-secret"
TRIPWIRE_APPROVAL_KEY = "same-long-random-local-secret-or-a-separate-shared-secret"
The MCP server exposes safe_exec(command, cwd, intent) and rollback(snapshot_id). safe_exec is the integration boundary: do not expose a raw shell tool alongside it for a safety demonstration. The dashboard and MCP process must share TRIPWIRE_SANDBOX_ROOT, TRIPWIRE_STATE_ROOT, and TRIPWIRE_APPROVAL_KEY. Every pending mutation is persisted as an HMAC-bound, one-time record tied to its exact canonical command, cwd, sandbox root, snapshot, expiry, and nonce; dashboard approval consumes it once.
Development
python -m pip install -e ".[dev]"
pytest
tripwire-demo
The project intentionally rejects redirection, pipelines, command substitution, encoded payloads, network/cloud tooling, executable paths, unsupported flags, path operands outside the sandbox, and symlink operands. pytest and git are review-required because they can execute repository-controlled behavior. Those restrictions make the demo boundary inspectable; production enforcement needs stronger isolated workers in addition to this application layer.
Execution integrations
The integrations/ directory contains the next product layer:
terminal/: Bash and PowerShelltwwrappers that preflight or submit commands to a running local gateway. They enforce only commands deliberately routed throughtw; MCP cannot intercept arbitrary shell input on its own.cursor-extension/: an experimental Cursor/VS Code protected-terminal prototype. The packaged.vsixis included for development evaluation, but is not the primary judge or video path for this submission.antigravity/: a workspace plugin that installs the local MCP server and a rule directing agent command calls tosafe_exec.replit/: deployment instructions for the authenticated Streamable HTTP policy gateway. It exposespreflight_commandand is advisory until Replit offers a non-bypassable execution hook.
Local fallback (unprotected demo)
If Docker Desktop cannot start the protected stack, the approval, audit, snapshot, and rollback demo can run directly from a local terminal. This mode does not provide Docker or Landlock execution isolation and must not be presented as protected execution.
From the repository root in VS Code or PowerShell:
.\scripts\run-local-demo.ps1
The script prints a one-time API key and starts a localhost-only dashboard at http://127.0.0.1:8000. Enter that key in the dashboard. Press Ctrl+C in the same terminal to stop it.
VS Code demo path
The submission demo uses VS Code as the local development environment and the browser dashboard as the approval surface; it does not rely on the experimental VSIX. Open the repository folder in VS Code, run Tasks: Run Task → TripWire: Start local demo, and choose a local dashboard key when prompted. The task disables Docker Compose Bake (a Docker Desktop compatibility workaround), starts the protected stack, and seeds the dashboard. Open http://127.0.0.1:8000, enter the same key, then run the approval-and-rollback walkthrough in docs/VIDEO_DEMO.md.
Security validation
Run the deterministic validation report with python scripts/security_report.py. The Docker/Landlock, live GPT-5.6, Cursor/Codex, and Railway validation procedures are in docs/SECURITY_VALIDATION.md. Live validation is opt-in, uses a disposable sandbox, requires current input/output rate values, and defaults to a US$5 estimated-cost ceiling.
For a fast evaluation walkthrough, see the judge guide.
For a judge-run live GPT-5.6 validation, copy .env.example to .env, enter a dedicated revocable API key and the current input/output rates, then explicitly set TRIPWIRE_TEST_LIVE=1. Run python scripts/live_validation.py. The runner loads that local file without overriding shell/CI variables, never confirms a mutation, and writes a redacted latency, usage, tool-call, and estimated-cost report. .env is gitignored and is used by this validation runner only; it does not silently switch the Docker dashboard out of demo mode.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。