{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "calmrocks-ai-engineer-notebooks--test-agent-against-prompt-injection",
 "repo": "calmrocks/ai-engineer-notebooks",
 "repo_url": "https://github.com/calmrocks/ai-engineer-notebooks",
 "repo_slug": "calmrocks-ai-engineer-notebooks",
 "title": "Test an agent against prompt injection before it touches real data",
 "page_title": "How to test an agent against prompt injection before it touches real data with AI Engineer Notebooks",
 "summary": "Run direct and indirect injection attacks on a tool-using agent, then add defenses and retest.",
 "who": "A security-minded engineer who has been asked to sign off on an LLM feature that reads external content and calls tools.",
 "problem": "An agent that reads web pages, emails, or documents can be steered by text hidden in that content into misusing its tools.",
 "outcome": "A list of working attacks against the agent, the defenses that stopped them, and the attacks that still got through.",
 "steps": [
  "Open 07-security/01-prompt-injection-and-trust.ipynb and run the direct and indirect injection examples against the sample agent.",
  "Note which outputs are handled unsafely and which tool calls the attacks trigger.",
  "Open 05-agents/03-guardrails-and-budgets.ipynb and add stopping conditions and budgets to limit what the agent can do.",
  "Rerun the injection examples and record which attacks still succeed.",
  "Write down the trust boundary for each tool and the remaining gaps for your review."
 ],
 "agent_prompt": "Using the repo calmrocks/ai-engineer-notebooks, run the injection examples in 07-security/01-prompt-injection-and-trust.ipynb against <placeholder agent or tool list>. Expected output: a table of attacks with the tool calls each one triggered, before and after defenses. Verify that the test covers both direct and indirect injection.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The security notebook teaches the OWASP LLM Top 10 risks on the notebook's own sample agent, so it does not test your production system until you point it there.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "jupyter notebook",
 "requirements": [
  "A Google account to open Colab notebooks",
  "A free Groq API key from console.groq.com (no credit card needed)",
  "The key saved as a Colab secret, as the setup notebook describes",
  "Basic Python and comfort reading API responses"
 ],
 "risk": "dual-use",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "dual-use",
   "notice": "The injection examples are working attack payloads, so run them only against systems you own or are authorized to test."
  }
 ],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/calmrocks-ai-engineer-notebooks/test-agent-against-prompt-injection/",
 "md": "https://dedupedai.com/use-cases/calmrocks-ai-engineer-notebooks/test-agent-against-prompt-injection/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/calmrocks-ai-engineer-notebooks--test-agent-against-prompt-injection.json",
 "api_version": "v1"
}
