Skip to main content

hackagent.orchestrator.campaign.preflight

Check that every model a campaign uses answers before it starts attacking.

Building a model validates its configuration but sends nothing, so a wrong endpoint or a down server only shows up on the first real call — after the run has started and partly recorded. When execution.preflight is on, every model is checked first: the target, its guardrails, each attack's roles and embedders, the judges and the goal classifier. How a model is checked is its own business (:meth:Model.is_reachable); preflight only decides which ones, checks each distinct model once, and reports every failure together.

Probe Objects​

@dataclass(frozen=True)
class Probe()

One distinct model, every place the campaign uses it, and its check.

PreflightError Objects​

class PreflightError(RuntimeError)

One or more of a campaign's models could not be reached.

campaign_models​

def campaign_models(spec: CampaignSpec) -> Iterator[tuple[str, ModelConfig]]

Yield (where, config) for every model spec uses.

model_probes​

def model_probes(spec: CampaignSpec, models: Mapping[int, Model],
embedders: Mapping[int, Any]) -> tuple[Probe, ...]

One probe per distinct model, from what resolution built.

models and embedders map id(config) to what was built from that config. A model the campaign uses in several places is checked once.

preflight​

async def preflight(resolved: "ResolvedCampaign") -> None

Check every model; raise :class:PreflightError naming each failure.