AI Learn Home
Agents

Agents and tool use: where they help

24 September 2026 · 6 min read

An “agent” is a model in a loop with tools and a goal. That definition is broad enough to cover both a useful assistant and an expensive way to generate stack traces. The difference is almost never the model; it is the shape of the loop.

Good fits

Bad fits

The patterns that survive

Small steps, explicit state. Keep a written plan and a log outside the context window. The model forgets, the file does not.

One tool, one purpose. A tool that does three things is a tool the model will misuse. Narrow signatures with typed arguments are easier to call correctly and much easier to validate.

Verify with something that is not the model. Tests, schemas, type checkers, exit codes. A model grading its own work will agree with itself.

Budget every loop. Maximum steps, maximum tokens, maximum wall time. Without a ceiling, a confused agent finds new and creative ways to spend your money.

Sandboxing is not optional

Any agent that can run commands will eventually run the wrong one. Not because it is malicious, but because the space of plausible commands is large and the model is guessing. Run it in a container with the files it needs, no credentials it does not, and a network policy you chose on purpose.

This is also the cheapest debugging tool: when a run goes wrong, you can throw the container away instead of explaining to your team why the staging database has new columns.

What to measure

Track success rate per task type, average steps to completion, and cost per solved task. The last one is the number that decides whether an agent is a product or a prototype. A 92% success rate sounds great until you notice that the remaining 8% consume a third of the budget and all of the support time.