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