Skip to content
Duoduo Mediaevidence to decision

Package 22 · Section 10.1

Agents Workflows and Tool Reliability

Use agentic behavior only where dynamic planning adds value and constrain it with observable workflows.

Track
G · Safety, governance and production delivery
Level
Advanced
Version
v1.0
Status
In validation · catalog only
Explanation depthDepth

Learning objectives

  • Distinguish deterministic workflows from agents.
  • Design tool schemas, state, retries, checkpoints and approvals.
  • Evaluate multi-step success and recoverability.

In brief

Agents that call tools can take actions, not just produce text. Reliability comes from constrained tools, explicit workflows, idempotent operations, verification steps and human approval at the right points.

Core concepts

22.1Workflows versus open agents

A workflow fixes the sequence of steps and lets the model fill specific slots. An open agent chooses its own steps. Workflows are easier to test and audit; agents handle more variety.

Start with a workflow and allow agentic choice only where variety justifies it.

22.2Tool design

Give tools narrow scopes, typed inputs, clear errors and least-privilege credentials. Separate read tools from write tools, and require confirmation for writes with external effects.

Make write operations idempotent with request keys so retries do not duplicate actions.

22.3Verification and recovery

After each step, verify the result against expectations: did the record update, does the total match? On failure, retry with backoff, fall back or stop and escalate.

Budget steps, tokens and time. Log every tool call with inputs and outputs.

Worked example

Preventing duplicate purchase orders

Situation: An agent creates two POs after a timeout and retry.

  1. 1Trace shows the first call succeeded but the response timed out.
  2. 2Add an idempotency key derived from request ID to the create-PO tool.
  3. 3Add a verification step: query open POs before reporting success.
  4. 4Require human approval for POs above the delegated limit.

Outcome: Retries no longer duplicate orders, and chaos tests with injected timeouts pass 500 of 500 runs.

Decision rules

  • Prefer fixed workflows; add agent autonomy only where needed.
  • Every write tool must be idempotent.
  • Verify after every action with external effect.
  • Require approval for irreversible or high-value actions.
  • Cap steps, tokens and time per task.

Common pitfalls

  • One broad tool with admin credentials.
  • Assuming a timeout means the action did not happen.
  • Unbounded loops when a tool keeps failing.

Key vocabulary

Idempotency
Property that repeating an operation has the same effect as doing it once.
Least privilege
Granting only the permissions a tool needs for its task.
Step budget
The maximum number of actions an agent may take per task.
Chaos test
Injecting failures such as timeouts to test recovery behavior.

Tutorial outline

  1. 22.1Plan-and-execute, ReAct and graph workflows.
  2. 22.2Tool validation, idempotency, timeout, circuit breakers and compensation.
  3. 22.3Memory scope, context compression and multi-agent coordination.

Required artifacts

Workflow graph, tool contracts, failure traces, recovery policy and comparison report.

Evaluation evidence

Task success, tool accuracy, recovery rate, unauthorized-action rate, latency and cost.