Failure Is a Design Condition, Not an Exception
Agentic workflows fail differently from conventional software. A deterministic service usually returns a known error when a dependency times out or an input violates a schema. An autonomous workflow can fail while appearing productive: a model may misread an instruction, select the wrong tool, fabricate a parameter or continue confidently after receiving incomplete data. The system can execute ten valid steps and still produce an unusable outcome because the third step introduced a subtle error. Reliability therefore cannot be reduced to model accuracy. It depends on whether the workflow can detect, contain and recover from mistakes before they compound.
The practical target is not zero failure. It is bounded failure. A research agent that cannot access one source should try another; an invoice-processing agent that cannot reconcile a supplier name should pause that record rather than block the entire queue; a customer-support agent that detects conflicting account data should hand the case to a person before making a refund. Each workflow needs an explicit failure budget: what may be retried, what may be approximated, what must be verified and what must never happen without approval.
This changes the architecture. Instead of treating the agent as a single intelligent process, design it as a sequence of observable state transitions. Every consequential step should expose its inputs, outputs, tool response, confidence indicators and next permitted actions. Recovery becomes possible when the system knows where it is, what has happened and which safe alternatives remain. Without that structure, an agent is merely improvising under uncertainty.
Use Checkpoints to Make Progress Reversible
Checkpoints turn a long-running workflow into resumable units. After each meaningful stage, persist enough state to reconstruct the task: the original request, normalised inputs, completed actions, tool results, approvals, costs and the version of prompts or policies used. For a procurement agent, sensible checkpoints might follow supplier discovery, quotation collection, compliance screening and purchase-order drafting. If compliance screening fails, the workflow can resume from verified quotations instead of repeating every search and potentially producing a different supplier list.
Checkpoint frequency is a tradeoff. Saving state after every model token or minor tool call creates storage overhead and operational noise. Saving only at the end makes recovery expensive and can repeat side effects. A useful rule is to checkpoint before and after any action that is costly, irreversible, externally visible or dependent on volatile data. Sending an email, updating a CRM record, placing an order and transferring funds all qualify. Read-only retrieval usually does not, unless the result is expensive to obtain or likely to change.
State must also distinguish planned actions from committed actions. Suppose an agent times out while creating a £4,000 advertising campaign. On restart, it must not assume the campaign failed and create a duplicate. Store an idempotency key before the call, then query the platform using that key after recovery. The checkpoint should record an ambiguous state such as ‘submission attempted, confirmation unknown’, forcing reconciliation before another write. This pattern prevents retries from turning transient faults into duplicated charges or communications.
Retry Selectively, With Limits and New Information
Retries are appropriate for transient failures, not flawed reasoning. A 503 response, dropped connection or rate-limit error may justify another attempt. A rejected payment, missing permission or invalid customer identifier usually does not. Classify errors into retryable, non-retryable and ambiguous categories, and make the classification visible in telemetry. Blindly repeating every failed step wastes tokens, increases latency and can amplify damage.
For infrastructure errors, use exponential backoff with jitter: for example, retry after roughly 2, 5 and 12 seconds rather than sending three immediate requests. Cap attempts and total elapsed time. A customer-facing workflow may tolerate two retries within eight seconds; an overnight data-enrichment job might accept five attempts over 20 minutes. The objective is not to maximise completion at any cost, but to protect upstream systems and preserve a predictable service level.
Model retries should change something material. Repeating the same prompt at the same temperature often produces another version of the same mistake. A second attempt might include the validation error, reduce the available tools, request structured output or switch to a stronger model. If an agent generates malformed JSON, feed back the precise schema violations once. If it fails again, use a deterministic repair function or escalate. Set separate budgets for model calls, tool calls, money and wall-clock time so that a looping agent cannot consume £30 solving a task worth £3.
Build Fallbacks That Degrade Capability Safely
A fallback is not simply a cheaper or different model. It is an alternative path that preserves the most important user outcome when the preferred path is unavailable. If semantic search fails, a support assistant might use keyword search over approved documentation. If live shipping rates are unavailable, a checkout agent can present a conservative estimate and defer final confirmation. If document extraction confidence falls below 90 per cent, the system can capture only clearly identified fields and place the remainder in a review queue.
Fallbacks should reduce authority as uncertainty increases. An agent that normally drafts and sends appointment reminders might, during a CRM outage, draft messages without sending them. A finance workflow that cannot verify tax treatment should calculate a provisional total but block payment. This principle of graceful degradation keeps useful work moving while preventing uncertain data from crossing consequential boundaries.
The tradeoff is complexity. Every fallback path adds code, tests, monitoring and policy decisions. Prioritise fallbacks using expected loss: failure probability multiplied by business impact. A secondary OCR provider may be justified when 40,000 invoices arrive each month and the primary service has 0.5 per cent downtime. Maintaining three interchangeable summarisation models may not be worthwhile if a delayed summary has little cost. Test fallbacks under realistic load; a backup service that shares the same cloud region, identity provider or rate limit is not genuinely independent.
Treat Permissions as a Dynamic Safety Boundary
Agent permissions should be narrower than user permissions. A sales employee may be authorised to issue a £2,000 discount, but an autonomous agent acting on that employee’s behalf should not inherit the full capability by default. Grant access per task, tool and duration. A support agent might read order history, draft a response and issue refunds up to £50, while refunds above that threshold require approval. Credentials should be short-lived and scoped to specific operations wherever the underlying platform allows it.
Risk should determine the level of autonomy. Read operations are generally easier to reverse than writes; drafts are safer than publication; internal updates are safer than customer-facing commitments. Define tiers such as observe, recommend, prepare, execute with approval and execute autonomously. Promotion between tiers should depend on evidence from monitored production performance, not enthusiasm after a successful demonstration. An agent that achieves 97 per cent accuracy may still be unsuitable for an action where the remaining 3 per cent could expose personal data.
Permissions also need runtime checks. Before a tool executes, a policy layer should evaluate the action, target, amount, data classification and current workflow state. The model should not be responsible for enforcing its own limits. If an agent requests export of 25,000 customer records after being asked to summarise one account, the policy engine must reject the call regardless of the model’s explanation. Log both allowed and denied actions; repeated denials often reveal prompt injection, faulty planning or permissions that do not match the task.
Escalate to Humans With a Usable Case File
Human escalation is a recovery mechanism, not an admission that automation failed. The important question is whether the handoff arrives early enough and contains enough evidence for a person to act. Escalation triggers can include low confidence, conflicting records, exhausted retries, policy exceptions, unusually high value or explicit customer distress. Combine hard thresholds with anomaly signals. A refund above £100 may always require review, while ten refunds to the same address within an hour may trigger review regardless of amount.
Do not hand a reviewer a transcript containing 80 opaque model messages. Provide a concise case file: the user’s objective, verified facts, actions already taken, unresolved questions, relevant source links, proposed next step and the exact decision required. Highlight uncertainty rather than burying it. For example: ‘Supplier bank details differ from the previous invoice; no payment was initiated; confirm whether to update the beneficiary.’ A structured handoff can reduce review time from several minutes to under one minute and makes audit sampling practical.
Design service levels for the queue. If urgent escalations wait six hours, the workflow has not recovered gracefully. Route by risk and required expertise, show reviewers ageing and business impact, and allow them to approve, amend, reject or return the task with guidance. Capture those decisions as labelled operational data, but do not automatically train on every correction. Human choices can be inconsistent or policy-specific; they should be reviewed before becoming future agent behaviour.
Validate Outcomes, Not Just Successful Calls
A tool returning HTTP 200 does not prove the workflow succeeded. The agent may have updated the wrong record, retrieved stale data or generated a technically valid document with contradictory totals. Add postcondition checks around consequential actions. After scheduling a meeting, confirm the attendees, timezone and calendar identifier. After updating an inventory record, read it back and compare the quantity. After producing a report, reconcile cited figures against source data and ensure totals fall within expected ranges.
Use deterministic validation wherever possible. Schemas, type checks, database constraints, duplicate detection, arithmetic reconciliation and allow-lists are cheaper and more dependable than asking another model whether an output ‘looks right’. Model-based evaluators are useful for qualitative properties such as tone or completeness, but they should not be the sole gate for financial, legal or security-sensitive actions. For high-risk workflows, require independent evidence from two sources rather than two opinions from similar models.
Define recovery metrics beyond task completion. Track the percentage of runs recovered automatically, median retries per task, duplicate side effects, escalation rate, reviewer reversal rate, time to recovery and cost per successful outcome. Segment these measures by tool, workflow version and failure class. A 92 per cent completion rate can conceal a serious regression if 6 per cent of completions required incorrect writes to be repaired later. Reliability reporting should distinguish clean success, recovered success, human-assisted success and unresolved failure.
Exercise the Failure Paths Before Production Does
Recovery logic that has never been tested is documentation, not resilience. Run fault-injection exercises against staging and carefully controlled production environments. Force API timeouts, malformed responses, expired credentials, partial database writes, model refusals and contradictory source documents. Interrupt workflows immediately before and after side effects to verify that checkpoints and idempotency controls work. Red-team prompts that attempt to override permissions or persuade the agent to reveal restricted data.
Create a compact failure matrix for each workflow. List the critical step, likely fault, detection method, permitted retries, fallback, escalation owner and maximum recovery time. Then test the highest-impact combinations. Individual components may recover correctly while their interaction fails: a timeout triggers a retry, the retry triggers a rate limit, the fallback lacks permission, and the escalation queue receives no context. End-to-end drills expose these chains.
Release changes progressively. Start with shadow mode, where the agent recommends actions without executing them; move to a small percentage of low-risk traffic; then expand only when recovery metrics remain stable. Keep a kill switch that disables writes while preserving observation and drafting. The strongest agentic systems are not those that avoid every error. They are those that make errors visible, stop them crossing safety boundaries, preserve completed work and return control to the right person before a recoverable incident becomes a business failure.
Comments (0)
Discussion is opening soon. Be the first to comment.