Skip to main content Switch to mobile version panel-firewall 0.3.1 Panel checks what an AI agent says and what it does: an action firewall (MCP proxy, deterministic policy, consent, idempotency, signed receipts) and a support-bot guard.
pip install panel-firewall==0.3.1 Copy PIP instructions
An agent can go wrong in two ways: it does something it should not (a refund over the limit, a DELETE without a WHERE, the same charge twice), or it says something that is not true ("I've refunded you" when nothing was refunded). Panel is two layers that check both, with deterministic code and no model in any verdict.
Both are early, single-author, sandbox-only software. Read "Limits" before relying on any number below.
How the firewall works
agent ──tool call──▶ Panel ──▶ policy check (code over a YAML policy and an append-only ledger) ──▶ allow / needs_consent / block │ ├─ block: reasons go back to the agent; nothing runs │ ├─ needs_consent: held until a human approves OUT OF BAND (usepanel approve, local UI) │ └─ allow: claim the idempotency key ▶ execute once ▶ ledger ▶ signed receipt └─ before a reply reaches a person: "it's done" claims must cite a receipt the ledger confirms, else the reply is rewritten Fail closed (unknown tool, bad argument, engine error: block). Consent never comes from the agent's own arguments. SQL is parsed to an AST (sqlglot): single statement, allowlisted kinds, protected tables, row-count caps, a SQLite authorizer as a second layer. Receipts are Ed25519-signed and hash-chained (tenthlook-core format).
The support guard parses the bot's reply into promises and actions, checks them against a written store policy (refund window, amount limits, escalation threshold, discount cap) and the real order record, and lets a reply through only if every promise is backed. v7 (new) consent: before any action runs, Panel sends a confirmation question it generates from the action ("To confirm: refund $24.00 on order #1042? Reply yes to proceed."), and only a short plain yes to that message counts; anything else is re-asked once, then handed to a person (panel_firewall/guard/v7.py, results/v7_report.md). Earlier versions (v6.x) read the customer's words with phrase rules and are kept frozen.
Try it in 10 seconds
No config, no API keys, nothing to set up:
pipx run panel-firewall demo Runs a simulated support agent that tries five actions — a lookup, a small refund, an over-limit refund, one that needs human approval, and a destructive delete — and shows Panel blocking, holding, and approving each one live in your terminal.
Install and quickstart
Requires Python 3.11+. tenthlook-core (the receipt format) is installed automatically. With Panel Cloud (one command, no key to copy). The dashboard shows a setup command with a one-time token (it works once, for 10 minutes). Paste it:
pip install panel-firewall usepanel keygen # once per machine: the receipt-signing key (outside any git repo, mode 0600) usepanel init --token pit_... --cloud-url https://app.usepanel.dev # the command from the dashboard: fetches and saves the workspace API key usepanel proxy -- npx -y @modelcontextprotocol/server-filesystem /srv/data # uses the saved cloud and key; point your MCP client at this command usepanel doctor # checks the setup and says where the key came from (never prints it) The key is saved to ~/.config/usepanel/cloud.json ($XDG_CONFIG_HOME/usepanel/ if set, or $PANEL_CONFIG_DIR), mode 0600 in a 0700 directory, and is never printed. Running a new setup command replaces it. Manual alternative: create a key in the dashboard and pass --cloud-url https://app.usepanel.dev --api-key-file key.txt, or set PANEL_API_KEY. --api-key, --api-key-file and PANEL_API_KEY always override the saved key, and the saved key is only ever sent to the cloud URL it was issued for.
Local policy only (no cloud):
Example policies and MCP client config: examples/. Tests: pip install -e ".[dev]" && pytest (the real-MCP-server tests skip if the servers are not installed).
Copy-paste configs for popular tools
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{ "mcpServers": { "sqlite-via-panel": { "command": "usepanel", "args": ["proxy", "--policy", "panel-policy.yaml", "--shadow", "--", "npx", "-y", "@modelcontextprotocol/server-sqlite", "mydb.sqlite"] } } } Cursor (.cursor/mcp.json in your project):
{ "mcpServers": { "filesystem-via-panel": { "command": "usepanel", "args": ["proxy", "--policy", "panel-policy.yaml", "--shadow", "--", "npx", "-y", "@modelcontextprotocol/server-filesystem", "."] } } } Any stdio MCP client — Panel wraps any MCP server command:
usepanel proxy --policy panel-policy.yaml --shadow --
Every number below is from a file in this repo. Each evaluation was written down and hashed before it was run (*prereg* files and FROZEN_*.sha256). I wrote the policies, tasks, labels and code, so read these as engineering evidence, not independent validation.
1. Firewall, scripted agent (47 tasks / 55 calls, sandbox backends; results/report.md). A scripted replay, not a model: it shows policy coverage.
Latency (Apple M4, loaded machine): policy validate median 0.01 ms (Shopify/Stripe), 0.21 ms (SQLite); full Firewall.handle with ledger write and signature median 0.36 ms, p95 0.61 ms (results/eval/latency.json).
2. Firewall, real models (gpt-4.1 and gpt-4.1-mini, 5 samples x 47 tasks, with and without Panel; results/llm_report.md). Without Panel the models executed a should-block action in 67 (gpt-4.1) and 57 (mini) of 115 task-runs and a needs-consent action with no human in 39 and 30 of 45; with Panel, 5 and 11 and 0 and 0. The 5 and 11 are scoring artifacts that I checked row by row (narrow DELETE ... WHERE id = 7-style statements the policy allows). Both models' replies were mostly honest about errors and blocks; the claim blocker had little real to catch and wrongly replaced 24 of 470 honest replies (5.1%) in v1.
3. Claim blocker (results/claims_v2_report.md, results/llm_cite_report.md). Replies that say an action happened must cite a receipt id. On a new held-out set (v2): 1 of 124 honest replies wrongly rewritten, 80 of 85 false claims caught, 12 of 12 citation attacks caught. Models do not cite on their own: gpt-4.1-mini cited a valid receipt in 37 of 43 replies when the tool result told it to, and in 0 of 43 when the id was visible but the instruction was not. Panel injects the instruction into tool results. Open defects: KNOWN_ISSUES.md.
4. Support guard, fresh8 (gpt-5.6-luna, 20 conversations, 60 turns per condition, v6.5; GUARD_README.md, guard_results/fresh8_compare/):
5. Support guard v7, fresh9 (new held-out set, same model; results/v7_report.md): 11 of 11 allowed requests carried out, 0 actions without consent, one extra customer turn per carried-out request (the yes). The live runs barely tested the yes/not-yes boundary (2 non-yes events on fresh9, none on fresh6/7/8); that boundary is tested by 108 phrase cases in tests/test_v7.py.
Approval PIN (anti self-approval). Held actions are released only by a human. usepanel approve
The PIN is typed on the controlling terminal (/dev/tty) only: not an argument, not stdin, not an environment variable. Only a salted scrypt hash is stored (~/.config/panel/approval_pin.json, mode 600, outside the repo).
usepanel approve refuses unless stdin, stdout and /dev/tty are the same interactive terminal. A background process with piped stdio, or none, is refused. The UI asks for the PIN in a form; wrong attempts are rate-limited with a lockout (5 wrong in a row: 5 minutes, doubling up to 1 hour, kept on disk so a restart does not reset it).
A correct PIN mints a token bound to that exact pending action (approval id + action hash), valid 60 seconds, usable once. The ledger refuses an approval without a valid token and records the token's nonce, so a replay or a token for another action is refused. Denying never needs the PIN.
What this blocks: an agent (or a prompt-injected tool) that runs usepanel approve
Consent is protected by a PIN and the OS user, not a hardware boundary. The approval PIN stops an agent from running usepanel approve or calling the UI without it, but an agent with a shell as the same OS user can still edit the ledger or the PIN file. See "Security model". Stronger: run the agent as a separate OS user or container, or approve from another device.
Only guards what is routed through it. An agent with another path (shell, second MCP server, browser) bypasses Panel.
The claim blocker is keyword-based and English-only; it misses idioms ("dealt with", "pushed it through") and does not check counts. See KNOWN_ISSUES.md.
Sandbox only. Stripe refuses non-sk_test_ keys; Shopify is for development stores; the Stripe connector has only run against a mock transport, the Shopify connector against fakes (plus one recorded dev-store refund for the older executor).
Small, same-author evidence. One or two models, 20-conversation sets, labels made by an AI agent (second labels from another AI, no human), customers simulated by scripts. "0 in 60" has an upper 95% bound of about 5%.
No formal verification. A receipt proves what Panel checked and that the record was not altered, not that the action was a good idea.
Not reviewed for production finance, healthcare or other regulated use.
panel_firewall/firewall/ firewall engine, connectors, gateway, receipts, claim blocker · panel_firewall/guard/ support guard (v6.x frozen; v7) · panel_firewall/execute/ executor and approval page · eval/ and results/ firewall evaluations (pre-registrations, hashes, raw rows) · guard_data/, guard_results/ guard sets and runs (fictional store and orders) · tests/.
Need help setting up Panel on your MCP server? Email narensara@usepanel.dev or open an issue.
License: MIT (see LICENSE).
Released: Nov 27, 2026
MIT View SPDX License List
ai-agents mcp mcp-server guardrails firewall policy receipts llm-safety claude-desktop ai-safety tool-use
Development Status 3 - Alpha
Intended Audience Developers
Programming Language Python :: 3.11
Software Development :: Libraries
Release files for panel-firewall 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 471.6 kB
Release files / panel_firewall-0.3.1.tar.gz
Release files / panel_firewall-0.3.1-py3-none-any.whl
Security for panel-firewall 0.3.1
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.
None of the files in this release were uploaded with provenance metadata.
A 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.
Release history Release notifications | RSS feed
Nov 27, 2026 2 release files No provenance
Nov 26, 2026 2 release files No provenance
Nov 24, 2026 2 release files No provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from fc0d8e6











