{
 "schema_version": 1,
 "generated": "2026-10-23",
 "id": "openlayer-ai-jevals--screen-tool-results-for-injected-instructions",
 "repo": "openlayer-ai/jevals",
 "repo_url": "https://github.com/openlayer-ai/jevals",
 "repo_slug": "openlayer-ai-jevals",
 "title": "Catch tool results that try to give the agent orders",
 "page_title": "How to catch tool results that try to give the agent orders with Jevals",
 "summary": "Check every tool result for indirect prompt injection and PHI in the same request as your other evals.",
 "who": "A security or platform engineer running an agent that reads web pages, emails, or documents it did not write.",
 "problem": "Text returned by a tool can contain instructions meant to hijack the agent, and the agent may follow them without the user noticing.",
 "outcome": "A pass or fail for indirect injection on each trace, plus a PHI check, with the probability the decision model returned.",
 "steps": [
  "`pip install jevals`",
  "`pip install \"jevals[pii]\"` to add Presidio for PII and PHI entity detection",
  "`export AI_GATEWAY_API_KEY=...`",
  "Call `evaluate(sample, [IndirectInjection(), PHI()])` with `from jevals.security import IndirectInjection, PHI` on your saved traces (inferred, check the README)",
  "Read `r.indirect_injection.passed` and `r.phi.passed`, and review any failing traces by hand"
 ],
 "agent_prompt": "In the jevals repo, run IndirectInjection() and PHI() from jevals.security against the traces in <traces_file>. Report each trace that fails indirect_injection, with the tool result text that triggered it. Verify that the PHI check ran with the jevals[pii] extra installed.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README gives a probability for each check, not a guarantee, so treat a pass as a screen and not as proof that a trace is safe.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.10 or newer",
  "An API key for one backend: AI_GATEWAY_API_KEY (Jev through Vercel AI Gateway), TYPESAFE_API_KEY, or OPENROUTER_API_KEY",
  "A trace to evaluate: a messages list in the OpenAI chat format plus the tools you gave the model"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/openlayer-ai-jevals/screen-tool-results-for-injected-instructions/",
 "md": "https://dedupedai.com/use-cases/openlayer-ai-jevals/screen-tool-results-for-injected-instructions/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/openlayer-ai-jevals--screen-tool-results-for-injected-instructions.json",
 "api_version": "v1"
}
