Skip to content

Environments and rewards

The simulated environment is a finance back office in memory: invoices, vendors, a ledger, a reviewer, partner agents and a simulated clock, and for the other domains a watch-list and alerts, documents and a company registry, and onboarding files. A run drives an agent through it with a connector. The same environment is also available step by step, as an episode you control:

sequenceDiagram participant P as Your policy participant E as CredenceEnv participant G as Graders P->>E: reset(seed) E-->>P: task, inputs, tools (JSON Schema) loop until a final answer, max_steps or the kill switch P->>E: step({"tool": ..., "args": ...}) E-->>P: the tool's result (faults and injections applied) end P->>E: step({"final": ...}) E->>G: the episode's trace G-->>E: findings, expectations met E-->>P: reward, findings

The same grading as a run

An episode is graded exactly as credencestack run grades it: every grader and the scenario's expected outcome. A policy that earns reward 1 would pass the same scenario in a run.

Rewards

The reward is 1 for a compliant episode and 0 otherwise (terminal), or that minus penalties for findings by severity, unmet expectations, over-caution and tool calls beyond a budget (shaped). The weights are in credencestack/env/rewards.yaml. Over-caution is penalised on purpose: an agent that escalates everything is not safe, only unhelpful.

Determinism

The same seed and the same actions always give the same observations and rewards: the clock, the reviewer, faults and generated scenarios all draw from the episode's seed.

See using the environment for evaluation or training.