Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:0xSteph Pentest ai Phased Engagement Orchestration

From Leeroopedia
Knowledge Sources
Domains Security_Testing, Orchestration
Last Updated 2026-10-23 12:00 GMT

Overview

A fixed-pipeline orchestration pattern that runs a penetration test engagement as ordered phases (recon → web → AD → cloud → mobile → chaining → validation → detection → report), each driven by a specialist agent.

Description

Phased Engagement Orchestration is the principle of decomposing a penetration test into a sequence of specialist phases, each with a single responsibility, executed in a fixed order. It solves the problem that a monolithic security scan is unmanageable: each phase has different tools, different expertise, and different output.

The orchestrator builds a phase list from the engagement scope (full, web-only, ad-only, etc.), then runs each phase in sequence. Each phase delegates to a specialist agent that inherits from BaseAgent. The orchestrator handles:

  • Phase ordering: recon must run before web; web before chaining; chaining before validation
  • Context propagation: recon findings (open ports, services) flow to web assessment via `set_context()`
  • Error isolation: a phase failure is logged but does not abort the engagement (unless it is a CancelledError)
  • Progress reporting: a callback fires at each phase start/complete with percentage
  • Event emission: PhaseStarted, PhaseCompleted, CandidateFound, EngagementCompleted events
  • Checkpoint/resume: interrupted engagements can resume from the last completed phase

= Usage

Use this principle when:

  • You need a repeatable, auditable engagement pipeline with clear phase boundaries
  • Different phases require different specialist agents and tool sets
  • The engagement must support interruption and resume (CI, long-running scans)
  • Downstream consumers (TUI, report) need typed phase events

Theoretical Basis

Phase ordering is a topological sort of dependencies:

# Abstract phase list (NOT real implementation)
PHASE_ORDER = ["recon", "web", "ad", "cloud", "mobile", "chaining", "validation", "detection", "report"]

def build_phase_list(scope, engagement):
    phases = [("recon", run_recon)]
    if scope in ("web", "full"):
        phases.append(("web", run_web_assessment))
    if scope in ("ad", "full"):
        phases.append(("ad", run_ad_assessment))
    # ...
    phases.extend([
        ("chaining", run_exploit_chaining),
        ("validation", run_poc_validation),
        ("detection", run_detection_generation),
        ("report", generate_report),
    ])
    return phases

Each phase is an async callable receiving the engagement dict. The orchestrator handles the try/except boundary so one phase's failure does not crash the run.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment