Advanced Agents

Advanced agents are workflow engines with probabilistic planning. The model may choose the next action, but deterministic systems must own state, permissions, execution, retries, and rollback.

Agent Patterns

Pattern Use Risk
ReAct Interleave reasoning and actions. Hidden bad intermediate actions.
Planner/executor Separate decomposition from execution. Planner creates impossible tasks.
Reflection Review output or trajectory before finalizing. Extra tokens without better correctness.
Tool router Choose among specialized tools. Wrong tool or missing auth boundary.
Multi-agent Split roles or debate. Coordination overhead and inconsistent state.
Durable execution Persist state across failures. Resume bugs and duplicated side effects.

State Machine Boundary

flowchart LR
  Requested --> Planned
  Planned --> Approved
  Approved --> Executing
  Executing --> Completed
  Executing --> Failed
  Failed --> Retrying
  Failed --> Compensating
  Retrying --> Executing
  Compensating --> Reviewed

Sandbox and Approval Controls

Control Purpose
Read-only tools Allow exploration without side effects.
Approval gates Pause before irreversible or expensive actions.
Sandboxes Limit file, network, process, and secret access.
Idempotency keys Prevent duplicate writes on retry.
Audit replay Reconstruct prompts, tools, observations, and state.

Practical Lab: Trajectory Review

trajectory_case:
  goal:
  tool_calls:
  observations:
  final_answer:
  invalid_tool_calls:
  unnecessary_steps:
  policy_violations:
  recovery_quality:

Study Cards

Question

Why do advanced agent evals need trajectories?

Answer

The final answer can hide unsafe tool choices, duplicate side effects, or bad recovery behavior.

Question

What does durable execution add to agents?

Answer

Persisted workflow state so an agent can resume or recover after failures.

Question

Why are approval gates important?

Answer

They prevent irreversible or high-impact actions from being executed solely by model judgment.

References