Agents and models¶
--model and --agent choose what runs the scenarios. Exactly one is needed.
Hosted models¶
roguebench run --model gpt-5.6-luna
roguebench run --model claude-sonnet-4.6
roguebench run --model gemini-3.5-flash
roguebench run --model deepseek-v4-flash
The model name selects the provider and its key. roguebench doctor lists the keys it looks for: OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY, DEEPINFRA_API_KEY, OPENROUTER_API_KEY. Set the key of the provider you use before the run.
--model mock returns a fixed reply and needs no key. It is for testing your setup.
Any OpenAI-compatible server¶
For a model served by vLLM, llama.cpp, Ollama, LM Studio or a gateway, use the prefix compat/ and set two variables:
export LLM_BASE_URL=http://localhost:8000/v1
export LLM_API_KEY=none # if the server needs no key, leave it out
roguebench run --model compat/llama3 --name llama3-local
The part after compat/ is sent to the server as the model id. Use --name to give the run a display name and a file tag.
Your own agent in Python¶
Write a function that takes the prompt and returns the agent's next reply as text:
# my_agent.py
def act(prompt, system=None, temperature=0.1):
return "DONE: I will not take any action."
roguebench run --agent my_agent.py:act --name do-nothing --suite support_agent --reps 1
How it is called:
- The spec is
FILE.py:FUNCTIONorMODULE:FUNCTION. - The function is called as
fn(prompt, system=..., temperature=...).promptis the simulation's transcript so far: the user's task, the agent's earlier replies and the tool outputs. The prompt itself states how a tool call must be written. - It returns the reply text. It may return a pair
(text, usage)whereusagehasprompt_tokensandcompletion_tokens. - If the name points to a class, it is instantiated once. An object with a
complete(prompt, system=..., temperature=...)method also works. - Your function receives the calls of the agent under test.
examples/mini_agent.py is a complete agent of about 60 lines to copy: it calls any OpenAI-compatible chat API (OPENAI_API_KEY, OPENAI_BASE_URL, MINI_AGENT_MODEL) with the suite's system prompt plus a few working rules, retries on errors and returns the reply with its token usage.
roguebench run --agent examples/mini_agent.py:act --name mini-agent --preset quick
This is the text protocol: the agent sees text and answers with text. If your agent has its own tool loop (a framework, a coding CLI), call it from the function and return its reply in the format the prompt asks for.
Note
A wrapper around an agent framework changes what is measured: harm then depends on the framework's own prompt and tool format as well as the model. Name such a run after the whole agent, not after the model.
Native function calling¶
By default the agent answers in each suite's text protocol (ACTION: tool(arg=value) or DONE: report). With --tool-mode native the tool list in the system prompt is turned into function definitions and the model picks its next step through its provider's function-calling API (OpenAI-compatible chat completions, DeepInfra, OpenRouter or the Anthropic Messages API). The call is written back as the action line the suite expects, so the environment, the state check and the scoring stay the same. The tool lists of all ten suites parse (seven formats, tests/test_tools_native.py); a call whose system prompt has no tool list falls back to the text protocol. Earlier turns stay in the transcript as text. Native mode needs an OpenAI-compatible or Anthropic model: for Gemini, mock and Python agents the run stops before it starts and says so (a Python agent can call tools natively inside its own function).
roguebench run --model gpt-5.6-luna --tool-mode native
Runs in native mode get their own file tag (<model>+native), so text and native results of one model can sit side by side.
Model names and environment variables¶
| Name | Goes to | Needs |
|---|---|---|
gpt-*, o1-*, o3-*, o4-*, openai/<id> |
OpenAI chat completions | OPENAI_API_KEY (OPENAI_BASE_URL for another server that speaks the same protocol) |
claude-*, anthropic/<id> |
Anthropic Messages API | ANTHROPIC_API_KEY |
gemini-* |
Google Gemini API, thinking off | GEMINI_API_KEY |
deepinfra/<model id> |
DeepInfra | DEEPINFRA_API_KEY |
openrouter/<vendor>/<model> |
OpenRouter (the same DeepInfra weights when DEEPINFRA_API_KEY is set and the model is one of the reference ones) |
OPENROUTER_API_KEY |
deepseek-v4-flash |
short name for openrouter/deepseek/deepseek-v4-flash-0731 |
as above |
compat/<model id> |
any OpenAI-compatible server (vLLM, Ollama, LiteLLM) | LLM_BASE_URL, LLM_API_KEY |
py:<file.py or module>:<function> |
your own Python agent (--agent is the short form) |
nothing |
mock |
no network; every reply is DONE: mock |
nothing |
LLM_BACKEND=mock sends every call to the mock backend and LLM_BACKEND=compat sends every call to LLM_BASE_URL; LLM_MODEL then replaces the model id in every call. GPT-5.x models run without extended reasoning, Gemini with thinking off, as in the reference runs. The pi_detector defense reads ROGUEBENCH_PI_MODEL and ROGUEBENCH_PI_THRESHOLD.
Benchmark-wide defenses and attack texts¶
--defense adds a defense in front of the agent's calls and --attack rewrites the injected text in scenarios that have an injection vector. See Defenses and Attacks. The run's tag then carries them: gpt-5.6-luna+spotlight@important_instructions.
Check the size of a run first¶
roguebench plan --model compat/llama3 --suite support_agent --reps 3
roguebench run --model compat/llama3 --dry-run # prints the settings, runs nothing
plan counts sessions from the paper's reference runs, so the numbers are estimates. At the reference runs' 4,300 tokens per session, the default run (core track, three repetitions, all suites) is about 900 sessions and 3.9M tokens.
Docker¶
destructive_actions and containment_breach run their tools in containers. If Docker is not running, or you pass --no-docker, the runner skips both suites and says so. The other eight suites do not need Docker.
Resuming and parallelism¶
--parallel N (default 4) runs several suites at once. A run that stops continues where it stopped when you start the same command again. Sessions that raised errors are written to a .errors file and retried on the next start.