Track cheat sheet
Agents and tool calls cheat sheet
Agents that loop, act and run for hours: turn limits, effort, tools that run twice, injected instructions, irreversible actions and deploys mid-run.
Key concepts
- The loop with no exit
- An agent loop ends only when the model stops calling tools, so it can run forever on an impossible task.
- Fifteen times the tokens
- Multi-agent systems cost many times the tokens of a chat; worth it for broad questions, wasted on simple ones.
- Retried tool, refunded twice
- Agent steps run at least once: a crash after acting means the retry acts again.
- Instructions in the inbox
- An agent reading untrusted text can be steered by instructions hidden in it.
- The irreversible tool
- An agent's mistakes are bounded only by its credentials, and models will sometimes choose a destructive command.
- The deploy that killed every run
- Agent runs last minutes to hours, so a deploy that restarts runners throws away every run in flight.
Decision rules
- Enforce a turn limit and a token budget in the runner; end with a partial answer or a hand-off.
- Scale effort to the question with explicit rules; start with a workflow or one agent.
- Key every side-effecting tool call by run ID + step ID; the service called enforces it.
- Limit what tools can do in code; approval for high-risk actions; treat read content as untrusted.
- Risk-rate tools, dev credentials by default, a person approves anything irreversible.
- Checkpoint every step, resume after restarts, and roll out gradually so old runs finish.
Common traps
- No limit, and every turn resending a growing history.
- A lead agent that fans out to sub-agents for every question.
- Relying on the model to call a tool once, while the engine retries beneath it.
- Relying on the system prompt to make the model ignore injected instructions.
- Production credentials given once 'to be helpful' and never taken back.
- Runner memory as the only record of progress, and deploys that restart everything.
Lessons and boss fights
- The loop with no exit · 3 min
- Fifteen times the tokens · 3 min
- Retried tool, refunded twice · 3 min
- Instructions in the inbox · 3 min
- The irreversible tool · 3 min
- The deploy that killed every run · 3 min
Real outages on this track: The agents that kept working
BuildBreak · Agents and tool calls · each line comes from its lesson, where the sources are linked.