- Pick a bounded workflow with a clear success condition.
- Enforce permissions in the tool layer and record durable state.
- Evaluate recovery and business outcomes before expanding autonomy.
For engineering and operations teams introducing tool-using AI.
An agent that drafts a helpful response in a demo has not yet proved that it can handle a real support queue. Production work includes missing records, conflicting instructions, retried requests and actions that cannot easily be undone. Those cases should shape the integration from the start.
Consider an illustrative invoice-dispute assistant. It reads an invoice, collects relevant policy and proposes a resolution. Finance retains approval for a credit. This example provides a concrete way to discuss tool access, workflow state and evaluation without assuming the model is reliable enough to own every decision.
1. Choose one workflow with a measurable finish line
Map the current process before adding a model. For invoice disputes, record how a request arrives, which systems staff consult, who approves changes and what counts as completion. Establish a baseline for handling time, correction rate and unresolved cases. Include the time that reviewers spend checking the proposed answer.
Use deterministic code where the next action is already known. A fixed tax calculation or an invoice lookup does not need an open-ended planner. Add a model where interpretation matters, such as extracting the customer’s complaint or deciding which policy document is relevant. Anthropic’s workflow guidance makes this distinction between predefined workflows and agent-directed execution.
Write a short scope statement: the assistant may gather evidence and prepare a recommendation; it may not issue refunds or edit bank details. Test whether that boundary delivers value before designing a broader assistant.
2. Give tools narrow contracts and enforce access outside the model
Expose a tool such as “read invoice by authorised account and invoice ID”, rather than unrestricted database access. Validate fields, check the caller’s identity and apply account-level authorisation in the service. A system prompt is useful guidance but cannot substitute for those checks.
Separate read tools from tools that change records. A proposed credit should include invoice ID, amount, currency, reason and supporting evidence. The execution service must independently check limits and current invoice state. Re-read important values before committing so an old recommendation cannot approve a changed invoice.
Treat emails, attachments and retrieved documents as untrusted content. They may contain instructions that conflict with the user’s task. Restrict tool destinations, remove credentials from model-visible context and include adversarial documents in evaluation. An apparently legitimate business file should never be allowed to expand an agent’s permissions.
3. Make retries, approvals and timeouts explicit
Store the workflow state outside the conversation. A useful record contains the request ID, evidence references, proposal version, approval status and execution result. After a worker restart, the system should resume from that record rather than ask the model to reconstruct what probably happened.
Use an idempotency key for actions that can be retried. Persist the action result against that key so a network timeout does not create two credits. If the result is unknown, reconcile with the business system before retrying. A model’s statement that a tool “probably failed” is not enough evidence.
| State | Allowed next step | Evidence to retain |
|---|---|---|
| Evidence collected | Prepare recommendation | Source IDs and retrieval time |
| Approval pending | Approve, reject or request changes | Proposed amount and version |
| Approved | Execute the exact approved action | Approver and policy result |
| Execution uncertain | Reconcile before retry | Idempotency key and request log |
4. Build an evaluation set from difficult cases
Start with examples that staff recognise: a missing invoice, an already-paid invoice, a mismatched account, a policy exception and a request to change payment details. Remove or mask personal data where appropriate. Keep the expected outcome and the reason for that outcome alongside each case.
Score more than the final sentence. Did the agent fetch the correct record? Did it cite evidence that actually supports the amount? Did it stop at the approval boundary? Include tool outages, malformed results and malicious instructions in retrieved text. Record traces so a failure can be attributed to retrieval, reasoning or execution.
Set acceptance criteria by consequence. A wrong summary may be repairable in review; an unauthorised credit is a release blocker. Keep a held-out set that prompt authors do not tune against, and rerun it whenever the model, tool schema or retrieval configuration changes.
5. Release with human review and a working fallback
Begin in recommendation-only mode. Let the agent prepare a draft while staff complete the existing process. Compare the two outcomes and record why reviewers edit or reject drafts. This reveals missing context and unclear policies before actions become automatic.
Next, route a small class of low-risk requests through the assisted flow. Keep a visible way to take over the case, and preserve its evidence when handing it to a person. Put limits on tool calls, elapsed time and spend per request. Exhausting a limit should produce an explicit hand-off, not an invented result.
Monitor backlog, completion rate, reviewer effort and correction rate together. Faster drafts are not a productivity gain if review takes longer. Keep the previous workflow available during rollout, and give operations staff a clear control to disable execution tools while retaining read-only assistance.
6. Operate the agent like a changing software system
Version prompts, tools, policies and model settings together. A prompt change can alter which records an agent requests; a tool change can make old evaluation traces misleading. Preserve enough metadata to reproduce the configuration behind a decision without collecting unnecessary sensitive content.
Assign owners for evaluation failures and business exceptions. Review samples of successful cases too: a response can look polished while containing an incorrect justification. Track cost per accepted resolution and the proportion of cases requiring manual recovery. These are more useful than raw token counts alone.
As the workflow grows, first ask whether separate deterministic stages would make it easier to operate. Add multiple agents only for a specific coordination need; our multi-agent design guide compares the options. For delivery planning, AI solutions should begin with the process boundary and evaluation set.
Common questions
Does every workflow need an autonomous agent?
No. A fixed sequence of validated steps is usually easier to test. Use an agent when the task genuinely needs dynamic selection of tools or intermediate steps, and keep the allowed actions narrow.
When can we remove human approval?
Only for an explicitly defined class of actions after measuring errors, recovery and business impact. Keep approval for consequential changes where the organisation has not accepted the residual risk.
What should we measure first?
Measure successful resolutions, corrections, reviewer effort, elapsed time and cost per accepted result. Compare with the existing process using similar case types.
Sources & further reading
Primary documentation and research used for the technical context in this guide. Examples and checklists are illustrative; validate them against your system and the versions you deploy.
