ChangeGamer

← All guides · Agent reliability in production

Agent Guardrails and the AI Agent Reliability Playbook

Pillar guide · 5,776 words · ~26 min read · published 2026-08-25 · updated 2026-09-04 · Markdown variant

Agent guardrails plus the eleven other disciplines that make an AI agent reliable in production: tool calling, retries, durable execution and rollout.

In short

  • AI agent reliability is not one property but a stack of twelve disciplines — tool-calling contracts, structured outputs, retries, idempotency, timeouts, durable execution, guardrails, CI evaluation, observability, incident response, staged rollout, and circuit breakers — and a demo agent that skips most of them will fail in ways a single-turn chatbot never does.
  • Tool-call reliability starts with strict schema enforcement: OpenAI strict mode, Anthropic tool strict: true plus Structured Outputs, and Gemini ANY-mode function calls each physically constrain decoding so the model cannot emit a schema-violating call, as documented as of August 2026 in the reliable-tool-calling reference.
  • Every side-effecting tool call an agent makes needs an idempotency key derived from the run ID and step index, not from wall-clock time or a fresh random value, so a retry after a crash or a rate-limit backoff lands as a no-op instead of a duplicate charge or duplicate email.
  • A durable execution engine — Temporal, Restate, DBOS, Inngest, or a cloud-native equivalent — is the correct tool for any agent task that spans more than one process lifetime, because it persists a checkpoint log and resumes from the last completed step instead of restarting from zero after a crash.
  • Production readiness for an agent means its evaluation, observability, guardrails, and rollback all work independently of which underlying model is running, with a canary release and automatic rollback on behavioral regression rather than only on crashes.
  • Incident response for an agent needs a written runbook per failure class before go-live — runaway cost, prompt regression, tool outage, security incident — because an agent that fails without a pre-defined response burns budget and trust in the minutes before anyone notices.

What are agent guardrails, and what does "reliable" mean for an AI agent?

Agent guardrails are runtime checks — on input, on the model's output, and immediately before a tool call fires — that enforce policy regardless of what the underlying model happens to produce on a given call. They are one of twelve disciplines that make an AI agent reliable: predictable and recoverable under the failure conditions that are certain to occur — malformed model output, a rate-limited API, a crashed process, a bad code deploy — not merely working on a demo run. Chat-completion reliability and agent reliability are different disciplines. A single-turn chatbot fails softly: a bad response is annoying but bounded. An agent fails compoundingly: a hallucinated tool call executes against a real system, a missed retry duplicates a database write, a crash mid-workflow loses hours of progress, and a bad deploy propagates to every user before anyone notices. Reliability engineering for agents is the set of mechanical safeguards that convert those compounding failures into bounded, recoverable, observable ones.

This guide treats reliability as a stack of twelve disciplines, roughly in the order a request travels through an agent and then through its release pipeline:

  1. Tool-calling contracts — does the model reliably call the right tool with valid arguments?
  2. Structured outputs — when you need a schema-valid final answer instead of a tool call, does the provider guarantee it?
  3. Retries and rate limits — how does the agent behave when a provider or tool returns a transient error?
  4. Idempotency — do retries and crash-recovery replays avoid duplicating side effects?
  5. Timeouts — how long does a step wait before the system gives up and reacts?
  6. Durable execution — does a long-running task survive a crash or restart?
  7. Guardrails — does the agent's behavior stay within policy regardless of what the model outputs?
  8. Evaluation in CI — is reliability measured and gated before every change ships?
  9. Observability — can you reconstruct what an agent did and why, after the fact?
  10. Rollout — does a new version reach production gradually, with automatic rollback?
  11. Incident response — does the team have a pre-written response for each failure class?
  12. Circuit breakers and degraded mode — does the system fail fast and gracefully instead of stalling or cascading?

None of these is exotic engineering; each has a standard pattern documented in the reference corpus this guide draws from. What changes production outcomes is doing all twelve deliberately instead of discovering the gaps one incident at a time.

Why do tool-calling contracts matter more than prompt engineering?

Tool-calling contracts matter more than prompt engineering because a single malformed tool call turns an otherwise-working agent step into an error-handling problem downstream, and no amount of prompt polish eliminates that risk the way schema enforcement does. As of August 2026, every major provider offers some form of constrained decoding that physically restricts which tokens the model can emit for a tool call or a structured final answer, rather than merely asking nicely: OpenAI's strict mode requires every object to set additionalProperties: false and every property to appear in required; Anthropic supports strict: true on individual tool definitions plus a separate Structured Outputs mechanism (output_config) for the final reply; Google Gemini forces compliance through ANY-mode function calls or a responseSchema/responseJsonSchema config; and self-hosted models push the same guarantee down to token sampling via grammars such as GBNF (llama.cpp), XGrammar (the default backend for vLLM, SGLang, TensorRT-LLM, and MLC-LLM), or Outlines.

Known failure modes and fixes

Even with constrained decoding enabled, real failures still recur in predictable shapes: a hallucinated tool name outside the declared set, a missing required argument, extraneous fields, unparsable JSON when strict mode isn't enabled, wrong field types, over-calling or under-calling tools, and out-of-order parallel calls with unstated dependencies. Each pairs with a known fix — validate the returned tool name against your schema before executing, enforce required/additionalProperties: false, strip unknown keys defensively, wrap parsing in try/catch with a retry-and-repair loop that sends the validation error back to the model as a correction request, prefer enums and const values over free-text fields, and set disable_parallel_tool_use: true (Anthropic) or force sequential tool_choice when call order matters. The Berkeley Function Calling Leaderboard (BFCL), maintained by the Gorilla team at UC Berkeley, is the standard benchmark for this failure class, scoring both single and simultaneous tool calls via AST comparison; its fourth iteration (current as of August 2026) folds in multi-step agentic tasks rather than testing isolated calls only. The full failure-mode table and mitigation reference lives in reliable tool calling and structured outputs.

The cross-cutting mitigation that matters most in practice: keep schemas shallow with a minimal set of required fields. Every optional field is a reliability risk, because it is one more place the model can omit, mistype, or hallucinate a value — a lesson that shows up just as often in MCP tool handlers as in first-party function calling (see common MCP server failure modes for the crash-recovery and malformed-call-handling side of this same problem at the protocol layer).

When should you use structured outputs instead of tool calling?

Use structured outputs when you need the model's own final answer in machine-parseable form and use tool calling when you need the model to invoke an external function — the two mechanisms are orthogonal and can be required together or separately. Tool calling produces an intermediate instruction for your application to execute (a named function plus arguments); structured outputs constrain the model's concluding response itself into a schema-valid object, with no function invoked. A classification task that just needs {"category": "billing", "confidence": 0.92} back from the model wants structured outputs, not a tool call; an agent that needs to actually query a database or send an email wants a tool call.

The provider mechanisms differ in what schema subset they support, which matters when you design a contract meant to survive a provider swap:

Provider Mechanism Strict guarantee anyOf Recursion
OpenAI (gpt-4o 2024-08-06+, GPT-4.1, GPT-5, o-series) response_format: json_schema, strict: true Yes Root-level not allowed; use nullable type unions No (depth cap)
Anthropic (current models, GA as of August 2026) output_config.format: json_schema Yes Yes No
Gemini 1.5 / 2.0 responseSchema (OpenAPI subset) Subset only No No
Gemini 2.5+ responseJsonSchema (full JSON Schema) Yes Yes Limited
vLLM / SGLang (XGrammar) guided_json Yes Yes Yes
llama.cpp grammar (GBNF) Yes Via grammar Yes

Two failure modes catch teams even under a strict-mode guarantee. First, truncation and refusal bypass the schema: a response cut off by stop_reason: "max_tokens" or an explicit safety refusal is not schema-compliant even though strict mode was enabled, so always check the stop reason as a first-class error branch rather than assuming a 200 response means a valid object. Second, first-request latency rises from grammar compilation the first time a new schema is used — mitigate with a warm-up call and by avoiding frequent schema churn. OpenAI now treats plain JSON mode (json_object) as legacy precisely because it only asks for syntactically valid JSON with no schema enforced; prefer json_schema with strict: true wherever the provider supports it. The full per-provider schema-subset comparison is in structured outputs and JSON mode.

How should an agent handle retries and rate limits?

An agent should treat a 429 (Too Many Requests) as a signal to honor the provider's Retry-After header and wait that long before retrying — never retry immediately, and never treat rate limits as a bug to route around rather than a budget to respect. Provider limits stack across at least three windows: requests per minute (RPM), tokens per minute (TPM, sometimes split into separate input/output limits as Anthropic does), and a daily ceiling (TPD/RPD) that overrides any remaining per-minute headroom. Both OpenAI and Anthropic loosen these ceilings as account spend and age grow through numbered usage tiers, but exact thresholds shift over time — check your provider dashboard rather than hard-coding a number, and request a tier increase ahead of need rather than reacting to production 429s.

The standard backoff pattern is exponential backoff with full jitter — randomizing the wait uniformly between zero and an exponentially growing cap, while always enforcing the provider's mandated Retry-After as a hard floor:

MAX_RETRIES = 7
BASE_DELAY  = 1      # seconds
CAP_DELAY   = 60     # seconds

def call_with_backoff(request):
    for attempt in range(MAX_RETRIES):
        response = send(request)
        if response.status != 429:
            return response
        floor = int(response.headers.get("Retry-After", 0))
        ceiling = min(CAP_DELAY, BASE_DELAY * 2 ** attempt)
        wait = max(floor, random_uniform(0, ceiling))
        sleep(wait)
    raise RateLimitExceeded("max retries reached")

Full jitter matters at fleet scale: without it, many retrying clients synchronize their backoff schedules and hammer the API in the same instant, turning a transient rate limit into a retry storm. Before ever reaching a 429, well-behaved agents self-throttle proactively — track a local token budget from the *-remaining response headers, cap concurrent in-flight requests with a semaphore, and pre-estimate token cost to hold back requests that would exceed remaining headroom. Not every error deserves a retry: distinguish transient failures (network timeout, 429, 5xx) that should retry with backoff from terminal failures (400 bad request, business-logic error) that should escalate immediately — retrying a malformed request forever just delays the failure. For high-volume, non-interactive workloads — evals, bulk summarization, embedding a large corpus — both major providers offer a batch API on a separate rate-limit pool at roughly half the per-token price with same-day turnaround; it is the wrong tool for a latency-sensitive interactive agent but the right one for the CI evaluation suite discussed later in this guide. See handling rate limits and retries for the full header reference and tier-advancement details.

Why does idempotency matter more for agents than for a simple API call?

Idempotency matters more for agents than for a stateless API call because an agent retries far more often — after rate limits, after transient tool errors, and after crash recovery — and every one of those retries risks re-executing a side effect that already happened. A crash can leave a step mid-flight, and a naive retry (or a durable-execution replay, discussed below) may attempt that step a second time. If the step is a database write, a payment charge, or an outbound email, a duplicate attempt is a duplicate side effect — a double charge, a double email, a corrupted counter.

The standard fix is a stable idempotency key derived from the workflow run ID and step index — never from wall-clock time or a freshly generated random value, both of which change on every retry and therefore cannot deduplicate anything. Pass that key to the downstream service (most payment, email, and messaging APIs accept an idempotency-key header) so a duplicate call becomes a no-op instead of a duplicate effect. This single pattern is the difference between "the agent retried and it worked" and "the agent retried and now the customer has two invoices," and it applies whether the retry originates from your own backoff loop, from a durable execution engine's crash recovery, or from an MCP client resending a tool call after a timeout.

What timeout should an agent use for a tool call or LLM step?

Every step in an agent's execution — an LLM call, a tool call, a sub-agent hop — needs an explicit timeout tied to what a reasonable worst case looks like for that specific operation, not a single global value copied across every step; no universal number exists because the right timeout depends entirely on what the step does. A timeout that is too short cancels legitimate slow operations (a large document extraction, a complex database query) and converts them into retries that compound latency; a timeout that is too long lets one stuck dependency stall an entire agent run and burn budget while nobody notices.

Two design choices compound with timeouts and are worth setting deliberately rather than defaulting:

Durable execution engines (next section) make per-step timeout policy — maximum attempts, initial interval, backoff multiplier, and a non-retryable error list — a first-class configuration rather than something reimplemented ad hoc in each workflow, as detailed in durable execution for long-running agents.

What is durable execution and when do you actually need it?

Durable execution is the programming model that lets a long-running agent workflow survive a crash, a restart, or a wait for human approval by persisting every meaningful step to a log before moving on, so that on resume the engine reconstructs state from stored records instead of re-executing real-world actions a second time. You need it for any agent task that can outlive a single process lifetime — a workflow that pauses for human approval, that runs for minutes to hours across multiple tool calls, or that must survive a server restart without losing progress. You do not need it for a short-lived, single-turn agent call that completes within one request handler in seconds; that case still needs ordinary retry and timeout handling, just not a checkpoint log.

Two constraints make durable execution work correctly, and violating either one is the most common way teams misuse it:

Current engines fall into four architectural shapes, and the right choice usually follows existing platform commitment rather than an abstract feature comparison:

Situation Recommended approach
Already on AWS AWS Step Functions (Standard Workflows) — managed state machine, native integration
Already on Azure Azure Durable Functions — event-sourcing model, first-party
Already on GCP GCP Workflows — managed state machine, callback-based human-in-the-loop
Already on Cloudflare Workers Cloudflare Workflows — Durable-Object-backed, co-located with edge compute
Need portable, code-first durability; willing to self-host Temporal (mature, large ecosystem), Restate (lighter, suspension-native), or DBOS (Postgres-only dependency)
Managed serverless, TypeScript/JavaScript-first Inngest — step memoization, official self-hosting path also now exists
Already using LangGraph LangGraph checkpointers + interrupt() — lighter-weight, single-graph fault tolerance, not full cross-service orchestration
Already using OpenAI Agents SDK, need memory continuity but not crash-resume Agents SDK Sessions — simplest path; add a dedicated engine if mid-run durability is required

A durably parked workflow — one suspended on an external signal such as a human approval or a webhook — consumes no compute while waiting and restores full state the instant the signal arrives. This is architecturally distinct from a polling loop or a sleeping thread, and it is the mechanism that makes human-in-the-loop approval gates (see guardrails, below) actually durable rather than a fragile in-memory wait with a timeout attached.

How do guardrails keep an agent's behavior reliable, not just safe?

Guardrails keep an agent's behavior reliable by enforcing policy at runtime regardless of what the underlying model happens to output on a given call, which matters for reliability specifically because model behavior is inherently variable across calls even at fixed settings. In reliability terms — as distinct from the security-hardening question of defending against an adversarial attacker, which belongs to a different discipline — the guardrail question is simpler: does the agent behave correctly and predictably, and does a tool call that would produce an incorrect or unapproved action get stopped before it executes rather than after?

Guardrails apply at three checkpoints, each catching a different reliability failure:

No single check catches everything a model might produce, so the practical pattern layers cheap, fast checks (regex and deterministic validators for format and known patterns) underneath slower, more thorough ones (a classifier for known categories, an LLM-as-judge for nuance), and defaults to blocking or escalating when a check is uncertain rather than defaulting to allow. Every guardrail verdict — allowed or blocked, which rule fired, what score it produced — should be logged against the run's trace ID, both to debug false positives that degrade usability and false negatives that provide false confidence, and to feed the observability discipline covered next. A single tool call should touch at most two of three properties — processing untrusted input, accessing a sensitive system, or changing external state — never all three at once; a call that would touch all three (say, acting on instructions found in a scraped web page to modify production data) is exactly the shape of action that belongs behind a human-approval gate rather than autonomous execution. The full checkpoint taxonomy and tooling landscape is in guardrails and safety filters for agents.

How do you evaluate whether an agent is reliable enough to ship?

Evaluating agent reliability requires scoring multi-step trajectories against your own task distribution, not a single-turn response or a public benchmark alone, because a model that scores well on a chat benchmark can still fail badly as an agent if it cannot recover from tool errors, maintain state across steps, or complete long-horizon tasks consistently. Three properties distinguish agent evaluation from ordinary LLM evaluation:

Public benchmarks — SWE-bench for software-engineering tasks, GAIA for cross-tool generalist reasoning, BFCL for tool-call correctness, WebArena for web navigation, and others — are useful proxies but reliably diverge from production performance, so build an eval suite against your own task distribution and guard against benchmark contamination rather than shipping on leaderboard position alone. For tool-call correctness specifically, exact-match or AST-based comparison against a reference answer is more reliable than LLM-as-judge, which carries known biases (position bias, verbosity bias, self-preference when a model judges its own family's output) — reserve LLM-as-judge for open-ended subjective quality and use ground-truth matching for anything with a checkable structure. See evaluating AI agents for the full benchmark reference table.

Testing agents in CI without flaky, expensive builds

Testing an agent in CI resolves the tension between non-deterministic models and deterministic pipelines by testing different layers at different levels rather than trying to make every test reproducible end to end. A three-layer pyramid works in practice: Layer 1 is ordinary deterministic unit tests of the code around the model — tool functions, parsers, schema validators, retry logic — with the LLM client mocked entirely, run on every commit. Layer 2 uses cassette/VCR-style recorded fixtures: the first run hits the real API and serializes the exchange to a committed file; every subsequent run replays it, fast and network-independent, re-recorded only when prompts or schemas change. Layer 3 is a small, hand-curated set of live smoke tests against the real model, gated on a separate nightly or pre-release CI job rather than per-commit, because they are inherently slower and flakier and should never block a PR.

Two techniques worth calling out because they are commonly misused: setting temperature=0 reduces variance but does not guarantee bit-for-bit identical outputs across runs (floating-point non-associativity from GPU batching and MoE routing still produces different tokens in different batch contexts), so never rely on it as a substitute for mocking or cassette replay; and snapshot testing of tool-call sequences — asserting on the structure and argument values of the expected tool-call trajectory, not on free-text reasoning — surfaces unintended trajectory changes in CI before they reach production. For probabilistic Layer 3 tests, use pass@k thresholds (e.g., pass@5 with at least 4 successes) rather than a single run, and quarantine flaky tests into the nightly suite rather than masking them with automatic retries. See testing AI agents in CI for the tooling reference (VCR.py, pytest-recording, promptfoo, DeepEval).

What should an agent's observability system capture?

An agent's observability system should capture a full trace tree — every LLM call, tool call, retrieval step, and sub-agent invocation as a nested span under one stable trace ID — because flat, timestamped log lines cannot answer "why did the agent do that?" for a non-deterministic, branching run that may fan out into dozens of calls. The OpenTelemetry GenAI semantic conventions (formed by the GenAI SIG in April 2024, still labeled Development status as of July 2026 but already adopted by leading observability vendors) give this a vendor-neutral vocabulary: a trace is one complete agent run identified by a stable trace_id propagated across all child operations including sub-agents, and a span is one discrete operation — an LLM call, a tool call, a sub-agent hop — nested to form the full tree.

At minimum, capture per span: token usage converted into cost, latency for the step and for the overall trace, tool-call inputs and outputs (with PII redacted before logging), and the original exception attached to whichever span failed. Tooling splits between framework-agnostic OTel platforms — Langfuse, Arize Phoenix, OpenLLMetry, Logfire — and tracing built directly into a framework such as LangChain's LangSmith or the OpenAI Agents SDK's built-in trace processor. Stored spans double as raw material for two different feedback loops: sampling a slice of production traces builds evaluation datasets for judge- or metric-based scoring (closing the loop with the evaluation discipline above), and watching the same stream in real time flags anomalous behavior — a spike in tool errors, a cost outlier, a latency regression — as it happens rather than after a user complains. See agent observability and tracing for the OTel GenAI attribute reference and tooling landscape.

How do you roll out a new agent version without breaking production?

Roll out a new agent version by gating the promotion behind your own task-distribution eval suite first, then releasing to a small canary slice of traffic with automatic rollback triggered by metric regression — not only by crashes. Shadow mode, where the new version runs and logs its outputs without serving them to real users, removes rollout risk entirely during initial validation, because you can compare the new version's behavior against the current one on live traffic before any user is exposed to a difference. A canary of roughly 5–10% of traffic then surfaces regressions that shadow mode's non-live conditions might miss, with automated rollback triggers watching for behavioral regression — a lower task success rate, a changed output distribution, a cost spike — rather than only outright errors.

Rollback itself needs to be a fast, tested operation, not an improvised one during an incident:

What happens when an agent fails in production, and how should the team respond?

When an agent fails in production, the team's response should already be written down as a runbook per failure class before go-live, because deciding how to react while an incident is active costs both time and judgment that a pre-written plan preserves. Four failure classes cover most real incidents and each has a standard first response: runaway cost (hard per-session budget plus a kill switch that halts the agent rather than letting spend continue while someone investigates), prompt or behavioral regression (rollback to the previous known-good version plus traffic redirect, using the rollback procedure above), tool or dependency outage (a circuit breaker plus a degraded-mode fallback, covered next), and security incident (revoke credentials, disable the agent, and preserve traces for investigation independent of the production system that might otherwise be part of the compromise).

Two disciplines make every incident in every class resolvable rather than a mystery: preserve traces on incident — the full trace tree from observability, kept accessible for the investigation window even if the production system itself is degraded or rolled back — and run a blameless post-mortem after every production incident, treating the incident as a signal that a guardrail, an eval case, or a monitoring alert was missing rather than as an individual's mistake. The output of a good post-mortem is concrete: a new eval case added to the CI suite that would have caught the regression, a new guardrail rule, or a new alert threshold — closing the loop back into the evaluation and observability disciplines above so the same failure class cannot recur silently. The full ten-dimension ship gate, including rollout and rollback mechanics, is in shipping AI agents to production.

Why do circuit breakers and degraded mode matter for agent reliability?

Circuit breakers and degraded mode matter because a permanently degraded dependency — a downed tool API, an exhausted daily rate limit, a database outage — should make an agent fail fast and predictably rather than retry forever and stall every request that touches it. A circuit breaker tracks the failure rate of a dependency and, once it crosses a threshold, stops sending requests to it for a cooldown period, returning an immediate failure (or falling back to a degraded response) instead of letting every caller independently retry and time out against a service that is not coming back soon. This is the natural complement to the retry-with-backoff pattern described earlier: backoff handles a single transient blip, while a circuit breaker handles a dependency that is down long enough that retrying is actively harmful — it burns budget, delays the caller, and can itself contribute to keeping the downstream service overloaded.

Degraded mode is the fallback behavior a circuit breaker triggers: an agent that cannot reach its primary retrieval index falls back to a cached or smaller-scope answer with an explicit disclosure rather than fabricating one; an agent that cannot reach a preferred model routes to a secondary provider through a gateway rather than failing the whole request; an agent whose reranking stage is down serves unreranked first-stage results rather than blocking. Designing degraded mode deliberately — deciding in advance what "good enough" looks like when a dependency is unavailable — is what separates a system that gracefully loses some quality under partial outage from one that cascades a single dependency's failure into a total outage for every user.

A production reliability checklist

Before calling an agent production-ready, it should survive this list, organized by the twelve disciplines above:

None of these disciplines is exotic in isolation — retries, idempotency keys, canaries, and CI gates are established engineering practice well outside AI. What is specific to agents is that a single request can touch all twelve at once: a tool call that needs a valid schema, a retry budget, an idempotency key, a timeout, a durable checkpoint if it runs long, a guardrail before it fires, an eval case that would catch a regression in it, a trace that explains it after the fact, a canary that limits its blast radius, a runbook if it fails, and a circuit breaker if its dependency goes down. Teams that treat reliability as this full stack, rather than as "retry a few times and hope," are the ones whose agents survive contact with real traffic.

The full agent-reliability cluster

Twelve sub-articles make up the agent-reliability cluster, each going deeper on one discipline than a single pillar reasonably can, and the cluster is complete as of August 2026:

Frequently asked questions

What are agent guardrails?
Agent guardrails are runtime checks — applied at three checkpoints: on input before the model sees a request, on the model's output before the caller sees it, and immediately before a tool call fires — that enforce policy regardless of what the underlying model happens to produce on a given call. They catch different reliability failures at each checkpoint: malformed or off-policy input, schema or groundedness violations in the output, and tool calls outside an allowlist or exceeding safe parameter ranges. The practical pattern layers cheap deterministic checks under slower, more thorough ones such as an LLM-as-judge, and defaults to blocking or escalating a call to a human when a check is uncertain rather than defaulting to allow.
What makes an AI agent unreliable in the first place?
An AI agent becomes unreliable when any of its failure surfaces lacks a mechanical safeguard: malformed or hallucinated tool calls that were never schema-validated, retries that duplicate a side effect because no idempotency key exists, a crash mid-task that loses all progress because there is no durable checkpoint, or a behavioral regression that ships to every user at once because there was no canary. Each of these is a known, named failure mode with a standard fix, not an inherent property of language models.
How do I make tool calling reliable for an AI agent?
Reliable tool calling combines provider-side schema enforcement (OpenAI strict mode, Anthropic strict tool definitions, Gemini ANY-mode function calls, or grammar-based constrained decoding for self-hosted models) with defensive validation on your side — reject unknown tool names, enforce required fields before executing, keep schemas shallow with few required fields, and add a validate-and-resubmit loop that sends validation errors back to the model as a correction request rather than crashing the agent.
What is the difference between retries and idempotency for AI agents?
Retries are the mechanism that resends a failed request after a transient error such as a rate limit or network timeout, using exponential backoff with jitter capped by the provider's Retry-After header; idempotency is the guarantee that resending the same request — whether by your own retry logic or by a crash-recovery replay — never duplicates the underlying side effect, which requires a stable idempotency key derived from the run and step identity rather than from time or a fresh random value.
How do you evaluate whether an AI agent is reliable enough to ship?
Evaluating agent reliability requires running an offline eval suite against your own task distribution — not just public benchmarks — scored on task success rate, tool-call accuracy, cost per task, and run-to-run consistency using multiple trials (pass^k, not a single pass/fail), then gating every promotion behind that suite in CI and rolling the change out behind a canary with automatic rollback on metric regression rather than only on crashes.
Do I need durable execution for every AI agent?
No — durable execution is necessary only for agent tasks that can outlive a single process lifetime, such as workflows that wait on human approval, run for minutes to hours, or must survive a server restart without losing progress; a short-lived, single-turn agent call that completes in seconds within one request handler does not need a durable execution engine, though it still needs ordinary retry and timeout handling.

#agents #reliability #production #tool-calling #observability #evaluation #durable-execution

Put this corpus inside your own agents

This guide is free and stays free. The reference corpus behind it — machine-readable contracts, verified primary sources, continuously refreshed — is the paid product: a €5 starter key unlocks every premium reference for one agent via API; a €25 corpus license delivers the full corpus as RAG / fine-tuning data with an explicit AI-use grant; the €150 enterprise license adds commercial redistribution rights.

Agents: this page as Markdown · JSON · offers at /api/pricing.json · payment methods at /api/payment.json · single-resource access via HTTP 402 (how that works)