Repository navigation
AgentDetox 0.2.0
The first release on PyPI, and a preview. AgentDetox protects what AI coding agents remember and obey: their memory, CLAUDE.md and rules files, skills, and config. Claude Code is supported; Codex and Cursor hooks are experimental.
uv tool install agentdetox
agentdetox demoThen, inside Claude Code: /plugin install agentdetox --marketplace chriswu727/agentdetox (or agentdetox install claude-code --apply), and restart Claude Code.
What it does
- Checks every write to memory, rules, skills and config, including through shell commands. Planted instructions are blocked; changes to the agent's own hooks, MCP servers or permissions, suspicious writes, and memory copied from a web page or tool output need your approval. Text you typed or pasted yourself asks instead of being blocked.
- Notices changes made behind the agent's back, by a dependency's install script or another program, and reports them at the next session with the command that restores each file. Restores quarantine the current file; nothing is deleted.
- Records where every change came from: you, the agent, a named page or tool output it copied, or something outside the agent.
agentdetox logshows the history andagentdetox blame <file>the origin of each line. status,events,doctor,allow <id>andconfigfor day-to-day use. Contradiction detection with a local NLI model is an optional, experimental extra.
Tested in real sessions
The lab in lab/ replays attacks against real Claude Code sessions, with and without AgentDetox. An install script tampering with CLAUDE.md, a planted onboarding instruction and a registry redirect got through without AgentDetox and were stopped with it; everyday edits and "remember this" ran without a single prompt. Results: lab/results/latest.md.
Known gaps
Detection is not a security boundary, text the model rewrites in its own words can pass, and a change made outside the agent is reported at the next session rather than when it happens. The full list is in the README; where it is going is in the roadmap.
Full list of changes: CHANGELOG.md.