Most AI agent guardrail systems check one tool call at a time, with no memory of the session. That means an attacker (or even a confused AI) can split one large forbidden action into several small, individually-legal-looking ones -- a real, documented pattern called "salami slicing."
I built agent_acid to close that gap:
Automatic rollback -- every tool gets a paired "undo" action. If any step in a multi-step AI agent plan fails, everything already done gets undone automatically.
Stateful guardrails -- rules that remember the whole session, not just one call. A cumulative limit catches a $1,200 charge split into three $400 calls, even though each one individually passes a per-step check.
I tested this against a live GPT-4o-mini agent actively trying to pull off both attacks (prompt injection and salami-slicing), and against a naive agent with only basic per-step validation. The naive agent got completely fooled -- $1,200 charged, no way to undo it. agent_acid caught it and reversed everything, including deleting the account that had already been created.
It's open source, tested (automated pytest suite, no API key needed), and published:
pip install agent-acid
GitHub: https://github.com/muhammadwaqasai/agent_acid
Built this solo over the past week. Would love feedback from anyone working on AI agents in production, or anyone who wants to try to break it.
What I found interesting is the shift from evaluating individual actions to evaluating the behavior they create together.
A system can look reasonable at every step and still produce an outcome that no single step would have justified on its own.
Exactly — that's the core insight. Most guardrail systems are designed like unit tests: check this one input, check this one output. But agent behavior is more like an integration test — the danger often only shows up in the sequence, not any single step. Really appreciate you putting it that way, it's a cleaner way to explain this than what I had in the README.
I appreciate you saying that.
I'd be interested in continuing the conversation by email if you're open to it. What's the best email to reach you on?
You can reach me at mw9822376@gmail.c... happy to keep discussing this.
Thanks! I’ve just sent it over.
Looking forward to hearing your thoughts whenever you have a chance.