Skip to main content
You run a multi-agent workflow: a planner delegates to workers, workers return results, an outbound agent writes to the customer. A violation introduced at any step propagates downstream. Enforcing only the final message means the final agent inherits the problem and may not be able to fix it. Enforce at every hop.

Prerequisites

  • An API key (Quickstart).
  • A place in your orchestrator to wrap each hop (agent output → next agent or customer).

The pattern

Wrap the point where one agent’s output becomes another agent’s input (or a customer message) in one function. Reuse the Act on Each Verdict outcomes: Pass, Fix, Block, Escalate.

Code

Raise a Blocked exception on Block or low-confidence Fix so the orchestrator can halt and escalate.

Handling Block in a running workflow

  • Halt the run. Do not let downstream agents proceed on unenforced input.
  • Open an escalation with your orchestrator’s run/step identifiers and the rules cited (rule_id / signal_name, or rules_violated[].rule_ref when present).
  • Do not retry the same content. A Block means no compliant version exists.

Tool results are text too

A tool result that an agent will read and act on is still text. Enforce it with the same POST /api/v3/content/validate call before the next agent consumes it. Optional metadata on that endpoint is a free-form object merged into the job. It is not required for per-hop enforcement, and keys such as surface or run_id are not a documented Activity filter schema. Use List Activity filters (agent_id, source, rule_id, status, search) only as that page defines them.

Gotchas

  • Enforce structured messages as text. If agents pass JSON, enforce the human-readable fields, not the envelope.
  • Sync can fall back to async on long hops. Check mode and poll until completed or done (Long-Form Content).

Next

Export Activity

Pull the activity chain for a run.

Act on Each Verdict

The Pass / Fix / Block / Escalate handler pattern.