← All Labs
🛡 AI HACKING INTERMEDIATE +110 XP · +44 no-hint bonus 🎯 Practice mode

Whose Instruction Was That? — Set Tool Rules That Stop a Hijack

A research agent can fetch web pages, read files, send email, run code and open tickets. Last week a page it fetched took control of it. You have the recorded traces of that hijack. Set the tool rules, then replay the traces against your policy until the hijack fails at every step and the agent can still do research.

https://bookshop.local/search

What is agent and tool hijacking?

An agent chooses which tools to call based on the text in front of it. Agent hijacking is steering those choices through content the agent reads while working: a web page, a tool result, or the description of a tool.

The damage comes from chains. One step looks harmless on its own, such as reading a file. The next step sends it somewhere.

A real case

We have not found a public incident from 2025 or 2026 that matches this technique closely enough to cite, so we are not listing one here.

How to fix it

  • Pass tool results to the model as data, and do not let them start tool calls on their own authority.
  • Enforce limits in the tools themselves: recipient allow-lists, no network for code, narrow file access.
  • Ask the user to confirm risky combinations, showing the real details.
  • Review third-party tools and their descriptions before the agent can use them.

Questions people ask

Why not ask the model whether an action is safe?

The attacker's text is already part of what the model is reading, so it can argue its own case. Limits have to be enforced in code.

Does every tool need a confirmation step?

No. Confirm the few actions that send data out, destroy something or spend money, and let low-risk tools run.

Read the full OWASP LLM Top 10 guide · All free labs · AI red team certification