Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Untrusted text can steer the agent
card 1 of 6
Where did that command come from?
builds on: What the agent sees: its context, Trust boundaries and untrusted input
You ask the agent to fix issue #212. It reads the issue, opens a few files, runs the tests, and the diff looks fine. But the transcript (the log of every tool call and command it ran) shows it also ran `curl` to a host you have never heard of. Nothing in your prompt asked for that, and nothing in the fix needs it. Where did the idea come from?
Terms on this card
- transcript
- The record of an agent session: its messages, the tools it called, the commands it ran and what they returned.
- curl
- A command-line tool that makes HTTP requests to a URL.
- the diff
- The change under review in unified diff format: '-' lines removed, '+' lines added, unprefixed lines are unchanged context.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
Lesson goal: Explain that instructions hidden in files, web pages, issues, READMEs or tool output enter the agent's context, and the agent cannot reliably tell data from commands. Predict what an injected instruction could make an agent with your permissions do. ·
the whole lesson