An agent occasionally loops and burns a fortune in tokens.
What’s the essential guardrail?
- ATrust the model to stop
- BA hard cap on iterations / tokens / cost per task
- CA prompt instruction asking the agent to watch its own spending and stop once it seems too high
- DTurn off logging to save money
Answer: B
A hard cap on iterations / tokens / cost per task
Why
Always bound autonomous runs: a hard iteration/token/cost cap turns a runaway loop into a safe, bounded failure.
- OrchestrationYour agent must run three read-only lookups.
- OrchestrationA six-step pipeline crashed at step 4.
- OrchestrationMid-task, the agent decides the next step is to permanently delete a customer’s production database.
- OrchestrationEach sub-step has its own 60-second timeout, but the whole job must answer within 90 seconds.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path