An AI agent is a loop of think, act and observe that ends on a text answer, a step budget or an approval pause; a working PHP version is 42 lines.
Each step resends the whole history: six steps sent 13,182 characters to carry 4,247 characters of unique content, so cost grows with the square of the step count.
Narrow agents with a few read-only tools are cheaper, safer and easier to test than general-purpose ones.