gatehouse
One install that puts a security perimeter around your AI agent.
uv tool install agent-gatehouse # or: pipx install agent-gatehouse
gatehouse setup # shows a plan, asks, then protects every agent it finds
gatehouse status # am I protected?
setup finds Claude Code, Claude Desktop and Cursor and shows you exactly which files it will
change and which MCP servers it will start to vet them. Only after you agree does it vet the
servers, back up your configs and wire everything in observe mode: firewall rules log what
they would block until you say so, while the read guard (it asks before an agent reads sensitive
files) and self-protection work from the start. --dry-run shows the plan and starts nothing. gatehouse uninstall puts it all back.
What you get
| 🔎 Vet | before a server runs | Every MCP server is started in a sandbox with decoy credentials, and the tool definitions the model would read are checked for prompt injection, hidden text, credential-fishing parameters and impersonated tool names. What it saw is locked, so a server that changes after you approved it — a rug-pull — shows up in gatehouse verify --all. |
| 🧱 Firewall | on every tool call | Policy and data-loss prevention on every call and result: block curl … | sh, stop an AWS key from leaving in a GitHub issue, redact credentials out of tool output before the model sees them. Claude Code is covered through its hooks (built-in and MCP tools); Claude Desktop and Cursor through an MCP gateway. |
| 🛡️ Read guard | before a file is read | When Claude Code is about to read a file full of Social Security numbers, card numbers, private keys or patient data, you are asked first — with a summary of what kinds of data it holds, never the values. |
| 📜 Audit | always | A hash-chained log of every decision, which gatehouse audit verify can prove was not edited. Secret values never appear in it. |
| 🔒 Self-protection | always | The agent cannot edit gatehouse's config, its hooks or its audit log, and cannot run gatehouse setup, uninstall or mode itself — in observe mode too. |
Everything is deterministic and local: no AI judges another AI, nothing is sent anywhere.
Day to day
gatehouse status # wiring, mode, last vet results, audit health — one screen
gatehouse report # what the firewall saw, and what it would have stopped
gatehouse mode enforce # start blocking (and `gatehouse mode observe` to go back)
gatehouse scan --all # vet every server, e.g. after installing a new one
gatehouse verify --all # has any server changed since it was vetted?
gatehouse scan --all --accept-changes cursor/notes # after reviewing a change: new baseline
gatehouse uninstall # remove everything setup added, restore your configs
A sensible rollout: run a few days in observe mode, read gatehouse report, then
gatehouse mode enforce.
A server that changed since it was vetted is reported as CHANGED by both scan --all and
verify --all — with what its descriptions said before and say now — and its old baseline is
kept until you accept the change: re-scanning never quietly forgets a rug-pull. A server you add
to Claude Desktop or Cursor after setup shows as PARTLY protected in status; run
gatehouse setup again to move it behind the firewall. Servers from a repository's .mcp.json are vetted only once you
have approved them in Claude Code, so running gatehouse inside a cloned repo starts nothing new.
When gatehouse asks or blocks
- The read guard asks before an agent reads a file that holds sensitive values (SSNs, card
numbers, keys — not files that merely mention them). Answer in Claude Code's prompt; a yes
covers that file for the rest of the session unless it changes. Folders you never want asked
about (test fixtures, say) go in
~/.config/gatehouse/dlp-policy.toml:[read_guard] allow = ["~/code/myapp/tests/fixtures/**", "*.sample"]
- A firewall rule blocks or asks (enforce mode) — the message says which rule and why.
Rules live in
~/.config/gatehouse/claude-code.yaml; edit it yourself, thengatehouse gateway validate -c ~/.config/gatehouse/claude-code.yaml. If you edit it into a state that does not load, gatehouse keeps using the last version that did andstatussays so. - Test data blocked from being written — values like
AKIAIOSFODNN7EXAMPLE, test card numbers and un-issuable SSNs are never blocked. For your own fixtures, list their folders underdlp.exempt_pathsin the firewall config. (Exempt paths cover what the agent writes; what it reads is still masked, so an exempt folder can't become a way to read a copied secret.) - Masked output — when the firewall masks values in what a tool returns, the agent is told how many, and that the file on disk is unchanged.
- "… is not allowed from the agent" — self-protection. Changes to Claude Code's settings that keep gatehouse's hooks just ask you; ones that would remove them, and any change to gatehouse itself, are yours to make in a terminal.
Other commands
| Command | |
|---|---|
gatehouse scan <command or URL> |
vet one server before you install it (--format json|sarif for CI) |
gatehouse classify <file…> |
what the read guard thinks of a file |
gatehouse audit verify|query|replay |
inspect the audit log |
gatehouse gateway run|validate|import|auth|emit-config |
run or hand-configure the MCP gateway |
gatehouse <command> --help has every option. Deeper documentation for each component —
detectors, policy language, DLP patterns, rule packs — is in docs/components/.
To vet a remote MCP server that needs a token, set GATEHOUSE_AUTH_TOKEN and run
gatehouse scan <url>.
Where things live
~/.config/gatehouse/ holds the firewall config per client (claude-code.yaml,
claude-desktop.yaml, cursor.yaml), the read-guard policy (dlp-policy.toml, optional — see
examples/dlp-policy.toml.example), the audit log, vet
results and locks (vet/), and backups of every file setup changed (backups/). The firewall
configs hold your MCP servers' own environment (tokens included) once setup routes them, so the
directory is private (0700) and the agent is not allowed to read it without asking.
Limits — read these
- Field-tested in observe mode, with Claude Code. gatehouse has run on a working machine in
observemode.enforcemode, the gateway for Claude Desktop and Cursor, and Linux are covered by the test suite but not yet by sustained real use. Start inobserve, readgatehouse report, then switch. - Vet "pass" means no known pattern matched, not that a server is safe. A paraphrased instruction gets past pattern matching; the firewall and audit log are the next line.
- The vet sandbox is strong on macOS only (
sandbox-exec). On Linux a server under scan gets a scrubbed environment, a fake home and time limits, but no filesystem or network confinement — and a warning saying so. - Self-protection is exact for file tools; for shell commands it only catches paths
spelled out in full.
rm -rf ~/.config/gatehouse,sed -i … ~/.config/gatehouse/…,gatehouse mode …anduv tool uninstall agent-gatehouseare blocked, including insidebash -c '…'. Changing directory first (cd ~/.config && …), globs (~/.config/gate*), wrappers (env,sudo), commands aimed at a parent directory (rm -rf ~/.config), pipes intoxargsand paths built at run time all get past it; the audit log records the call. Following the shell further was tried and set aside: every step closed some bypasses and blocked ordinary work, and self-protection blocks in observe mode too. A command over 128 KB is asked about. - If the
gatehouseprogram disappears, every check stops. Claude Code lets a tool call through when a hook's command is missing. Self-protection blocks the agent from deleting or replacing it by name, but not by the routes above;gatehouse statusreports it. Install it withuv tool install, outside any project the agent works in. - The read guard checks
ReadandGrepof a single file before they run. AGrepover a whole directory, orcatin a shell, is not pre-checked — there the firewall's redaction of the result (SSNs, card numbers, keys) is the backstop. Text past the first million characters is not classified, and a file that takes longer than 5 seconds to classify is let through unchecked. PDF, Word and Excel files are only looked inside with thefullextra (uv tool install 'agent-gatehouse[full]'). - Secret detection matches values as they are written. A secret that is base64-encoded, or split across arguments or calls, is not recognised. Invisible characters inside a value are ignored, so they do not hide it.
- A damaged audit log is never reported as intact, but when the chain is recovered after
corrupted lines,
audit verifycannot tell how many events those lines replaced. Deleting events from the end of a log is only detectable against a head you recorded elsewhere. WithGATEHOUSE_AUDIT_KEYset, every event is also signed, so none can be rewritten without the key (a keyed log from before 0.5.0 signed events will not verify; archive it). The log is never rotated: move it aside when it gets large, and a new one starts. - Where Claude Code cannot ask you, gatehouse blocks instead. In
auto,dontAskandbypassPermissionsmodes Claude Code approves a hook's question without showing it to you, and non-interactiveclaude -pruns deny it; so a read the read guard would ask about is blocked, with the exactgatehouse allow <path>command to run if you want agents to read it. - Cursor runs through the gateway; its support is not yet verified against Cursor itself.
For maintainers: the benchmark
bench/poison-garden/ is a corpus of deliberately malicious MCP servers for measuring MCP
scanners — including gatehouse's own vetter. It is a separate package that is never installed
with gatehouse and never imported by it: its value depends on independence from the scanner it
measures. Read its README (especially Safety) before running anything there.
Development
uv sync --all-packages
uv run pytest # suite
uv run ruff check .
(cd bench/poison-garden && uv run --package poison-garden pytest)
scripts/ci-local.sh runs everything CI runs (suite, bench and corpus checks on Python 3.12 and
3.13) on your machine; --quick is the fast inner loop, --linux adds a Linux run in Docker. CI
runs the same checks on GitHub for every push to main and every pull request.
On macOS, keep the virtualenv outside an iCloud-synced folder (iCloud re-hides the .pth files an editable install depends on).
gatehouse merges four earlier projects — frisk, tollbooth, claude-dlp-guard and poison-garden — into one install. MIT licensed.
Found a way past gatehouse? Please report it privately; see SECURITY.md.
Metadata
Release files for agent-gatehouse 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_gatehouse-0.5.0.tar.gz | 269.4 kB | With provenance | Details for agent_gatehouse-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_gatehouse-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for agent_gatehouse-0.5.0-py3-none-any.whl |
Total release size: 542.6 kB
Release files / agent_gatehouse-0.5.0.tar.gz
| Download URL | agent_gatehouse-0.5.0.tar.gz |
|---|---|
| Size | 269.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9dc5e5b627eb18442388f614fcfde1159427c742ff783d865279f5736ba02ee
|
|
BLAKE2b-256 checksum How to use checksums |
820ac495ab2b867959e2cbb55beef668b2ad66c146726be7bcd20237c947f79d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logRelease files / agent_gatehouse-0.5.0-py3-none-any.whl
| Download URL | agent_gatehouse-0.5.0-py3-none-any.whl |
|---|---|
| Size | 273.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2103cffe888c29fd652c57e4e46771c750c873b7e95bded64a4a5ce6b02eecfc
|
|
BLAKE2b-256 checksum How to use checksums |
839778e2a8e4e8484c35e92e3c622ab306d814ee7d0abe81c844099c0209d20a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logSecurity for agent-gatehouse 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_gatehouse-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.