Log inBook a Demo
SecureSeniorSecurityAuto-graded

Stop retrieved text from hijacking an LLM prompt

A senior security task: hardening an AI system against malicious instructions hidden inside the content it reads.In a retrieval or agent pipeline you fetch document chunks and tool output and concatenate them into the prompt you send the model. That retrieved content is attacker-controllable — a poisoned page, a planted support ticket, a malicious file — and it is the leading injection vector in LLM applications. A malicious chunk tries to escape the data channel and be read as instructions, using fake role markers, override phrases and delimiter breakouts. Neutralise those while leaving legitimate content readable.
40 min
python

You're done when

  • Fake role markers embedded in retrieved text are neutralised rather than passed through as structure.
  • Instruction-override phrases in the content no longer read as commands to the model.
  • Attempts to break out of the surrounding delimiters are defused.
  • A document mixing legitimate text with an injection attempt is handled correctly on both counts.

What it measures

Application securityTreating retrieved content as untrusted input, and defending the boundary between data and instructions.
Prompt engineeringUnderstanding how a model resolves role markers and delimiters, and therefore what actually neutralises them.
Precision in sanitisationDefusing the attack without gutting legitimate documents, which is what makes the defence deployable.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

40 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo