AI Agents in AI Engineering
Every AI Agents lesson in the AI Engineering course, in the order you study them. Each page opens about the first half of its lesson to read, some the whole of it; the full lessons and their workbooks are in the plan.
The agent loop: tool calls as text, multi-step control flow and per-step cost
What an AI agent is: a model, a harness and tools in a loop. The whole loop in code, why tool calls are just text, and what each step costs.
Tool interface design: descriptions, schemas and error messages, measured
How to design tools for LLM agents: tool descriptions, schemas and error messages, with three changes to one agent measured on the same 30 tasks.
Context management: prompt caching, compaction and deliberate forgetting
Context management for AI agents: why the conversation is the agent's memory, what a long context costs, prompt caching, and forgetting on purpose.
Sandboxing and permissions: untrusted input, prompt injection and defence in depth
How to sandbox an AI agent: trusted and untrusted text, a planted prompt injection measured, what a sandbox stops and what it misses, and layered defence.
Agent evaluation: hidden tests, pass@k and score confidence on SWE-bench-style tasks
How to evaluate AI agents honestly: good tasks with hidden tests, run-to-run noise, confidence in a score, and what real agent benchmarks measure.
Planning strategies, retry policies and subagent delegation
Planning, loop breaking, retries with a judge and subagents: four ways to make an AI agent more reliable, what each costs, and which helps a small model.
How labs train coding agents: pre-training, supervised fine-tuning and RL in sandboxed tasks
How coding agents are trained: pre-training, supervised fine-tuning on agent traces, and reinforcement learning on real tasks in sandboxes with tests.
Reward hacking: leaky rewards and how to defend against them
Reward hacking explained: why a model optimised on a measurement finds ways to score without the result, what a leaky reward teaches, and how to defend.
