Policy-Based Defense Against Prompt Injection in AI AgentsPolicy-Based Defense Against Prompt Injection in AI Agents
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
AI agents read web pages, tickets and files, and any of them can hide instructions. That's prompt injection, the #1 risk in the OWASP Top 10 for LLM Applications.
I built a policy layer that sits between an agent and its tools and stops those instructions from turning into actions. Five deterministic rules, no prompt tricks: tool allowlists, read scope, write confinement, egress pinning and sink provenance.
Then I attacked it. On an agent that obeyed 43% of injection attacks, the rules cut successful attacks to 0 out of 60, across all five attack goals: stealing a secret, phoning home, poisoning files, planting a payment IBAN and moving customer data. They held on Claude Haiku 5.5 too, with zero false blocks, and on the AgentDojo benchmark they cut worst-case attack success from 98% to 3.1%.
Every number comes from logged runs with 95% confidence intervals.
Want the same for your agent? I map its tools, attack it with your own workflows, write the policy and hand back a before/after attack rate. #AIAgents #AgentSecurity #AISecurity #PromptInjection #LLMSecurity #GenAI #LLM #AIEngineer #MCP #ModelContextProtocol #Claude #Anthropic #RedTeaming #CyberSecurity #Python #AIAutomation
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started