Configuration Files
The files under agent/instructions (mapped to /agent/instructions in the
container) control how the agent behaves. They are reloaded every time run-qa
is called, so you can edit them on the host and simply start the next run — no
container restart needed. The most commonly tuned files are described below.
User test skills live outside this folder — each in its
own subfolder under agent/skills (/agent/skills in the container, repointable with
SKILLS_DIR) holding a single SKILL.md. Unlike the files here, a skill
body is loaded only when the agent decides it applies.
global-context.json
Static values shared across every test in the run — base URLs, tenant IDs, shared accounts, and similar constants. The values are injected into the agent's system prompt as global variables, so any test can reference them.
It is a plain JSON object and supports nested values via dotted keys.
{
"TEST_URL": "https://www.wikipedia.org",
"LOGIN_URL": "https://www.wikipedia.org/login",
"user": {
"username": "qa_user"
}
}
You can edit this file directly, or manage it from inside the container with the
manage-global-constants command. See
Global Context
for how tests consume these values.
preset-context.json
Per-run configuration with two independent, optional sections:
data— seed values placed in the agent's context store before the first task runs. Unlike global context, these are not injected into the system prompt; the agent reads and overwrites them as tests run, which makes them useful for default credentials or feature flags a test can later change.flow— the execution order of your tasks and the dependencies between them. Keeping the flow here (rather than in the.mdfiles) lets you reuse the same task files across different suites and environments.
{
"data": {
"admin_username": "qa_user",
"admin_password": "s3cret",
"feature_new_checkout": true
},
"flow": [
{ "file": "login.md", "node": 1 },
{ "file": "checkout.md", "node": 2, "required": [1] }
]
}
You can edit this file directly, or manage it with the
preset-context command. See
Preset context
and Define Test Flow for full details.
allowed-domains.yaml
The browser domain allowlist. The agent may only navigate to origins listed under
allowed; if a test tries to reach any other URL, it fails immediately. This
keeps test runs contained to the sites you intend to exercise.
allowed:
- https://*.wikipedia.org
- http://host.docker.internal:8080
See URL Permissions for the matching rules and behavior.
extra-instruction.md
Free-form Markdown appended to the instructions for every test in the run. Use it for global rules that apply across all tasks.
Its most common use is testing a website hosted on your local machine. Inside
the container, localhost refers to the container itself, not your host, so a
locally hosted site is reached at host.docker.internal. Add a rewriting rule so
the agent translates localhost URLs automatically:
# Extra Test Instruction
## Global Rules
- **URL Rewriting:** Any URL containing `http://localhost` encountered during the
test (in page content, emails, or links) MUST be rewritten to use
`http://host.docker.internal` before navigating. For example,
`http://localhost:8080/confirm-email?token=abc` becomes
`http://host.docker.internal:8080/confirm-email?token=abc`. Never navigate to a
`localhost` URL directly.
Make sure the corresponding host.docker.internal origin is also present in
allowed-domains.yaml, otherwise the rewritten URL will be blocked.
The config-agent command can generate and
maintain extra-instruction.md for you when you enable Test web app on host.
rerun-config.json
The task list for a rerun. Unlike the files above, it is
read only by rerun-tests — run-qa ignores it — and rerun-tests fails before
starting any service if it is missing.
{
"name": "login flow",
"flow": [
{ "file": "login.md" },
{ "file": "checkout.md" }
],
"data": {
"admin_password": "s3cret"
}
}
| Property | Required | Description |
|---|---|---|
flow | yes | The task files to replay, in execution order |
name | no | Names the output folder — results land in /agent/outputs/rerun-<name>/. Without it the folder is auto-numbered rerun-N |
data | no | Context values that override the ones restored from the checkpoint |
A rerun runs the listed files in the order given, against context restored from a single
checkpoint captured during the most recent full run — the checkpoint of whichever listed task
ran earliest in that run, which flow order does not influence. See
How the context is seeded. Because the seed already
carries the state those earlier tasks produced, the node and required dependency fields of
preset-context.json above have no counterpart here — dependency checking is bypassed for a
rerun.
You can edit this file directly, or push it into the container with
upload-instruction-file:
printf '{"name":"login flow","flow":[{"file":"login.md"}]}' | \
docker exec -i waterwheel-agent upload-instruction-file rerun-config.json
Rather than writing the JSON yourself, you can have
generate-rerun-config compose it. It checks every
flow filename against /agent/tasks and applies the agent's own name rules before emitting
anything, so a typo is caught here rather than after rerun-tests has started the virtual display
and both MCP services:
docker exec waterwheel-agent generate-rerun-config -f login.md -f checkout.md \
--name "login flow" --data admin_password=s3cret | \
docker exec -i waterwheel-agent upload-instruction-file rerun-config.json
--data values are always strings; use --data-file for numbers, booleans, arrays, or nested
objects.
Its location is configurable with
RERUN_CONFIG_PATH. See
rerun-tests for the prerequisites and for how to read
a rerun's results.