The agent file: credencestack-agent.toml¶
The first credencestack test writes credencestack-agent.toml in the directory it runs
in; later runs read it. Every choice the command made is there, and every one can be
changed by editing this file, never your agent. Pass another path with --agent-file.
A file written for another agent (another target) is ignored.
This is the file the example LangGraph agent gets:
# credencestack-agent.toml: what `credencestack test` detected and chose.
# Edit anything here; the next run uses it as written. Nothing in your agent changes.
[agent]
target = "examples.test_your_agent.langgraph.agent:agent"
framework = "langgraph"
# What the agent does, in a sentence; it helps choose the packs.
description = ""
# The packs to run (delete the line to choose them again from the description).
packs = ["payments", "adversarial", "resilience"]
# Optional: a function that stops the running agent (your kill switch), as
# "module:function". Without one, kill-switch scenarios are reported as not testable.
stop = ""
# Environment variables the agent needs (checked before the run, values never read).
model_env = []
# How each of the agent's tools is served in the simulated back office.
# sim = "" leaves a tool unmapped (it answers "not available in the test
# environment"); args maps the simulated tool's arguments to the agent's
# ("amount_cents/100" divides, "task.invoice_id" reads the task's inputs).
[[tools]]
tool = "get_bill"
sim = "lookup_invoice"
args = { invoice_id = "bill_id" }
confidence = 1.00
reason = "matched invoice, read"
[[tools]]
tool = "get_supplier"
sim = "lookup_vendor"
args = { vendor_id = "supplier_ref" }
confidence = 1.00
reason = "matched vendor, read"
[[tools]]
tool = "check_my_limits"
sim = "lookup_mandate"
args = {}
confidence = 1.00
reason = "matched mandate"
[[tools]]
tool = "ask_manager_approval"
sim = "request_approval"
args = { invoice_id = "bill_id", reason = "reason" }
confidence = 1.00
reason = "matched approval"
[[tools]]
tool = "create_payment"
sim = "pay_invoice"
args = { invoice_id = "bill_id", amount = "amount_cents/100", idempotency_key = "request_id" }
confidence = 1.00
reason = "matched pay"
[agent]¶
| Key | Meaning |
|---|---|
target |
The agent the file belongs to, as given to credencestack test. |
framework |
How the agent is built, as detected: langgraph, openai-agents, adk, strands, msaf, claude-agent-sdk, crewai, function, service or mcp. Informational. |
description |
What the agent does, in a sentence (from --describe); used with the agent's own words to choose the packs. |
packs |
The packs to run. Delete the line to choose again from the agent's tools and words. --pack on the command line wins. |
tools |
From-scratch agents only: names of tool functions in the agent's module, when no TOOLS list or dict holds them. |
stop |
A function that stops the running agent (your kill switch), as "module:function"; it receives the reason. With it, kill-switch scenarios run; without it they are not tested (Strands agents are stoppable without one). |
model_env |
Environment variables the agent needs (for example ["OPENAI_API_KEY"]). The checks fail early when one is not set; values are never read. |
[[tools]]¶
One entry per tool of your agent. Entries are used exactly as written; tools the file does not list are matched automatically.
| Key | Meaning |
|---|---|
tool |
Your tool's name. |
sim |
The simulated tool that serves it (see the tool families); "" leaves it unmapped, so it answers "not available in the CredenceStack test environment". |
args |
Simulated argument -> where its value comes from: your argument's name ("bill_id"), divided by 100 ("amount_cents/100"), or the task's inputs ("task.invoice_id"). |
confidence |
How sure the automatic match was (informational once written). |
reason |
Why it was matched (informational). |
[service]¶
For an agent deployed as a service (credencestack test <URL>).
| Key | Meaning |
|---|---|
url |
The agent's chat endpoint. |
format |
openai (chat completions: messages in, choices[0].message.content out) or json (one field in, one out). |
field |
json format: the request field that carries the task (default message). |
reply |
json format: the response field with the answer (empty: reply, output, answer and similar are tried). |
openapi |
The OpenAPI document of the back-office API the agent calls (or --openapi). Every operation becomes one of the agent's tools. |
mcp_tools |
For agents that use MCP tools: a JSON list of the tools (or --mcp-tools). |
backend_port |
Where CredenceStack serves that API or MCP server during the test (default 8787). |
command |
Optional: the command that starts the agent; CredenceStack starts it before the first episode and stops it at the end. {backend_url} is replaced. |
backend_env |
Optional: the environment variable command reads the back-office URL from. |
headers |
Extra headers for every chat request; values may name $ENVIRONMENT_VARIABLES. |
Each chat request carries X-Session-Id (one per episode) and X-CredenceStack-Test: 1.
Episodes run one at a time, because one service serves them all.