Skip to main content

Campaigns

Saved campaigns: which attacks to run against an agent, on which goals, judged how. Includes the technique catalogue, the campaign spec schema, the launch preflight and the launch itself, which queues a run.

📄️Create a campaign

Saves a campaign in the caller's organization: an agent and a spec of the attacks to run against it. The target comes from the agent and the execution settings from the server, so the spec has no `target` or `execution`. The spec is validated as the SDK would (techniques, their parameters and roles, judges, dataset), and credentials must be `${VARIABLE}` references to organization secrets. Nothing runs until the campaign is launched (`POST /campaign/{id}/launch`). 403 when the caller has no organization.

📄️Launch a campaign

Queues a run of the saved campaign: a campaign run in status `PENDING`, whose `run_config` holds the spec resolved with the agent as target. With `executor: cloud`, HackAgent's cloud worker claims and executes it, and its LLM gateway calls are charged to the organization's credits. With `executor: local`, the response's `command` (`hackagent run <id>`) executes it on your machine. The launch runs the preflight checks first (see `GET /campaign/{id}/preflight`) and queues nothing when one fails (400 with `problems`). Follow the run with `GET /run/{id}/summary`.

📄️Preflight a campaign launch

Runs the checks a launch with the same `executor` would run, without queueing anything: `ok` is false and `problems` says why when the launch would be refused. Both executors need a caller of the campaign's organization (`ACCOUNT_INVALID`) and an agent type the executor can run (`AGENT_TYPE_NOT_SUPPORTED`). The cloud also needs a cloud worker on this installation (`CLOUD_UNAVAILABLE`), the minimum credit balance (`INSUFFICIENT_CREDITS`), an agent and spec it can reach and load (`AGENT_NOT_CLOUD_RUNNABLE`, `AGENT_NEEDS_CONFIGURATION`, `SPEC_NOT_CLOUD_RUNNABLE`), every secret the spec references (`MISSING_SECRETS`), and a free slot under the organization's limit of concurrent cloud runs (`CLOUD_CONCURRENCY_LIMIT`).