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:AISecurityLab Hackagent Campaign Execution Orchestration

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

Overview

An orchestration pattern that coordinates the full lifecycle of an AI red-team campaign — loading, resolving, auditing, executing attacks, recording results, and writing outputs — in a single composable pipeline.

Description

Campaign execution orchestration is the composition root: it wires together every component (spec loader, resolver, preflight, auditor, attack runner, tracker, output writer) into a single pipeline. The orchestrator manages:

  • Lifecycle phases: Load → resolve → preflight → audit → execute → record → output. Each phase has a clear boundary and can fail independently.
  • Execution modes: Sequential (one attack at a time), parallel (all at once), or escalate (run in order, drop solved goals).
  • Error handling: An error in one goal becomes an attempt with error set; setup failures or per-attack timeouts fail an attack; on_error decides whether remaining attacks run.
  • Event emission: An optional on_event callback receives lifecycle events (audit_finished, attack_started, goal_finished, attack_finished) for monitoring.
  • Store ownership: A caller-supplied store stays owned by the caller; one opened by the orchestrator is closed before returning.

This solves the problem of scattered orchestration logic — without a composition root, each entry point (CLI, TUI, web, library) re-implements the pipeline, and they drift apart.

Usage

Use this principle when a security testing pipeline has multiple phases with clear boundaries, needs multiple execution modes, and must support external monitoring. The orchestrator should be the single entry point; all interfaces (CLI, TUI, API) delegate to it.

Theoretical Basis

# Abstract algorithm (NOT real implementation)
async def arun_campaign(source):
    spec = load_campaign(source)
    resolved = resolve_campaign(spec)
    if spec.execution.preflight:
        await preflight(resolved)
    audit = await aaudit_configured_panel(resolved.panel, spec.evaluation.audit)
    outcomes = await _execute(resolved, store)
    result = CampaignResult(spec.campaign.name, run_id, attacks=outcomes, audit=audit)
    return replace(result, outputs=write_outputs(result, spec.execution.output))

The three execution modes share the same attack runner but differ in which goals each attack sees:

  • Sequential: each attack faces all goals.
  • Parallel: all attacks run concurrently against all goals.
  • Escalate: each attack sees only the goals still standing (not yet solved by an earlier attack).

Related Pages

Implemented By

Page Connections

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