Every "autonomous AI agent" demo you've seen is a happy path. The demo shows the agent finishing the task in 30 seconds. Nobody shows you what happens in hour 4, when the task is harder than expected and the model keeps trying.
This is the post that shows you hour 4.
1. The loop. The agent calls the same tool, gets an error, retries, gets the same error, retries. Without an iteration cap, this is how a "research assistant" becomes a $400 afternoon. A simple cap — say 10 iterations — converts an unbounded cost into a bounded, recoverable one.
2. The budget. Tokens are the unit of cost, and token usage is the only number that matters for your bill. A token budget per run means the agent stops cleanly when it hits the number you set, not when the model finally gives up (which, given enough time, it will).
3. The runaway action. The agent decides to delete the database because the instructions were ambiguous. Approval gates on sensitive tools mean the agent proposes the action and a human says yes or no. The agent does the work; you keep the kill switch.
Here's the part most implementations miss: if an agent calls the exact same tool with the exact same arguments twice in a row, something is wrong. The first call failed, and the agent is stuck in a pattern.
In Agentice Stack, three identical tool calls in a row stops the run with a clear error: REPEATED_TOOL_CALLS. The agent didn't fail because it was stupid — it failed because the environment kept giving it the same error, and no human was watching. The repetition guard is how the system notices.
Token budgets cap the input. The cost circuit breaker caps the money. They're different: a model that returns long responses can blow through a generous token budget in a few calls. A cost cap — say $0.50 per run — is the number you actually care about, because it's the number on your invoice.
# agentice config.yaml
guardrails:
max_iterations: 10
token_budget: 10000
max_repeated_tool_calls: 3
max_cost_usd: 0.50
require_approval: true
Five numbers. Every one of them is a line item you can point to in a post-mortem.
A stoppable agent is an agent you can deploy unattended. A stoppable agent is an agent your compliance team can sign off on. A stoppable agent is an agent you can put in production.
The demo that works 30 seconds is a toy. The system that stops itself, logs why, and waits for a human is a product.
Next post: a real teardown from a production deployment — what broke, what the trace showed, and what we changed.