liveBook · Manning

Chapter 6: Action: How your agent acts is where strategy meets consequences

What you will learn in chapter 6 of Designing AI Agents

The introduction shows why a state-changing agent action must be judged by its bounded, verified real-world effect rather than by a successful tool response.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction shows why a state-changing agent action must be judged by its bounded, verified real-world effect rather than by a successful tool response.

Key terms: tool call, verified task result, intended viewer, prompt injection, task data, transaction record, authorized payment, actual transfers

6.1 What is action?

Action turns a proposed decision into an external interaction, but completing a task depends on the resulting effect and its task-specific acceptance signal.

Key terms: Perception-Reasoning-Action loop, reasoning, Action, external system, tool call, resulting effect, acceptance signal, intermediate evidence

6.1.1 Success has layers

This section explains why an agent’s success report is not proof of completion and why acceptance evidence must fit the task, including read-only work.

Key terms: SUCCESS, acceptance signal, system of record, read-only work, state-changing actions, requested evidence

6.1.2 The action gap

This section defines the gap between proposing an action and establishing an authorized, accepted effect, then introduces the action contract and records that help close it.

Key terms: action gap, accepted effect, well-formed function call, action contract, intended effect, execution boundary, state basis, execution rule, commit identity, contract

6.1.3 Risk follows the effect

This section explains why action risk depends on an agent’s reachable effects rather than its number of steps or its ability to call a tool.

Key terms: effect, shared or durable state, step count, reachable tools, privileges, and effects, native tool calling, schema, transport problem, scope, freshness, idempotency

6.1.4 Four ways to constrain action

This section explains that Action patterns should be chosen for the task rather than stacked by default, and that action succeeds when the task’s external effect is accepted.

Key terms: Action patterns, action gap, Prompt Chaining, Tool Dispatch, Guardrail Sandwich, accepted external effect, acceptance signal, receipts

6.2 Pattern: Prompt Chaining

Prompt Chaining organizes a stable action sequence around named artifacts and gates that check each handoff before work continues.

Key terms: Prompt Chaining, named artifact, gate, Action × Chain, bounded retry, schema, provenance, retry, escalation, downstream escape

6.2.1 The seam is the design surface

This section shows how a prompt chain uses explicit handoff artifacts and evidence-limited gates to keep a code repair from advancing without sufficient verification.

Key terms: Prompt Chaining, artifact contract, failure artifact, diagnosis artifact, patch artifact, verification artifact, gate, verification evidence, parser, repository check

6.2.2 Build artifacts before retries

This section shows how a prompt chain packages intermediate artifacts, gates them before downstream use, and verifies patch evidence through trusted sources.

Key terms: artifact, gate result, source references, repair guidance, chain runner, accepted, gate, budget, downstream, patch gate

6.2.3 Retry only when something changes

This subsection explains when a rejected Prompt Chaining stage merits a retry and when retrying is the wrong form of recovery.

Key terms: gate rejection, new information path, retry, retry budget, stage, external effect, Plan-and-Execute, Guardrail Sandwich

6.2.4 When Prompt Chaining breaks

This section explains four ways Prompt Chaining fails and how to recognize when to keep stages together, tighten handoffs, validate earlier, or choose another pattern.

Key terms: meaningful handoff, artifact, serialization, complete prior transcript, smallest accepted artifact, evidence, end-only validation, earliest seam, old revision, Prompt Chaining

6.3 Pattern: Tool Dispatch

Tool Dispatch lets an agent choose an action capability at runtime while the runtime controls which tools are available and whether the chosen action may execute.

Key terms: Tool Dispatch, eligible set, model selection, admission, Action × Route, executable surface, registry, handlers, authority, freshness

6.3.1 Eligibility comes before selection

This section explains how Tool Dispatch limits what an agent may choose before the model selects a tool, then checks the proposed call before execution.

Key terms: Tool Dispatch, eligible surface, Minimal Tool Set, admission, authority, provenance, state freshness, protected task state

6.3.2 Reveal capability in layers

This section explains how to reveal tool capabilities without overloading context and how to choose an action interface without confusing visibility with permission.

Key terms: context pressure, selection noise, tool or Skill contract, progressive disclosure, progressive authority, admitted, eligible, executable, typed API, admitted Skill

6.3.3 Build the executable surface

This section shows how Tool Dispatch turns tool selection into a controlled execution path with runtime-owned authority, admission checks, and safe handling of uncertain state-changing calls.

Key terms: tool contract, effect, granted effects, protected_args, registry, candidate set, summaries, selector, admission, stable argument snapshot

6.3.4 When Tool Dispatch breaks

This section identifies four ways Tool Dispatch fails: unenforced tool catalogs, unchecked arguments, silent fallback to broader tools, and work that needs a persistent plan rather than a single route.

Key terms: Tool Dispatch, catalog, executable allowlist, imported content, candidate reduction, admission, argument provenance, protected state, execution boundary, silent fallback

6.4 Pattern: Plan-and-Execute

The section introduces Plan-and-Execute as an action pattern for coordinating work that cannot safely restart from the beginning.

Key terms: Plan-and-Execute, task-level plan, executor, shared execution state, Action × Orchestrate, unqualified restart, partial completion, external effects, acceptance evidence, step status

6.4.1 The interruption test

This section uses an interruption test to show when an execution plan needs durable state and how recovery should handle uncertain effects.

Key terms: interruption test, durable execution record, execution plan, unknown outcome, accepted external effect, pending region

6.4.2 Make the plan an execution record

This section explains how a plan becomes a durable execution record by keeping references current, gating steps on accepted dependencies, and verifying completion.

Key terms: recovery baseline, stable object references, mutable values, DONE, acceptance contract, accepted dependencies, runtime-owned verifier, plan graph, compare-and-set, transactional event store

6.4.3 Persist before asking the model to remember

This section explains how a persistent checkpoint helps an execution plan survive process loss, and why recovery can still repeat an unfinished task.

Key terms: in-memory graph, JSON checkpoint, single writer, persistent checkpointer, checkpoint boundaries, replays forward, exactly-once side effects

6.4.4 Recover effects before retrying calls

This section explains how to recover a workflow step when an external action may have succeeded before its result was saved locally.

Key terms: external commit, job receipt, step state, VERIFYING, commit identity, DONE, retry path, human review, request tokens, idempotency

6.4.5 Keep replanning local

This section limits replanning after an execution failure to affected unfinished steps and separates local recovery from changes to the shared production workflow.

Key terms: local replan, affected set, pending, failed, invariants, shared production workflow, versioned design and governance event, local recovery

6.4.6 When Plan-and-Execute breaks

This section explains when Plan-and-Execute fails and when its state machinery is not worth using.

Key terms: plan, external effects, model context, persist state, DONE, acceptance evidence, state, accepted work, uncertain effects, pending subgraph

6.5 Pattern: Guardrail Sandwich

This section introduces the Guardrail Sandwich as a higher-trust boundary around state-changing actions and identifies when and how to apply it.

Key terms: Guardrail Sandwich, pre-check, controlled executor, post-check, Action × Hierarchy, facade, agent's writable state, runner arguments, protected business evidence

6.5.1 Return to the payroll result

The section uses a duplicate payroll payment to show why guarded action needs checks before and after execution, with verification independent of the model.

Key terms: durable identity, per-request idempotency, recorded outcome, provider receipts, reconciliation, compensation obligation, admission, controlled execution, effect verification, preconditions

6.5.2 Admission, containment, and verification

Distinguishes controls that admit or contain an action from checks that verify its intended effect, using code repair as an example.

Key terms: permission rules, PreToolUse hooks, sandbox, admission, synchronous hook, asynchronous hook, Guardrail Sandwich, verifiers, publication effect, functional correctness

6.5.3 Build a fail-closed guarded path

This section shows how a guarded executor fixes checks in the tool contract, records uncertain outcomes conservatively, and distinguishes its control path from a security sandbox.

Key terms: registered tool, guards, pre- and post-checks, structured evidence, typed runner failure, unknown, failed, compensation obligation, post-check, audit record

6.5.4 Verify the effect, not the story

The section shows how payroll guards verify a reserved commit against a trusted receipt of the actual effect, and where that verification stops.

Key terms: pre-check, post-check, reserved commit digest, settled receipt, protected state, trusted provider adapter, authoritative systems, commit identity, authorization, reconciliation

6.5.5 When the Guardrail Sandwich breaks

This section explains how the Guardrail Sandwich fails when controls can be bypassed, containment or filtering is mistaken for verification, or a failed post-check is treated as a rollback.

Key terms: runtime chokepoint, registered contracts, hooks, containment, domain postcondition, output filtering, information-release checks, business-effect checks, blocked post-check, rollback

6.6 Composing action patterns

This section shows how to combine action patterns around the specific failure points of a cross-repository change, without treating them as a fixed stack.

Key terms: seams, pressure, effect, failure terrain, Plan-and-Execute, Prompt Chain, Tool Dispatch, Guardrail Sandwich, versioned dependency graph, plan nodes

6.7 Testing the Action boundary

This section shows how to test whether an agent completes intended actions while keeping failures and unintended effects bounded.

Key terms: legitimate completion, bounded failure, Action test, evidence bundle, expected diff, verifier execution, verifier result, independent health probe, failure injections, boundary

6.8 Argus checkpoint: Action

This checkpoint shows how Argus routes executable calls through admission and guards, records what happened, and keeps the limits of that implementation explicit.

Key terms: policy-filtered tool catalog, registry, dispatch chokepoint, GuardedTool, Action attempt, Action trace, accepted effect, post-check evidence, Prompt Chaining, versioned plan records

6.9 Summary

6.10 References

This section lists sources and companion resources for the chapter’s action patterns without explaining new concepts.

Where this is used later

Concepts explained in this chapter

← Chapter 5: Reasoning: How your agent decides what to do next Chapter 7: Reflection and evaluation: How your agent audits and learns from itself →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.