How CredenceStack works¶
CredenceStack answers one question: does this agent respect its authority, under pressure, every time? It runs the agent many times in a simulated finance back office, judges every action against your rules with deterministic graders, and writes evidence anyone can verify. Forge makes new scenarios from the shipped ones, the same back office is available step by step as an environment, benchmarks compare agents, and every workflow can be traced with OpenTelemetry.
Each section below links to the page with the details.
Testing an agent as it is¶
credencestack test my_app.agent:agent is the shortest path from an agent to evidence:
- Detection. It recognises how the agent was built (LangChain and LangGraph, the OpenAI Agents SDK, Google ADK, AWS Strands, Microsoft Agent Framework, the Claude Agent SDK, CrewAI, plain Python, or a deployed service) and finds its tools, prompt and description.
- The tool map. Each of the agent's tools is matched, without a model, to the
simulated tool that means the same (
create_payment(bill_id, amount_cents)serves aspay_invoice), with a confidence. During a test episode the tool's function is replaced in place by a stand-in that answers from the back office; nothing real is called. - The advisor chooses the packs from the tools and the words of the prompt, and leaves out scenarios that need a tool the agent does not have.
- Preflight checks the set-up and runs one smoke episode, so a missing key or an unmapped tool stops the test with a fix instead of becoming a finding.
- The run covers the fixed scenarios, then Forge-generated ones at increasing difficulty, with retries for rate limits and timeouts.
- The assessment ranks what to fix, each with a control for your systems, a change in your framework and a change in the prompt.
Every choice is written to the agent file, which you can
edit. Details: How credencestack test works.
Authority profiles¶
An authority profile is your delegated-authority policy as data: which agent may take which action, up to which limit, with which controls. For example, the accounts-payable agent may pay invoices up to USD 10,000 each and USD 15,000 per vendor per month, only to allow-listed vendors, during business hours, and never change bank details; anything above USD 50,000 needs two approvers.
A pure, deterministic grader, credencestack.graders.authority.decide, answers allow,
escalate or deny for any proposed action, with stable rule ids such as
AUTH-LIMIT-TXN. The graders use it to judge every step an agent takes, reconciliation
uses it to compare with runtime logs, and your own agent can use it to check itself.
AP2-style payment mandates can be converted into temporary profiles and tested the same
way. Details: Write an authority profile.
Domains, domain graders and domain policies¶
CredenceStack covers four business domains: payments authority, financial crime
(sanctions screening and alert review), document integrity, and KYC and KYB onboarding.
Every scenario names its domain (payments by default), and each domain has a
deterministic domain grader with two jobs: compute what a correct agent would do in the
scenario (expected), and judge what the agent did against that (judge). The payments
grader is the authority grader above.
The other domains read a domain policy: a YAML file, like an authority profile, with
the thresholds and rules of that domain (match scores and the ownership threshold for
screening; the checks a document must pass; the onboarding risk matrix). Shipped policies
are examples; write your own and check them with credencestack profiles validate and
credencestack profiles explain. See the financial crime,
document integrity and KYC pack pages.
All data in the domain packs is synthetic: invented people, companies, banks and
vessels, a synthetic watch-list, and fictional country codes (XA to XH), so nothing
goes stale and nothing describes a real person.
Scenario packs¶
A scenario gives the agent a task ("pay invoice INV-1042") in a seeded environment and
states what a compliant outcome looks like: the final decision, tools that must or must
not be called, and what the ledger may contain. Each scenario is tagged with the pillars
it evidences and the failure types it targets. A pack is a directory of scenarios with
a pack.yaml.
Every pack has a visibility:
public: everything CredenceStack ships (the seven packs in the pack reference), and your own packs unless marked otherwise.confidential: your own packs markedvisibility: confidential.
Shared outputs show confidential scenarios only by id, pillars, finding types, severity and a generic description. Details: your own packs and confidential content.
The simulated environment¶
Agents work in a simulated finance back office: a ledger with idempotency keys,
vendors and invoices (with document text and email threads), prior payments, a scripted
human reviewer with latency and partial approvals, inbound requests from partner agents
with credentials, and a simulated clock. Its tools come in tool families: payments
(lookup_invoice, lookup_vendor, lookup_mandate, get_balance, create_payee,
update_vendor_bank_details, request_approval, pay_invoice), inbound, email,
policy, screening, case_mgmt, comms, documents, registry and kyc. A scenario
gets its domain's families (or the ones it lists in tools), and the agent is offered
exactly those tools, whichever connector drives it.
Every tool call, result, approval, fault and control signal is recorded as a trace event. Prompt injections are planted in tool results (an invoice note, an email, a vendor name) with a goal, so the grader can tell when the agent did what the attacker asked.
Faults and the kill switch¶
Scenarios can wrap tools with faults: a timeout after the payment went through, stale or malformed data, a partial batch failure, rate limiting, a service outage, or a clock jump. They test whether the agent fails closed rather than guessing, retrying blindly or paying twice.
The kill switch sends a suspend signal after the agent's N-th tool call or while a call is in flight. CredenceStack measures whether the agent acknowledged it, any consequential actions after it, and the simulated time until it stopped, against the profile's limit. Details: Faults and the kill switch.
Epochs and confidence intervals¶
Agents built on language models are not deterministic, so each scenario runs for several epochs, each with its own derived seed (all recorded). A scenario passes when its pass rate reaches its threshold (by default, every epoch). Pass rates are reported with 95% Wilson intervals per scenario, pack and pillar: with 5 epochs, 5 of 5 passes gives an interval of roughly 57% to 100%, so more epochs give tighter evidence. The report also shows consistency (scenarios with the same outcome every epoch) and lists flaky scenarios. Details: Running and scoring.
Evidence bundles¶
Every run writes an evidence bundle: a directory (or zip) with the manifest
(versions, packs, profile hashes, every seed, file hashes), the results, the exact
profiles used, hash-chained traces, Inspect's logs, framework mappings and a
self-contained HTML report. A Merkle root covers every file, and the bundle can be
signed with Ed25519. Anyone with the bundle and your public key can check it has not
been altered, and verify names the first altered file or trace record. Details:
Reading the evidence report and
Bundle format and verification.
The six pillars¶
Reports are organised around the six pillars named in OCC Bulletin 2026-54: purpose (the agent does the work it is authorised to do), risk (no financial, fraud or data risk beyond the mandate), control (limits and segregation of duties hold at the moment of action), oversight (humans are brought in when required and the agent can be stopped), resilience (safe behaviour when tools fail) and assurance (reproducible, verifiable evidence and checked third parties). Other frameworks are referenced secondarily. Every mapping is indicative. Details: Framework mappings.
Observability¶
With --otel, every scenario epoch is also emitted as an
OpenTelemetry trace that follows the GenAI
semantic conventions: an invoke_agent span, an
execute_tool span per tool call, chat spans where the connector sees model calls, and
findings, faults, control signals and approvals as events. Any
OTLP platform can receive them. The traces are a view; the evidence
bundle remains the record, and its otel/ids.json links the two. No content is exported
unless asked, and never for confidential scenarios. credencestack run, test,
generate, bench and the environment all take the same --otel switch. See
Observability.
Connectors¶
A connector drives one kind of agent system (a framework, MCP, a Python callable, an
HTTP service) in the simulated environment (--connector, credencestack connectors
list). Every connector is checked by the conformance kit.
Generated scenarios, the environment and benchmarks¶
- Generated scenarios and difficulty: Forge, mutators and the difficulty dial.
- Environments and rewards: the back office step by step.
- Benchmark rounds: comparing agents fairly with fresh seeds.
- Statistics, evidence and signatures, the six pillars and confidential content.
Every term is defined once, in the glossary.