Overview

3 Multi-agent pipelines and orchestration

This chapter explains why real offensive security workflows need more than a single “smart” agent. Single-agent designs can work for narrow tasks, but complex engagements involve dependent stages such as reconnaissance, triage, prioritization, review, and reporting. The chapter presents multi-agent pipelines as a disciplined systems architecture: small, specialized agents perform limited responsibilities, while explicit artifacts, orchestration, safety gates, and shared state make the workflow predictable, auditable, and easier to defend.

A central idea is that agents should communicate through artifacts rather than direct calls, hidden memory, or shared in-process state. Artifacts act as contracts between stages: they record inputs, outputs, rationale, timestamps, provenance, and schema expectations. This enables replay, pause-and-resume behavior, human review, debugging, and downstream reuse without losing context. The orchestrator remains separate from the agents and controls execution order, routing, retries, branching, checkpointing, and failure handling. Memory is also treated as an external layer derived from artifacts, not as hidden intelligence inside an agent.

The chapter emphasizes governance, resilience, and visibility as requirements for production-grade multi-agent systems. Safety gates must live outside the model, enforce authorization and scope, and record human approvals where judgment is required. Robust pipelines should handle transient failures with retries, preserve progress with checkpoints, classify errors appropriately, monitor cost and quality, and generate traces and visual audit records. The chapter concludes by applying these ideas to a reconnaissance pipeline with separate normalization, triage, and reporting agents, then highlights common failure modes such as artifact drift, hidden orchestration, weak safety reviews, stale memory, and overloaded agents.

The general multi-agent system. Each agent consists of its own reasoning loop and can operate either independently or be coupled to other modules. Each agent can generate artifacts, which contain the model responses and information about the model run. These artifacts connect the agents, such that the outputs of one agent become the inputs of another. This structured pipeline is designed to achieve a specific goal defined by the user. To ensure our AI systems don’t go off the rails, guardrails such as safety gates and logging/tracing are implemented for observability.
A monolithic agent accumulates multiple responsibilities, while a staged pipeline composes small, focused agents connected by explicit artifacts.
Agents communicate exclusively through artifacts, which act as explicit interfaces between stages in a multi-agent pipeline.
The reconnaissance agent pipeline. The three AI agents conducting recon, triage, and reporting are orchestrated to run sequentially. Artifacts are handed over from one agent to the next to execute their specific functions.
Memory exists outside the agent loop. Agents consume artifacts and produce artifacts, while shared state persists independently.
Safety and approval flow for multi-agent systems. Each agent’s output passes through one or more approval layers before the next agent can execute its actions.
Audit flow with artifacts. Each transition is backed by logged reasoning, forming a complete audit chain. Every arrow corresponds to recorded evidence: the prompt, tool outputs, and safety decisions captured at each stage.
End-to-end multi-agent pipeline. Agents communicate only through artifacts. Orchestration controls execution order. Safety gates enforce authorization. Shared state enables pause, resume, and replay.

Summary

  • Pipelines turn individual reasoning loops into orchestrated systems. Each agent contributes a specialized function, but together they create a coordinated workflow that mirrors how real red teams operate.
  • Artifacts carry structured intelligence between agents. JSONL records preserve inputs, reasoning, outputs, and timestamps, making every action auditable and reproducible.
  • The orchestrator manages execution, safety, and continuity. It decides which agent runs next, enforces gates, transfers artifacts, and logs every step for replay.
  • Safety gates embed governance into automation.
  • Resilience patterns turn brittle scripts into recoverable systems. Retry logic, checkpointing, and error classification ensure that pipelines continue to run even when tools or models fail.
  • Visualization transforms logs into comprehension. Text traces and graphs help operators debug, managers audit, and defenders replay adversarial behavior safely.
  • The Recon → Triage → Report pipeline demonstrates orchestration in action. This capstone connects agents, artifacts, gates, and visualization into a single repeatable red-team workflow.

FAQ

Why do single-agent designs break down in real offensive security workflows?Single-agent designs work best for tightly scoped tasks, such as summarizing reconnaissance output or triaging scan results. Real offensive security workflows involve multiple dependent stages—reconnaissance, triage, prioritization, testing, reporting, and escalation. Collapsing all of these responsibilities into one “smart” agent creates brittle systems, opaque decisions, hidden assumptions, and failures that are difficult to diagnose or defend.
What is a multi-agent pipeline?A multi-agent pipeline is a controlled workflow made up of multiple small, specialized agents. Each agent performs a focused task and passes its output to the next stage through explicit artifacts. The pipeline defines how data moves between agents, when each stage runs, what dependencies exist, and where safety checks or human approvals are required.
Why are artifacts important in multi-agent systems?Artifacts act as the interface between agents. They preserve context, record decisions, capture inputs and outputs, and provide traceability. Instead of agents calling each other directly or sharing hidden in-memory state, each agent consumes artifacts and produces new artifacts. This makes the pipeline auditable, replayable, and easier to debug.
What information should a good artifact contain?A good artifact should include enough structured information for downstream agents and humans to understand what happened. This typically includes explicit fields, timestamps, input data, output data, rationale, evidence references, success or failure status, and provenance. JSONL is commonly used because it is readable by humans and easy for machines to process.
What does an orchestrator do in a multi-agent pipeline?An orchestrator coordinates the agents in the pipeline. It controls execution order, routes tasks to the correct agents, tracks workflow state, manages dependencies, handles retries or failures, and determines whether stages run sequentially, in parallel, or conditionally. In offensive security workflows, orchestration ensures that stages such as reconnaissance, triage, and reporting occur in the correct order.
Why should orchestration logic remain outside the agents?Orchestration should remain external so that control flow is explicit, deterministic, and inspectable. If agents decide when other agents should run, retry, or stop, execution order becomes hidden inside model reasoning. This makes failures harder to reproduce, weakens auditability, and prevents clean recovery from known checkpoints.
How should memory be handled in multi-agent systems?Memory should exist outside the agent loop and be built on top of artifacts. Agents do not become “smarter” because they have memory; memory simply preserves state across time and stages. Effective memory design uses structured, append-only records with timestamps, source identifiers, and recorded rationale. Memory should be derived from artifacts, not treated as unquestionable truth.
Why must safety gates live outside agents?Safety gates must live outside agents because policy enforcement should not depend on a probabilistic model. Large language models can reason about safety, but they cannot guarantee consistent enforcement. External gates make authorization, scope checks, and human approvals explicit. They also create defensible records showing who approved an action, when, and based on which artifact.
What resilience techniques should multi-agent pipelines use?Production-grade pipelines should include retry logic, exponential backoff, checkpointing, error classification, monitoring, metrics, and alerts. Transient failures such as timeouts or temporary server errors may be retried. Policy violations should be logged and sent for manual review. Checkpoints allow the pipeline to resume from the last saved artifact instead of repeating completed work.
What are common failure modes in multi-agent pipelines?Common failure modes include silent artifact drift, orchestration hidden inside agents, safety gates treated as rubber stamps, memory accumulation without correction, and overloaded agents. Robust systems prevent these problems by treating artifacts as contracts, validating schemas, keeping orchestration external, designing meaningful review gates, deriving memory from artifacts, and splitting agents when responsibilities become mixed.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • AI Agents for Offensive Security ebook for free
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • AI Agents for Offensive Security ebook for free