Skip to main content

Target

The target is the model or agent under test. It is described the same way every model in a campaign is: a name, how to reach it, and how to sample from it.

The same shape describes attack roles, judges, guardrails and the goal classifier, so once you can write a target you can write all of them.

target​

A model HackAgent talks to: its name, how to reach it, and how to sample from it.

The same shape describes the target, every attack helper (role), every judge, every guardrail and the goal classifier.

FieldTypeDefaultDescription
namestring (at least 1)requiredThe model to use, as the provider names it, e.g. gpt-4o-mini or llama3. Also used to label the model in results.
connectionConnectionSpecrequiredHow to reach the model.
generationGenerationSpecsee GenerationSpecSampling settings for every request.
optionsmap of string to anyemptySettings specific to one kind of agent that are neither connection nor sampling, e.g. the binary path of a CLI agent, ADK's user_id, or a web target's CSS selectors.

target.connection​

How to reach a model: which client to use, where it lives, and how to authenticate.

FieldTypeDefaultDescription
providerstring (at least 1)requiredA label for who serves the model (openai, ollama, vllm, local…). Informational only: launch tooling reads it, but the request path uses type.
typeagent typerequiredWhich client talks to the model. This is the field that matters: it decides whether HackAgent calls a chat API (OPENAI, OLLAMA, LITELLM…) or drives an agent directly (CLAUDE_CODE, GOOGLE_ADK, WEB…).
endpointstringunsetBase URL of the model's API. Leave it unset for an OLLAMA model and HackAgent reads OLLAMA_HOST, falling back to http://localhost:11434 — so a campaign runs against whichever Ollama the machine has without being edited. Writing the URL here pins it, which is what you want for a server at a fixed address. Local agents such as CLAUDE_CODE need none: they are launched, not called over HTTP.
api_key_envstringunsetName of the environment variable that holds the API key, e.g. OPENAI_API_KEY. The key itself never goes in the campaign file.
headersmap of string to stringemptyExtra HTTP headers sent with every request. An API key belongs in api_key_env, not here: a campaign file is committed and shared.
timeoutnumber (> 0)120.0Seconds to wait for one reply before giving up.

target.generation​

Sampling settings applied to every request the model receives. All optional: anything left unset uses the provider's own default.

FieldTypeDefaultDescription
max_tokensinteger (>= 1)unsetLongest reply, in tokens.
temperaturenumber (>= 0.0)unsetRandomness of the reply. 0 is the most deterministic.
top_pnumber (>= 0.0, <= 1.0)unsetNucleus sampling: only consider the most likely tokens whose probabilities add up to this value.
frequency_penaltynumberunsetDiscourage repeating the same tokens.
presence_penaltynumberunsetEncourage introducing new topics.
seedintegerunsetFixed random seed, for repeatable replies where the provider supports it.
stopstring or list of stringunsetText (or list of texts) at which the model stops writing.
reasoning_effortstringunsetHow hard a reasoning model should think (low, medium, high), for providers that support it.
response_formatmap of string to anyunsetAsk for a structured reply, e.g. {"type": "json_object"}.
extra_bodymap of string to anyemptyAny other provider-specific request fields, passed through unchanged.
thinkingbooleanunsetTurn a model's thinking mode on or off. Judges default to off.

Agent types​

connection.type decides how HackAgent talks to the model. It is the field that matters; provider is only a label.

Chat APIs, reached over HTTP and driven through LiteLLM: LITELLM, OPENAI, OLLAMA, LANGCHAIN. These need an endpoint, and an api_key_env when the provider requires a key. OLLAMA is the exception: leave its endpoint unset and HackAgent reads OLLAMA_HOST, so the campaign follows whichever Ollama the machine runs.

Agents, driven directly:

TypeWhat it is
GOOGLE_ADKNative backend for a deployed Google ADK agent server.
CLAUDE_CODENative backend for a locally-installed Claude Code CLI.
CODEXNative backend for a locally-installed Codex CLI.
HERMESNative backend for a locally-installed Hermes Agent CLI.
WEBNative backend that red-teams a website's chatbot by driving the live page.
Not runnable

MCP, A2A exist in the format but have no backend, so a campaign using one fails to resolve.

Examples​

A model served by Ollama on this machine

target:
name: llama3.2
connection:
provider: ollama
type: OLLAMA
endpoint: http://localhost:11434

An OpenAI-compatible endpoint, reading the key from the environment

target:
name: gpt-4o-mini
connection:
provider: openai
type: OPENAI
endpoint: https://api.openai.com/v1
api_key_env: OPENAI_API_KEY
generation:
temperature: 0.0
max_tokens: 512

A coding agent running locally, with no endpoint at all

target:
name: claude-code
connection:
provider: local
type: CLAUDE_CODE
options:
binary: claude