NEWPractise supported commands in browser simulations, alongside the lesson.Try a browser practice exercise.Try a lab♥ Codelivly is 100% free, no paywall. If it helped you, chip in to keep it running.100% free. Help keep it so.Support us
Preview · 30 min
Master mid-task agent hijacking. Learn how attackers exploit recency bias and poisoned tool outputs to redirect goals, and defend with strict tool allowlisting.
In the previous lesson the agent was hijacked from its first input. A more stealthy variant happens after the agent has started a legitimate task.
Mid-Task Goal Redirection happens when a harmful objective enters the context window during an ongoing agentic loop. The agent is already in a "trusted" state, its tools are validated and it wants to be helpful. So it is easier for it to drop the original objective and follow the new one.
The effect uses two biases of the LLM: Recency Bias (the latest text weighs more) and Authority Bias (text that sounds like a system rule weighs more). It also uses the momentum of the agent. It bypasses filters on the first input, and it turns a legitimate workflow against its own environment. For a defender, the lesson is: watch what happens in the middle of the loop, not only at the start.
Create a free account to unlock the rest of this task, complete tasks, and earn Rep.
Sign in