Error categories
Errors are designed for both humans and machines. Your app should distinguish validation errors, supplier availability changes, payment failures and policy blocks.
Show validation errors near user-correctable fields.
Ask agents to re-plan when inventory changes.
Escalate payment and policy issues to human confirmation.
Agent recovery
Agent tools should return structured error codes plus a user-safe explanation. Avoid asking the model to infer whether a transaction succeeded.