An MCP-native dataflow firewall for AI agents.
iptables for agentic tool use.
Agents often treat web pages, emails, files, tickets, and tool output as if they were trusted instructions. A hidden prompt injection in that content can then steer the agent into sending email, writing files, deleting data, or making network calls. Palizade sits between an MCP client and its MCP servers, tracks where data came from, and stops untrusted data from driving sensitive actions.
Runs locally on Windows, macOS and Linux. Requires Node.js 22.13 or newer.
Palizade is a research preview built by one student. Here is what has been shown so far and what has not.
What it does. It remembers where text came from. When text from a web page, an MCP server or a file outside your workspace later shows up in a tool call that sends data out, runs code or changes a sensitive file, Palizade blocks the call or asks you first. It works as a proxy in front of MCP servers and as hooks for the built in tools of Claude Code, Cursor, Codex and Gemini CLI, including PowerShell on Windows.
What has been shown.
- A scripted regression set of 50 attacks and 25 benign cases. With the default policy none of the 50 attacks succeed, even if every approval prompt is granted. One benign case out of 25 gets an approval prompt and none is blocked. The strict policy blocks 8 of the 25 benign cases and prompts on all 25. These cases were written alongside the rules, so treat them as a regression check and not as a benchmark. Run
pnpm eval:asr. - A scripted replay of AgentDojo, shown in the table below. It replays a fixed agent that always obeys the injection. No language model is involved. With approvals refused, none of the 949 scripted attacks get through and 74 of 97 clean tasks still complete. If a user grants every approval prompt, 71 of the 949 get through.
- Live runs in Claude Code on Windows with a local test page, a fake key and a local collector. With Palizade off, the model followed a setup step on the page and sent the fake key to the collector. With Palizade on, nothing reached the collector in any run. On the first version of the page the model never tried the upload, because Palizade's earlier blocks and prompts reached it first and it held back. The page was then set up so the upload is the first shell step. On that page, in two of four runs the model issued the upload command and Palizade denied it. In the other two the model did not try. That is four runs on one model, so it shows the block happening and says nothing about how often. See the run notes and the demo folder.
- Reviews by a second model after each round of changes. Each review found real problems. The findings that had to be fixed were fixed, and what was left open is in the limits below.
What has not been shown.
- No benchmark run with a live model. The harness for one is in
eval/agentdojo/liveand has only been run against a scripted stub. - No measurement against attackers who know how Palizade works and adapt to it.
- The test suite runs in CI on Linux, macOS and Windows, while the hooks have only been tried in a real client on Windows.
Limits you should know before relying on it.
- Palizade runs as you, and so does the agent. It is built to stop an agent that was misled by something it read. It is not a sandbox against a process that sets out to defeat it. An agent that tries can delete the hook settings, edit state files, or approve its own request through the local approval page. The policy asks before the obvious forms of this, and a seal can pin the policy files, but none of that holds against a determined process running under your account.
- It tracks copied text and recorded destinations. Text that the model rewrites in its own words is only caught by the weaker timing rules, which ask for a few turns after untrusted content was seen.
- A command copied from a page is blocked, with one exception. A single plain command from a short list of test, lint and inspection commands asks first. The list is in copied-commands.ts. A test command runs whatever code is in the workspace, so the prompt says its scripts were not checked. A chained command is blocked even when each part is on the list, and the same test command asks again each time while the page is still remembered. After a page that scores as a strong injection, even listed commands are blocked for a while. A short command that the page only mentions inside a sentence is often not recognized as copied at all and then runs like any command the agent typed. The strict and coding agent policies block every copied command without asking. This is the main cost in daily use, and you will notice it right after the agent reads documentation from the web.
- When outside text is written into a workspace file and Palizade recognizes the text, the next command that can run code asks once. A command that names the written file is blocked. Text written in pieces too short to match is not recognized. That works as described in Claude Code. Codex and Gemini CLI cannot show a prompt from a hook. There, after outside text is written into a code or build file, commands that run code are blocked for up to 15 minutes. After it is written into any other file, only a command that names that file is blocked. Cursor does not report file writes to hooks, so the rule does not apply there.
- Shell commands are read with pattern rules, not a real shell parser. This is a best effort layer on top of the provenance tracking, which is the main idea. Unusual spellings of a host or a path can be missed, for example a host inside a UNC path.
- Very long tool results are only partly fingerprinted. Palizade then falls back to asking for a while after such a result arrives from outside the workspace.
- Inside your workspace, files you read are tracked lightly by default so that normal read, edit and test work is not interrupted. Files that the agent downloads, clones or unpacks during the session are treated as outside text when Palizade recognizes the command. A repository you cloned yourself before the session, or a file fetched by a script, is trusted like the rest of the workspace. Set
hooks.readTaint: allwhen you look at a repository you do not trust.
The longer list is under What Palizade Does Not Protect.
npm currently serves Palizade 0.3.2. The features below are in the unreleased 0.4.0. Run these commands from the root of a source checkout with pnpm installed.
pnpm install --frozen-lockfile --ignore-scripts
pnpm build
node packages/cli/dist/index.cjs --versionSave the absolute path to the built CLI, then run setup from the folder where you want palizade.yaml to live. Use node and the same CLI path for the other palizade commands below.
palizade_cli="$PWD/packages/cli/dist/index.cjs"
mkdir -p ~/.palizade-home && cd ~/.palizade-home
node "$palizade_cli" setup claude-code --lock # or claude-desktop, cursor, codexIn Windows PowerShell, run these commands from the root of the source checkout after building.
$palizadeCli = (Resolve-Path 'packages/cli/dist/index.cjs').Path
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE/.palizade-home" | Out-Null
Set-Location "$env:USERPROFILE/.palizade-home"
node $palizadeCli setup claude-code --locksetup creates palizade.yaml with the default policy if there is none, wraps supported MCP servers in the client's config, installs the native tool and prompt hooks, and with --lock starts each newly wrapped server once to approve its tool list. Use --dry-run to preview changes or --project to keep the MCP and hook settings in the workspace. Restart the client afterwards.
Start with palizade init, which writes palizade.yaml and a default policy in the current folder. Then pick your client. Each install-config --all run rewrites the client's MCP entries to go through Palizade, copies the original servers into palizade.yaml as trust: untrusted, and keeps a .bak of the client file. Add --dry-run first to see the change.
Claude Desktop
palizade install-config --allFully quit and reopen Claude Desktop.
Claude Code
palizade install-config --all --client claude-code # user servers in ~/.claude.json
palizade install-config --all --client claude-code --project # this repo's .mcp.json
palizade install-hooks claude-code # also cover Bash, Read, Write, WebFetchServers added with plain claude mcp add use the local scope, which belongs to one directory. Run this from that directory to wrap them:
palizade install-config --all --client claude-code --localClose Claude Code before running these, since it also writes ~/.claude.json.
Cursor
palizade install-config --all --client cursor # ~/.cursor/mcp.json
palizade install-config --all --client cursor --project # this repo's .cursor/mcp.json
palizade install-hooks cursorCodex
palizade install-config --all --client codex # ~/.codex/config.toml (or $CODEX_HOME)
palizade install-config --all --client codex --project # this repo's .codex/config.toml
palizade install-hooks codexOnly the [mcp_servers.<name>] tables of wrapped servers are rewritten; the rest of the file, comments included, is left alone, and per tool settings such as approval_mode are kept. Variables the server needed (env_vars, bearer_token_env_var, env_http_headers) are forwarded to Palizade.
Gemini CLI
palizade setup gemini # or: palizade install-hooks geminiAdds BeforeTool, AfterTool and BeforeAgent hooks to ~/.gemini/settings.json. Gemini's MCP servers are not rewritten; their calls (mcp_<server>_<tool>) are checked by the hook, as are run_shell_command, write_file, replace and web_fetch. Gemini hooks cannot ask, so a call that needs approval is denied with a note saying so; Codex is handled the same way, because Codex runs the tool when a hook answers "ask".
Any other MCP client that launches stdio servers: use palizade wrap <server> -c /absolute/path/to/palizade.yaml as the server command.
Finally, approve each server's current tool list and check coverage:
palizade lock approve <server> # install-config prints these for you
palizade doctor --client <name> # shows which servers and tools are protectedPlaceholders in imported entries keep working: ${NAME} and ${NAME:-default} (Claude Code) and ${env:NAME} (Cursor) are filled from your environment when Palizade starts the server or connects to its url. A header whose variable is unset is left out; a url whose variable is unset is an error. Remote servers with no static credentials are skipped, because they usually sign in with OAuth, which the stdio wrapper cannot do. In Claude Code and Codex the hooks cover them instead: install-hooks matches mcp__* tools, so calls to servers Palizade does not wrap (such as a Linear, Notion or Atlassian remote) are checked against the shared taint store as trust: untrusted (hooks.mcpTrust), recognized by the catalog from the client's own config, while wrapped servers are left to their proxy. Pass --include-remote to wrap a remote that needs no sign in. Servers using the legacy sse or ws transports are skipped with a message, since Palizade proxies stdio and Streamable HTTP only.
AgentDojo v1.2.2 with the important_instructions attack, replaying each suite's scripted ground truth (an agent that does the user's task and then fully obeys the injection) through the default preset with every tool untrusted, and refusing every approval prompt:
| Clean utility | Attack success | |
|---|---|---|
| No defense | 97/97 (100%) | 593/949 (62.5%) |
| Palizade, first run (held out) | 67/97 (69.1%) | 42/949 (4.4%) |
| Palizade, after reviewing two suites | 68/97 (70.1%) | 11/949 (1.2%) |
| Palizade, with your prompt's destinations and a credential change rule | 74/97 (76.3%) | 0/949 in this replay |
This is a replay, not an LLM run, and the utility cost is real: tasks that send to an address read from untrusted content are blocked like attacks, unless you typed that address yourself. The last row's credential rule was found by looking at banking traces, so only the travel suite is still unseen; zero means none of these scripted attacks got through, not that every injection is stopped. Method, per suite numbers, approval modes and limits: results/agentdojo. Reproduce with pnpm eval:agentdojo.
First live pilot (Qwen3 8B; 10 clean tasks and 98 attacked runs, not a full benchmark). With the default policy, executed attacks on the three inspected suites fell from 11 of 84 to 0 of 84 with approvals denied (1 of 84 with approvals granted). Clean task completion fell from 5 of 8 to 3 of 8, and on the held out travel suite Palizade completed 0 of 2 clean tasks against 2 of 2 undefended. On the inspected suites, the cause is over blocking: Palizade blocks legitimate actions that take a link or payee from tool output, which is also how these attacks work. The 8B model rarely followed the injections, and a rerun showed run to run variance as large as the differences between configs, so these results show the utility cost more clearly than attack prevention. See the raw results.
MCPTox (AAAI-26) hides instructions in the description of an extra tool so the model misuses the server's other tools. Replaying the tool calls real models made in that benchmark, with every tool classified:
| Attacks stopped | Normal calls stopped | |
|---|---|---|
| Without tool description taint | 10/1347 (0.7%) | 24/4997 (0.5%) |
| With it (default now) | 331/1347 (24.6%) | 80/4997 (1.6%) |
Under the shipped default, which blocks tools it cannot classify on untrusted servers, the same replay stopped 1313/4997 (26.3%) normal calls; classifying more tools from their names and schemas brings that to 1028/4997 (20.6%), and to 676/4997 (13.5%) when the replay also gives each tool's description and arguments. Attacks stopped under the default fall too, from 689 to 553 of 1347, because many were stopped only by blocking every unclassified tool. See results/mcptox/classification and palizade learn --session <id> --write to classify the rest.
Spotting poisoned descriptions by their wording catches only 0.8%, since they read like ordinary instructions; what helps is treating values written in an untrusted server's tool descriptions as untrusted data. Most attacks still allowed only change a read or search parameter, which moves no data out. Details and how to reproduce: results/mcptox.
Palizade's core control is provenance, not content classification. Data returned by untrusted or source-classed tools is tagged as tainted. If that data later appears in a sink tool call, such as write, send, delete, shell, publish, or network egress, policy can block it, redact it, log it, or require user approval.
That means Palizade can block on provenance alone. A page or email does not need to contain obvious malicious text. If untrusted content flows into a privileged sink, the flow is visible to policy.
MCP client
|
| JSON-RPC over stdio
v
Palizade proxy
| tools/list hash + lock + scan metadata
| tools/call request classify tool + check taint into sinks
| tools/call response scan + register provenance/taint
| sampling/* deny or approval-gate server model access
v
Upstream MCP server
- Shared SQLite provenance for tool, resource, prompt and sensitive-origin content, with hidden-Unicode normalization, identifier/host skeletons and bounded decoded sink views.
- Sink checks for copied destinations, URL/host/email and tool-specific IDs, known-host lookalikes, sensitive egress and split outbound payloads.
- Persistent memory/vector provenance after approved writes, plus explicit pruning.
- Rule of Two, quarantine, rate and loop gates shared across wrapped processes; optional session destination grants.
- Critical filesystem targets, traversal/symlink checks and bounded escaped, masked approval diffs.
- Metadata locks, faithful lock diffs, dangerous-default detection and cross-server tool collision/shadowing checks.
- Dual-era stdio and Streamable HTTP, including a stdio bridge for remote servers and a protected local listener.
- Native client hooks and optional sandboxed stdio launch.
- Seven YAML presets, terminal/localhost approvals, payload-masked audit logs, optional counter metrics, hot reload, policy validation, status and draft learning commands.
Detection remains a signal: pattern-based secret/PII recognition and observable matching do not provide complete semantic DLP. See known limits, architecture and detector coverage.
Wrap one configured server:
palizade install-config filesystem
palizade lock approve filesystemOr wrap every unprotected MCP server in the client config at once:
palizade install-config --all --dry-run
palizade install-config --allinstall-config --all reads the MCP client's config, skips entries already routed through Palizade, rewrites the remaining entries in place, and adds each upstream server command to palizade.yaml with trust: untrusted. It prints the palizade lock approve <server> commands to run next instead of auto-starting arbitrary servers.
Before:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/path/to/workspace"]
}
}
}After palizade install-config filesystem:
{
"mcpServers": {
"palizade-filesystem": {
"command": "/absolute/path/to/node",
"args": [
"/absolute/path/to/palizade/dist/index.cjs",
"wrap",
"filesystem",
"-c",
"/absolute/path/to/palizade.yaml"
]
}
}
}Restart the MCP client after changing its config.
Verify with the real filesystem MCP server:
pnpm smoke:filesystemThat smoke uses the official @modelcontextprotocol/server-filesystem server and covers initialize, ping, client notifications, server roots/list requests, tools/list, a real read_text_file call, and a large payload.
Palizade's ASR harness replays a stratified sample of InjecAgent cases as mock MCP source responses and sink calls. No model runs in this check. Every sink call is scripted, so the table shows what the policy does when an agent fully obeys the injection. pnpm eval:asr generates the table. Results and metric definitions.
| Category | Measure | Off | Default | Strict |
|---|---|---|---|---|
| Direct injection | ASR with approvals denied | 15/15 (100%) | 0/15 (0%) | 0/15 (0%) |
| Direct injection | ASR with approvals granted | 15/15 (100%) | 0/15 (0%) | 0/15 (0%) |
| Direct injection | Attacks needing approval | 0/15 (0%) | 0/15 (0%) | 0/15 (0%) |
| Indirect/tool injection | ASR with approvals denied | 25/25 (100%) | 0/25 (0%) | 0/25 (0%) |
| Indirect/tool injection | ASR with approvals granted | 25/25 (100%) | 0/25 (0%) | 0/25 (0%) |
| Indirect/tool injection | Attacks needing approval | 0/25 (0%) | 0/25 (0%) | 0/25 (0%) |
| Encoded/obfuscated | ASR with approvals denied | 10/10 (100%) | 0/10 (0%) | 0/10 (0%) |
| Encoded/obfuscated | ASR with approvals granted | 10/10 (100%) | 0/10 (0%) | 0/10 (0%) |
| Encoded/obfuscated | Attacks needing approval | 0/10 (0%) | 0/10 (0%) | 0/10 (0%) |
| Total attacks | ASR with approvals denied | 50/50 (100%) | 0/50 (0%) | 0/50 (0%) |
| Total attacks | ASR with approvals granted | 50/50 (100%) | 0/50 (0%) | 0/50 (0%) |
| Total attacks | Attacks needing approval | 0/50 (0%) | 0/50 (0%) | 0/50 (0%) |
| Benign | Hard blocked with approvals granted | 0/25 (0%) | 0/25 (0%) | 8/25 (32%) |
| Benign with a sink call | Hard blocked with approvals granted | 0/8 (0%) | 0/8 (0%) | 8/8 (100%) |
| Benign | Disrupted with approvals denied | 0/25 (0%) | 1/25 (4%) | 25/25 (100%) |
| Benign | Any approval prompt | 0/25 (0%) | 1/25 (4%) | 25/25 (100%) |
Default and strict each hard blocked all 50 attacks. Default hard blocked 0 of 25 benign runs and prompted on 1. Strict would still hard block 8 of 25 benign runs with approvals granted, including all 8 with a sink call. Strict prompted on all 25 benign runs, so denying approvals would disrupt all 25.
Of 225 replays, 108 ended in a hard block. The model refusal label is for runs with no sink attempt, no hard block and no prompt, and 0 runs received it, which is expected because the sink calls are scripted. Replay verification checked 11 runs and found 0 mismatches.
The fixtures use seed 424242 and InjecAgent snapshot f19c9f2c79a41046eb13c03c51a24c567a8ffa07. These rates describe the same sample that exposed a bug in taint fingerprint alignment. A separate test covers the winnowing fix. InjecAgent, Zhan et al., ACL 2024 Findings, fixture notes, alignment test.
Run the local demos after pnpm build:
| Command | What it proves |
|---|---|
pnpm demo:cross-server |
Fetch-like source content taints one wrapped server, then a Gmail-style sink is blocked in another wrapped server. |
pnpm demo:benign-block |
Benign-looking source content with no injection text is blocked from entering write_file on provenance alone. |
pnpm demo:secret-block |
A detected fake AWS credential is registered as sensitive taint and blocked before message egress. |
pnpm demo:pii-redact |
PII in outbound email arguments is redacted and the sanitized call is forwarded. |
pnpm demo:egress-allowlist |
Tainted content is blocked to evil.com but allowed to a configured good.com destination. |
pnpm demo:email-block |
A mock read_message source taints email content and send_email is classified as a sink and blocked. |
Example audit shape:
... block request claude_fetch_demo post_data rule=block-tainted-sink taint=...
Tainted content is flowing into a sink tool.
Example client-facing block result:
Palizade blocked this tool call. Rule: block-tainted-sink. Reason: Tainted content is flowing into a sink tool. Tool: send_email. This action was prevented by your local Palizade security policy.
palizade taint prune skips persistent memory provenance. palizade taint prune --include-persistent explicitly removes persistent records in the current profile as well as expired normal records. Approved tainted memory writes have no provenance TTL; later reads retain the original source in audit metadata.
Inspect quarantine with palizade session quarantine; clear it explicitly with palizade session quarantine --clear [--session <id>]. This clears quarantine only; seen-sensitive/untrusted flags and hard blocks remain active. High-score responses and blocked tainted/split/lookalike destinations quarantine the session; enforcing presets approval-gate subsequent sinks until expiry or operator clearance.
Exposure flags expire after taint.exposure.ttlMs (default 7200000, two hours), refreshed on each new untrusted or sensitive exposure. Native hooks isolate flags, quarantine, grants and counters by the client's session_id (Cursor's conversation_id), while profile-scoped taint records remain shared. palizade session reset [--session <id>] clears session flags, quarantine, grants and counters without deleting taint records. With --session, reset/quarantine target that native client session; without it, they target the configured wrapper profile/run scope.
Check local config and MCP coverage:
palizade doctor
palizade doctor --client-config "C:\Users\you\AppData\Roaming\Claude\claude_desktop_config.json"doctor lists every configured MCP server and reports whether it is protected by Palizade or still a blind spot.
Inspect decisions:
palizade -c /absolute/path/to/palizade.yaml audit --last 15m
palizade -c /absolute/path/to/palizade.yaml audit --last 1h --action blockOperate a running setup:
palizade status [--json]shows each server's transport, configured and last seen protocol era, lock state and sandbox; the policy file and hash; taint record counts (normal and persistent); quarantined sessions; sessions where the Rule of Two is armed (untrusted and sensitive content both seen); and the last 10 blocks.palizade policy check [file]validates a policy before you deploy it: schema and unknown keys (with a "did you mean" hint), rules that can never run because an earlier rule matches everything, conditions that can never be true (labels_any: [],detector_score_gteabovedetector_score_lt, an invalidargument_regex), andserverortoolnames that are not inpalizade.yamlorpalizade.lock. It exits 1 on errors, and on warnings too with--strict.palizade learn --since 7dprints draft classes and allowlist entries from audit and ranks unknown tools by calls that did not proceed.--session <id>limits it to one session. Check these tools withpalizade tools <server>, which shows configured and catalog argument roles alongside suggestions from locked schemas.learn --writeadds proposed classes based on approved tool snapshots after terminal confirmation, keeping comments and writing a.bakfirst. Review argument roles before adding them topalizade.yaml.- Edits to
palizade.yaml, the policy file andpalizade.allow.yamlare picked up by runningwrapandserveprocesses within about a second. An invalid edit is rejected: the previous version keeps running, the failure is audited and printed on stderr with the YAML path and a fix hint. Turn this off withreload: { enabled: false }; change the poll interval withreload.intervalMs. - For SIEM ingestion,
metrics: { jsonl: .palizade/metrics.jsonl }writes one line per decision with counters only (no payloads), rotating atmetrics.maxBytes(default 64 MiB).
Common Windows and client gotchas:
- Desktop clients may spawn MCP servers without inheriting your shell
PATH.install-configwrites an absolute Node path and an absolute Palizade CLI path to avoid.cmdand.ps1shim issues. - If Palizade is launched from a different working directory, pass
-c <absolute path to palizade.yaml>. - Claude Desktop stores MCP config in
claude_desktop_config.json. - Claude Code uses
.claude.json/claude mcp add; itsclaude mcp addparsing can mis-handle-c, so use a.cmdwrapper that pins the config path, as shown in examples/claude-code-fetch-demo.md. - For headless clients, use
approvals.mode: localhost. If the browser does not open, use the inbox link printed where you launched Palizade or saved in~/.palizade/run/<config hash>/pending-approval.url. - If the model reports a tool failure that begins with
Palizade blocked this tool call, the upstream tool is not broken. Palizade returned an MCPisErrorresult because policy blocked the action.
If doctor says no config exists:
No palizade.yaml found in current directory. Run 'palizade init' first, or pass -c <path>.
- Palizade only guards traffic through MCP servers it wraps, plus native tool hooks where
palizade install-hooksis installed (Claude Code PreToolUse, PostToolUse and UserPromptSubmit, Cursor shell and MCP events before and after execution, Codex and Gemini CLI tool events before and after execution). Native tools without installed hooks remain unprotected, and shell parsing is heuristic — it extracts URLs, hosts, redirect targets, and suspicious constructs but is not a shell parser. - It does not protect against a malicious MCP client or a compromised host OS.
- Pattern-based secret and PII detection misses obfuscated, split, transformed, or custom secrets. See docs/detector-coverage.md.
- Taint matching uses observable fragments/tokens, lightweight SimHash and temporal evidence. Rule of Two gates paraphrased remote/memory actions after both exposure flags are set; it does not provide unrestricted semantic matching.
- Outbound windows are process-local. Splits across wrapper/hook processes or independently padded encoded shards can evade concatenation; the later adaptive evaluation must measure these cases.
- Critical paths are checked against the local filesystem at decision time. They do not enforce a malicious server's actual I/O or prevent subsequent symlink races. Unknown edit formats cannot produce a complete approval diff.
- Client-rendered side effects such as automatically fetched Markdown images are outside observable proxy/hook traffic.
- Input-required gating currently covers tool results; prompt and resource input-required handlers, full discover schemas, structured string constraints, and parameter header checks for unknown tools remain limited. The integration report distinguishes these gaps from tested behavior.
- Substring fingerprints cover all of a tool response up to about 17 KB; for longer responses they cover the first and last 8 KB or so. Text copied from the middle of a long response is caught only by token, fuzzy, or temporal matching. Urls, email addresses and other tokens are extracted from the whole response. When such a long response comes from outside the workspace, Palizade also asks before sink calls for a while afterwards.
- The in sample benign corpus is small and synthetic: 17 of its 25 fixtures contain no sink call and cannot produce a false positive. The AgentDojo replay is the better utility measure, and shows the real cost: a task that sends to an address it read from untrusted content is blocked like an attack.
- Streamable HTTP is supported for both protocol eras: POST SSE notifications and legacy server requests from upstream are inspected for taint and policy and relayed in order when the client accepts
text/event-stream; clients requesting JSON only receive the final response while inspection, audit, and taint recording still run, and POST stream resumption is not supported. - The listener gives legacy clients distinct MCP sessions. Stateless clients without a session ID get request-local replies and share policy state if they use the same endpoint and upstream credentials. Use distinct credentials or listener instances to separate that state. See HTTP session routing.
- Tool name collision and shadowing checks only compare servers wrapped by Palizade that share one state directory, and only from the moment each server has answered
tools/list. The server that lists a shared name first keeps it until that server restarts; after that both copies are withheld until one is renamed or removed frompalizade.yaml. - Sandboxing is opt-in and limited by its backend. A network
allowlistis only enforced with seatbelt, or with docker plus asandbox.dockerNetworkinternal network; other combinations are refused unless you setadvisoryNetwork: true, in which case the server could ignore the proxy; seatbelt restricts writes and network but not reads; Palizade does not sandboxurlservers or the client itself, and it does not harden the docker daemon or the image you choose. - Hot reload only applies settings the interception engine reads per message (policy, egress allowlist and mode, limits, trust, tool classes and other per-server classification). Changes to stores, sinks, detectors, transport or the upstream launch are reported and need a restart. A message already being processed when a reload lands may evaluate its later rules against the new policy.
palizade learnoutput is a starting point built from what was observed, not a reviewed policy.
These are scope boundaries, not footnotes. Palizade is strongest when sensitive capabilities are exposed through wrapped MCP servers and policy is reviewed for each server.
In scope:
- Tool poisoning through malicious or compromised
tools/listdescriptions. - Indirect prompt injection through tool responses such as pages, issues, PR comments, emails, files, and docs.
- Rug pulls where tool descriptions or schemas change after approval.
- Exfiltration or side effects caused by tainted content flowing into sink tools.
- MCP privilege escalation through server-initiated model access.
Out of scope:
- Native client tools without installed hooks.
- Host compromise.
- Malicious clients that bypass or tamper with the proxy.
- Complete semantic DLP, arbitrary memory rewriting, or unobserved side effects.
For depth, read docs/architecture.md, docs/policy.md, and docs/detector-coverage.md.
Policies are YAML documents with first-match-wins semantics:
version: 1
defaults:
action: allow
on_error: block
rules:
- id: block-tainted-sink
when:
direction: request
method: tools/call
tool_class: sink
taint: true
action: block
reason: Tainted content is flowing into a sink tool.Preset guidance:
| Preset | Use it when |
|---|---|
policies/audit-only.yaml |
You want to observe what Palizade would flag without enforcement. |
policies/interactive.yaml |
Opt-in approval for legitimate tainted sink calls, including eligible destinations. A destination approval applies once to the displayed call and values. |
policies/default.yaml |
Hard-block general copied-content sinks, with explicit memory approval and session gates. Workspace edits with outside text are allowed and gated at the next code run. A copied command from the short list asks. |
policies/strict.yaml |
You want stricter metadata, output, unknown-tool, taint, and egress enforcement. |
policies/egress.yaml |
You want the default posture plus opt-in secret/PII outbound controls. |
policies/coding-agent.yaml |
Add shell and tainted critical-write protection to default. |
policies/research-readonly.yaml |
Confine side effects to one configured output directory. |
Notes on policies/interactive.yaml (opt-in):
- Destination approval uses argument roles. Common examples are
to, names containingrecipientoremail, and URL fields such asurlorendpointthat contain barewww.links. Bare values in fields such aspayee,iban,accountorlinkneed a destination role from the tool catalog orargumentRolesunless the value itself is recognized. Other tainted fields follow the usual sink rules. - Lookalikes, ambiguous URL authorities, and tainted destinations in sessions that have read sensitive data block. A read counts as sensitive only when its server or tool is marked sensitive (
sensitive: true,sensitiveTools), its path matchessensitivePathPatterns, its tool reads secrets by catalog or name, or an enabled detector fires. Private data from tools that are not marked, such as an inbox, transactions or a calendar, can leave through an approved prompt; mark those tools sensitive to keep the block. Code execution, credential access, account-security changes with unknown capabilities, tool-description taint, deletion, and canary egress also have blocking rules. An outbound query blocks when its query text matches taint. Detected secrets block alongside tainted destinations whendetectors.secrets.enabledis on. - The prompt shows parsed hosts, amounts and source, followed by quoted paths and bounded values for both the tainted destination and the content being sent. Proxy destination prompts deny when no human can answer or when they time out. A denial starts quarantine. Claude Code starts quarantine as soon as it receives the prompt, so later outbound calls can prompt for up to 20 calls or 30 minutes even after approval. Cursor, Codex and Gemini CLI hooks deny these destination prompts. Whether Claude Code's own “always allow” option can persist a Palizade ask is untested.
- In the scripted AgentDojo replay on workspace, banking, and Slack, denying every prompt gave
56/77clean utility,604/809utility under attack, and0/809attack success for bothdefaultandinteractive. Granting every prompt gave77/77,553/809, and469/809(58.0%) forinteractive, compared with63/77,624/809, and71/809(8.8%) fordefault. The approval decision was applied during each replay and during scoring. - Limitation: processes running as the same OS user share the local approval inbox (
pending-approval.url) and profile-scoped taint store (taint.scope: profile) unless separated by user account or state directory.
Full reference: docs/policy.md.
v0.4 behavior changes:
- Enforcing presets block destinations copied from untrusted content and known-host lookalikes, including tool-specific channel/account/repository IDs. Unicode and decoding checks use separate matching views.
- Default gates split matches; strict and egress block them. Default, strict and interactive gate remote/memory sinks after both untrusted and sensitive exposure, even for paraphrases. Quarantine, rate and loop gates count denied attempts; explicit session grants never bypass hard blocks.
- Critical writes require approval after hard blocks; strict and coding block tainted critical writes, and research blocks all critical writes. Whole package.json writes are protected. Semi/untrusted annotations can raise risk but cannot make a risky tool read-only; trusted annotations and administrator overrides retain priority.
- Tainted memory writes require approval in default, interactive and egress; strict blocks them. Approved observable provenance persists beyond TTL. Default's generic copied-content sink block remains, with this explicit memory exception.
- Metadata collisions/shadowing are blocked and hidden Unicode is sanitized; audit-only logs those findings. Common built-in names are labelled without being blocked. Lock approval stores snapshots, prints escaped diffs and asks in a TTY (
--yesskips the prompt). - All enforcing presets approval-gate elicitation. Strict now blocks strong suspicious output before sanitization. Destination/query, secret and split hard blocks precede generic approval/redaction rules. Egress exceptions cannot bypass critical, temporal, quarantine, rate or loop gates.
egress.moderemainsopenby default. Useapprove_newwith the default policy to approve new destinations. Permanent grants go topalizade.allow.yamlwhen unsealed. While sealed, destination grants stay in memory for the current session. Strict blocks new destinations even with open mode. Typed IDs useegress.allowlist.destinations, for examplechannel_id:C123.- Running wrap/serve processes reload valid policy/config/allowlist edits by default. Invalid edits keep the last valid version and are audited;
reload.enabled: falserestores fail-closed learned-file errors. Startup still rejects invalid files. Schema validation rejects unknown keys with path/line hints. - Optional raw audit capture masks observable tainted payloads entirely and masks known sensitive text otherwise. Copied destinations are masked in audit and approvals. Sandboxing remains optional and metrics remain off. Existing stdio configs still load. Servers that rely on inherited variables may need
passEnv.
Select a starter with palizade init --preset coding-agent or palizade init --preset research-readonly --output-dir ./output. Initialization copies the current embedded preset and preserves existing files unless --force is supplied. Ordinary init selects default; strict initialization also sets allowlist-only egress.
palizade setup <client> [--project] [--lock] [--dry-run]
palizade init [--preset <name>] [--output-dir <path>]
palizade install-config <serverName>
palizade install-config --all
palizade wrap <serverName>
palizade serve
palizade status [--json]
palizade hook <client> [event]
palizade daemon
palizade install-hooks <client>
palizade policy check [file] [--json] [--strict]
palizade policy test <files...> [--policy <file>]
palizade policy upgrade [file] [--dry-run]
palizade learn [--since 7d] [--server <name>] [--session <id>] [--write]
palizade lock approve <serverName>
palizade lock diff <serverName>
palizade detectors install promptguard2
palizade detectors verify heuristic
palizade scan [--format text|json|sarif] [--fail-on high|medium|low]
palizade why [--last 24h] [--limit 5]
palizade canary [--file .env] [--name BACKUP_SERVICE_TOKEN] [--list]
palizade seal [--check]
palizade tools [serverName] [--catalog]
palizade allow host|email <value...>
palizade allow list
palizade allow remove host:<host> | email:<address>
palizade audit --last 1h
palizade audit verify [--jsonl] [--sqlite]
palizade audit prune --older-than 30d
palizade taint prune [--include-persistent]
palizade session quarantine --clear [--session <id>]
palizade session reset [--session <id>]
palizade doctor [--client <name>]New releases add rules to the shipped presets, but your policies/<preset>.yaml is your copy. palizade doctor says when rules are missing, and palizade policy upgrade adds them while keeping your rules, edits, comments, and a .bak backup. doctor --client <name> [--project] reports whether the current hook definition has been observed executing. Reinstall existing hooks to enable that evidence. For project installs, doctor warns when user-level Palizade hooks may also run.
palizade canary adds a fake credential to .env (or --file) and remembers its value. Nothing legitimate ever sends that value anywhere, so any call that carries it, plain or encoded as base64, hex or url encoding, is blocked by block-canary-egress. This catches credential harvesting that fingerprints miss, because it needs no earlier tool result to match against. Rewriting the file the canary lives in is not treated as a leak. Limits: a shell command that reads the file itself (curl -d @.env) never has the value in its arguments, and the proxy cannot see inside it.
palizade seal records hashes of the selected config, policy, learned allowlist and tool lockfile. It records when the allowlist or lockfile is missing. The default checkpoint is .palizade/seal.json next to the config file. If it is absent, Palizade checks the old state directory location and doctor reports when it finds a seal there. Older seals need an explicit palizade seal after you review the four files.
Native hooks ask on drift, or deny on Codex and Gemini CLI. wrap and serve refuse an invalid seal at runtime startup and audit blocked MCP requests if drift appears during a session. Sealed wrappers enforce the verified config, policy, learned allowlist and lockfile they loaded at startup. After approving and resealing changes, restart the wrapper or listener to load them.
For a managed checkpoint, set PALIZADE_SEAL_PATH to an absolute path in an existing directory outside the config directory, workspace working directory and stateDir. Set it in the trusted launcher environment for the agent client, hook daemon if used, and MCP wrapper or listener. Run palizade -c <config> seal with the same environment and confirm with palizade -c <config> seal --check. The managed seal is required once configured. A missing, unreadable or mismatched checkpoint denies native tool calls and blocks proxy enforcement paths.
Give the runtime read access to the checkpoint and reserve writes to the file and its directory for the operator. Use OS permissions or an enforced sandbox when the agent runs under the operator's account. A seal inside the workspace protects against accidental edits. An agent with write access can replace or remove it. Keep the Palizade executable, launcher environment and hook registration under operator control for the managed seal to be trustworthy.
palizade audit prune --older-than 30d prunes the JSONL log. It coordinates writes made by this version of Palizade using an exclusive <audit.jsonl>.lock file. It preserves chain links that running writers can still extend. Use the same audit path and current version for all writers. If a crash leaves the lock behind, stop all Palizade processes using that log and remove the stale lock before retrying. palizade audit verify checks each available store's retained chains. Proof that the stores contain every event requires an independently protected checkpoint.
palizade scan reads every MCP client config it knows (Claude Desktop, Claude Code user, local and project scope, Cursor user and project) plus palizade.yaml, and reports servers that are not routed through Palizade, credentials written in plain text, packages and images run without a fixed version, plain http urls, legacy transports, and locked tool descriptions with hidden text, cross server references or instruction like wording. It also reads agent instruction files in the project and your home folder (CLAUDE.md, AGENTS.md, GEMINI.md, .cursorrules, .cursor/rules, .claude/commands, .claude/agents, .claude/skills, Copilot instructions) and reports invisible characters (rules-hidden-unicode) and instructions that look like data theft or hiding actions from the user (rules-suspicious-instruction). It starts no servers. --json and --fail-on medium make it usable in CI. To check a repository's committed MCP configs (.mcp.json, .cursor/mcp.json, .codex/config.toml) for leaked credentials and unpinned packages on every push:
Build Palizade from source as shown in Get Started. Set PALIZADE_CLI in the job environment to the absolute path to the built packages/cli/dist/index.cjs. Run the scan from the repository you want to check.
- run: node "${{ env.PALIZADE_CLI }}" scan --project-only --skip unprotected --fail-on low--format sarif prints SARIF 2.1.0 for the same pipelines as other scanners, such as GitHub code scanning. Each check is a rule, severity maps to error (high), warning (medium) and note (low, info), and files in the current directory get paths relative to it. Scan findings have no line numbers, so results point at the file. --fail-on still sets the exit code; run the upload step with if: always().
- run: node "${{ env.PALIZADE_CLI }}" scan --project-only --format sarif > palizade.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with: { sarif_file: palizade.sarif }palizade why explains the last few blocks and approval prompts in plain language: which rule fired, where the tainted data came from, the destination, and what you can do (classify a tool, allow a host, approve, or reset the session). palizade allow host api.example.com or palizade allow email *@example.com adds destinations to palizade.allow.yaml; palizade allow list shows them next to the ones in palizade.yaml. Allowing a destination never overrides a block on a destination that was copied from untrusted content.
Widely used servers are classified from a built in catalog, so their tools work under trust: untrusted without hand written toolClasses: the reference servers (filesystem, fetch, memory, git, time, sequential thinking, Postgres, GitLab, Google Maps), GitHub, Slack, Notion, Sentry, HubSpot, Heroku, MongoDB, search and crawling (Brave, Exa, Tavily, Firecrawl, Context7, Apify), browsers (Playwright, Puppeteer, Chrome DevTools, Browserbase), Figma and Desktop Commander. Entries were written from each server's real tool list, which pnpm eval:real reads again (results in results/real-servers.md). Search tools that send a query to a fixed provider are sources; tools that fetch a url, write, delete, send or run code are sinks. palizade tools prints each locked tool's class and why; palizade tools --catalog lists the catalog. See how tools are classified.
palizade install-hooks <client> writes hook entries for claude-code (~/.claude/settings.json), cursor (~/.cursor/hooks.json, failClosed: true), or codex (~/.codex/hooks.json) — backing up and merging without ever overwriting malformed JSON. The palizade hook command reads the client's hook JSON on stdin and prints the client's decision format (Claude Code/Codex hookSpecificOutput.permissionDecision, Cursor permission).
Hooks reuse the same SQLite taint store, policy, and audit as the proxy: Bash/Shell/apply_patch commands run the full sink check (shell-command role, network destinations, critical-path redirects), Write/Edit are gated on critical paths and tainted content, WebFetch URLs run destination checks, and PostToolUse of Read/WebFetch/Grep/Glob registers taint that later commands are matched against. Hooks fail closed by default (hooks.failMode: closed): a crash or timeout exits 2 (block), never allow. Claude Code tool hooks are also installed with onFailure: block, so a missing or crashing hook command denies the call instead of letting it through (Claude Code 2.1.295 or newer).
| Client | Status | Payload source for the contract tests |
|---|---|---|
| Claude Code | Payload tests and a scripted Windows client run | The hooks reference examples |
| Gemini CLI | Payload tests and a scripted Windows client run | The hooks reference field lists |
| Cursor | Payload and Windows command-launch tests | The fields consumed by the adapter |
| Codex | Payload tests and a scripted Windows client run | The fields consumed by the adapter |
The payload tests feed sample events through palizade hook and check the JSON and exit code. Scripted runs exercise an installed client against a local test provider. See release verification for the results and the separate real-model release gate.
Each hook call starts a new Node process that loads Palizade and parses its config, about 180 ms per call on a Linux container. palizade daemon (run it from the project, or pass -c with the same config path the hooks use) keeps one process running. Hooks then load only a small client, which hands the call to the daemon over a Unix socket in ~/.palizade/run (macOS, Linux) or a named pipe (Windows), and answers in about 50 ms p50 (results, pnpm bench:hooks). The daemon answers exactly as the in process hook would. It rereads the config and policy text on every call, so edits apply at once. If the daemon is not running, does not answer within 10 s, or anything about the exchange fails, the hook runs in process and fails closed as before. PALIZADE_NO_DAEMON=1 turns the client off. Requests and replies are signed with a key in ~/.palizade/run that only you can read, so another process listening on the same socket or pipe cannot answer for Palizade. A program that runs as you can still start its own daemon when none is running; that gives it nothing it could not already do as you.
Provenance alone cannot tell "email the invoice to [email protected]", typed by you, from the same address planted in a page the agent read. The prompt hooks close that gap: install-hooks also registers UserPromptSubmit (Claude Code, Codex) and beforeSubmitPrompt (Cursor), and Palizade remembers the destinations in your prompt: email addresses, exact urls, hosts, @handles and #channels, account and IBAN style numbers, and phone numbers. A later call to one of those is not treated as copied from untrusted content; everything else in the call is still checked, and a destination that only appeared in a page is still blocked. Only keyed hashes are stored, never the values. Prompt hooks never block your message, even if Palizade fails. Turn it off with taint.userIntent.enabled: false.
Palizade proxies remote MCP servers declared with url instead of command in palizade.yaml:
servers:
remote:
url: https://example.com/mcp
headers:
Authorization: "${GITHUB_TOKEN}"palizade wrap <server> bridges the remote server over stdio so existing client integrations keep working. palizade serve runs a transparent local listener at http://127.0.0.1:32146/mcp/<serverName>: Host and Origin checks run before token authentication or body reads, the upstream is always taken from config (never from request input), client Authorization headers are forwarded only to the configured upstream origin (never to redirect targets), 401/403/WWW-Authenticate pass through untouched for OAuth discovery, and the listener requires Palizade's own bearer token (generated at init, stored at .palizade/listener.token, sent as X-Palizade-Token). Both protocol eras are supported while rejecting unsupported protocol versions: 2025-11-25 (initialize, sessions, GET SSE streams) and 2026-07-28 (POST only, MCP-Protocol-Version/Mcp-Method/Mcp-Name/Mcp-Param-* headers, request-scoped SSE).
RFC 8707 caveat: forwarded tokens must target the configured upstream resource. Palizade does not mint upstream tokens or act as an OAuth authorization server. The listener has not been validated as an OAuth-terminating gateway; avoiding TLS termination alone does not establish audience compliance. MCP forbids accepting another resource's token and passing it downstream. See the official authorization requirements and token-passthrough guidance.
An unsandboxed server uses inheritEnv: minimal by default. It receives a small set of system variables for its platform, any host variable names listed in passEnv, and values set in env. Templates such as ${NAME} in the command, arguments, or env still read from the host environment. The launcher filters out PALIZADE_* names even in full mode. palizade doctor and the spawn audit show the mode and variable names.
If an existing server depended on an inherited variable, add its name to that server's passEnv, for example passEnv: [GITHUB_TOKEN]. Use inheritEnv: full only if the server needs the broader host environment. If a server exits with an error within five seconds of a minimal launch, Palizade prints a hint with both options. New Codex wrapper installs copy env_vars names into passEnv. For an existing wrapper, copy the names into palizade.yaml and restart it.
Stdio servers can optionally be launched inside a sandbox. The default sandbox is none.
servers:
filesystem:
command: npx
args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"]
sandbox:
type: docker # none | docker | bubblewrap (Linux) | seatbelt (macOS); Windows: docker only
image: node:22-slim
writable: ["out"] # cwd is mounted read-only; only these paths are writable
network: allowlist # none (default) | allowlist
allowHosts: ["registry.npmjs.org"]
passEnv: ["LANG"] # no host environment is passed except these names and `env`The shorthand sandbox: docker uses those defaults with network: none. Every spawn is written to audit with secrets masked, and palizade doctor lists servers that run unsandboxed.
Development and eval commands:
pnpm install
pnpm build
pnpm test
pnpm eval
pnpm eval:asr
pnpm eval:detectors
pnpm bench:latency
pnpm smoke:filesystemOptional PromptGuard2 setup is explicit. Palizade does not download model artifacts during init.
palizade detectors install promptguard2
palizade -c palizade.promptguard2.yaml detectors verify promptguard2
pnpm eval:combinedinstall-configsupports Claude Desktop, Claude Code (user, local and project scope), Cursor (user and project) and Codex (user and project); other clients take a manualpalizade wrapentry.- Remote servers that sign in with OAuth cannot go through the stdio wrapper. Claude Code and Codex hooks check their tool calls, but without a tool list Palizade cannot lock or review their metadata, and Cursor hooks classify them by name only.
- Coverage includes wrapped MCP traffic and installed native-hook events; live client hook activation needs verification.
- Claude Desktop live validation has exercised tainted write blocking.
- Claude Code support is documented with a non-native fetch/post MCP demo in examples/claude-code-fetch-demo.md.
- Real filesystem server smoke test is available through
pnpm smoke:filesystem. - Overhead from
pnpm bench:latency(Linux container, Node 22, single run): pass-through call p50 0.3 ms in process; on the default SQLite taint store with 200 stored 4 KB pages, fingerprinting a page takes p50 about 2.5 ms and checking a sink call takes p50 about 2.5 ms. A 1 MB tool result costs about 0.5 s and a 5 MB result about 3 s. Excludes the stdio hop to the upstream server.
- Audit logs hash payloads by default.
- Raw capture requires
audit.captureRawPayloads: true; observable tainted payloads are replaced by a redaction marker and other text receives known-secret/PII masking. - SQLite taint fingerprints are HMAC-protected by
.palizade/taint.key; the key is local and never printed. - Policy evaluation errors fail closed in enforcing presets.
- The approval inbox listens on loopback and requires a secret link. Decisions use a token for each request and accept only POST requests with a loopback Host and, when present, the inbox Origin. Keep the link private. Anyone who can read the launcher output, the browser URL or the file under the user profile can open the inbox.
- Unknown tools on untrusted servers are blocked by the default policy; unknown tools on semi-trusted servers require approval; unknown tools on trusted servers are audit-logged.
packages/core MCP transport, sessions, interception, lockfile, classification
packages/taint provenance records, fingerprints, matching, temporal taint
packages/policy YAML policy parser and evaluator
packages/detectors heuristic, PromptGuard2, secret, and PII detectors
packages/audit JSONL and SQLite audit sinks
packages/approvals terminal, localhost, and test approval providers
packages/cli init, wrap, lock, audit, detector, install, and doctor commands
eval/ InjecAgent-derived MCP ASR and local replay harnesses
examples/ reproducible demos and real-server smoke tests
policies/ shipped policy presets
docs/ architecture, policy, validation, and coverage notes
| Risk area | Palizade control |
|---|---|
| OWASP LLM01 Prompt Injection | Tool metadata scanning, response scanning, spotlighting, taint registration, sink gating |
| OWASP LLM06 Sensitive Information Disclosure | Sensitive taint tracking, secret/PII detection, redaction, egress allowlists, masked audit logs |
| OWASP LLM07 Insecure Plugin Design | Tool lockfile, tool class policy, unknown-tool handling, server-initiated sampling controls |