Agents in products
Use a fixed workflow when the steps are known. When an agent must choose its steps, end every run with a status, keep a full trace and survive restarts.
- Required 2
- Recommended 3
Required
End every agent run with a known status
RequiredEnd every agent run in one of a fixed set of statuses and show it to the user. Examples are done, waiting for approval, approval expired, step limit, time limit, budget limit and failed.
Record every step of every run
RequiredStore each step of an agent run with its tool name, arguments, a short result, the time and the cost. Let support and the user see what the agent did.
Recommended
Use a fixed workflow when the steps are known
RecommendedBuild a fixed sequence of model calls and code when the steps of a task are known in advance. Use an agent loop, where the model picks the next tool, only when they are not.
Let runs pause and resume
RecommendedSave an agent run's state after every step, so it can wait for approval and survive a restart. Expire pending approvals after a set time, such as 24 hours.
Test agents by the end state
RecommendedTest an agent with scenarios that check the final state and the actions it must never take, not the exact sequence of steps.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers ai features playbook: https://agentwranglers.se/playbook/ai-features/agents-in-products.