Agents and tool use: where they help
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
- Narrow, verifiable tasks. Rename a symbol across a repository, migrate a config format, extract fields from a batch of invoices. The model proposes, a test or a schema disposes.
- Search-and-read loops. Find the file, read it, decide what to read next. Short steps, cheap recovery.
- Repetitive operations with a clear stop condition. Anything where “done” can be checked mechanically.
Bad fits
- Open-ended goals. “Improve the product” has no stop condition, so the loop runs until the budget does.
- Irreversible actions without a gate. Deployments, deletions, payments. A model that is 99% right is not right enough for a one-way door.
- Tasks that need one careful answer. If the problem is hard, a long loop of small mistakes is worse than a single strong reasoning pass.
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.