Skip to main content

Execution

execution controls how the run behaves: the order attacks run in, how much runs at once, what happens after an error, and where results go. Every field has a safe default, so you can leave the whole section out.

execution​

How the run behaves: ordering, limits, error handling, output and storage. Every field has a safe default.

FieldTypeDefaultDescription
modeone of sequential, parallelsequentialRun attacks one after another, or all at once within the shared limits.
dry_runbooleanfalseValidate and build everything, but send no request.
preflightbooleantrueCheck every model the campaign uses (target, guardrails, attack roles and embedders, judges, goal classifier) before attacking, so an unreachable endpoint fails fast with a clear message instead of mid-run. Turn it off to let a run proceed and record such failures as attempt errors.
on_errorone of continue, stopcontinueAfter an attack fails, run the remaining ones or stop.
escalatebooleanfalseRun attacks in order and drop a goal once an attack jailbreaks it, so later attacks only face the goals still standing. Implies sequential order; the remaining attacks are skipped once every goal has fallen.
per_attack_timeouttyping.Annotated[float, Gt(gt=0)]unsetMaximum seconds a single attack may run before it is stopped and marked failed. Leave unset for no limit.
concurrencyConcurrencySpecsee ConcurrencySpecHow much work may run in parallel.
retriesRetrySpecsee RetrySpecExtra attempts after a provider error.
outputOutputSpecsee OutputSpecFiles written for the run.
storageStorageSpecsee StorageSpecWhere results are recorded.

execution.concurrency​

How much work may be in flight at once, shared by every attack.

FieldTypeDefaultDescription
attackinteger (>= 1)1How many goals may be generating requests at the same time.
targetinteger (>= 1)1How many requests may be waiting on the target at the same time.
judgeinteger (>= 1)1How many replies may be judged at the same time.

execution.retries​

Extra attempts after a provider error (timeouts, rate limits, 5xx).

FieldTypeDefaultDescription
targetinteger (>= 0)0Extra attempts for a failed call to the target.
rolesinteger (>= 0)0Extra attempts for a failed call to an attack's helper models.
judgesinteger (>= 0)0Extra attempts for a failed call to a judge.

execution.output​

Files written for each run, next to the results stored in the database.

FieldTypeDefaultDescription
directorystring./logs/runsFolder where runs are written, each in a subfolder named after its run id.
run_idstringunsetFixed id for the run. Leave unset to generate a new one each time.
formatslist of one of json, jsonl["json"]File formats to write: json (one document) and/or jsonl (one line per attempt).
save_promptsbooleantrueInclude the prompts sent to the target.
save_responsesbooleantrueInclude the target's replies.
save_tracesbooleantrueInclude the search traces of adaptive attacks (every call they made).

execution.storage​

Where results are recorded so they can be browsed later.

FieldTypeDefaultDescription
backendone of local, remotelocallocal writes to a SQLite file on this machine; remote sends results to the HackAgent server named below, authenticated with the key in the environment variable that api_key_env names.
base_urlstringunsetAddress of the remote server. Required when backend is remote.
api_key_envstringunsetName of the environment variable holding the remote server's API key. Required when backend is remote.

Examples​

Fail fast on an unreachable endpoint, then run several goals at once

execution:
preflight: true
per_attack_timeout: 600
concurrency:
attack: 4
target: 8
judge: 4

Escalate: stop spending attacks on goals that already fell

execution:
escalate: true