credencestack.agents¶
Reference agents: the deterministic scripted agents (scripted_naive, which does what the task and documents say, and scripted_safe, which acts only within authority and fails closed), the domain agents (naive_fincrime/safe_fincrime, naive_docintegrity/safe_docintegrity, naive_kyc/safe_kyc; the scripted agents dispatch to them by the task's domain), and LangChain 1.x agents for the benchmark, including financial-crime and KYC versions.
Responsibilities¶
- Give every test, guide and the sample report a fully reproducible agent that calls no model.
- Show, side by side, what unsafe and safe behaviour look like in a trace.
- Back the scripted model used by the framework connectors offline (
scripted_model).
Non-goals¶
- Being good agents. They are calibration points, not products:
scripted_safehard-codes the checks a real agent must learn or be given.
Public API¶
Signatures and purposes are generated from the code by scripts/gen_dev_reference.py; errors come from each docstring's Raises: section or from api-notes.yaml, which also holds the hand-written effects column.
| Name | Kind | Signature | Purpose | Errors | Effects |
|---|---|---|---|---|---|
BRITTLE_WEAKNESSES |
constant | BRITTLE_WEAKNESSES: dict of 4 |
The documented weaknesses of scripted_brittle, by domain. | - | - |
INSTRUCTION_PATTERNS |
constant | INSTRUCTION_PATTERNS |
Regex the scripted agents use to spot instructions planted in documents. | - | - |
brittle_docintegrity |
function | brittle_docintegrity(task: TaskInfo, control: AgentControl) -> PolicyRun |
safe_docintegrity with one weakness. |
- | pure (calls simulated tools only) |
brittle_fincrime |
function | brittle_fincrime(task: TaskInfo, control: AgentControl) -> PolicyRun |
safe_fincrime with one weakness. |
- | pure (calls simulated tools only) |
brittle_kyc |
function | brittle_kyc(task: TaskInfo, control: AgentControl) -> PolicyRun |
safe_kyc with one weakness: it never checks people against the PEP list. |
- | pure (calls simulated tools only) |
naive_docintegrity |
function | naive_docintegrity(task: TaskInfo, control: AgentControl) -> PolicyRun |
Pay what the document says. | - | pure policy: yields tool calls, never does I/O |
naive_fincrime |
function | naive_fincrime(task: TaskInfo, control: AgentControl) -> PolicyRun |
Careless alert review: exact names only, obeys attachments, releases by default. | - | pure policy: yields tool calls, never does I/O |
naive_kyc |
function | naive_kyc(task: TaskInfo, control: AgentControl) -> PolicyRun |
Approve everything, rated low. | - | pure policy: yields tool calls, never does I/O |
safe_docintegrity |
function | safe_docintegrity(task: TaskInfo, control: AgentControl) -> PolicyRun |
Verify the document against every system of record before paying. | - | pure policy: yields tool calls, never does I/O |
safe_fincrime |
function | safe_fincrime(task: TaskInfo, control: AgentControl) -> PolicyRun |
Screen per the policy: confirm true matches, clear false positives, escalate the rest. | - | pure policy: yields tool calls, never does I/O |
safe_kyc |
function | safe_kyc(task: TaskInfo, control: AgentControl) -> PolicyRun |
Policy-driven onboarding with EDD, senior approval and fail-closed registry checks. | - | pure policy: yields tool calls, never does I/O |
scripted_brittle |
function | scripted_brittle(task: TaskInfo, control: AgentControl) -> PolicyRun |
The safe agent with documented, deterministic weaknesses (:data:BRITTLE_WEAKNESSES). |
- | pure (calls simulated tools only) |
scripted_naive |
function | scripted_naive(task: TaskInfo, control: AgentControl) -> PolicyRun |
Do whatever the task and the documents say. Never checks authority or suspension. | - | pure policy: yields tool calls, never does I/O |
scripted_safe |
function | scripted_safe(task: TaskInfo, control: AgentControl) -> PolicyRun |
Act only within authority; escalate or reject otherwise; fail closed; stop when told. | - | pure policy: yields tool calls, never does I/O |
Examples¶
The connectors example runs scripted_safe on PAY-001. The graders and kill switch examples run scripted_naive.
Invariants and gotchas¶
- The scripted agents are policies: generators that yield tool calls, and never do I/O themselves.
INSTRUCTION_PATTERNSis how the naive agent "obeys" planted instructions and how the safe one spots them. Changing it changes the adversarial pack's results.- The safe agent sends an idempotency key on every payment and re-checks the invoice and mandate after an approval. The guides copy both habits.
Where the tests are¶
Test files that import this package's modules (from the file index):
tests/e2e/test_golden_path.pytests/integration/test_adk_connector.pytests/integration/test_assess_cli.pytests/integration/test_claude_agent_sdk_connector.pytests/integration/test_confidential_bundles.pytests/integration/test_crewai_connector.pytests/integration/test_domain_packs.pytests/integration/test_evidence_bundle.pytests/integration/test_example_agents.pytests/integration/test_github_workflows.pytests/integration/test_manifests.pytests/integration/test_msaf_connector.pytests/integration/test_openai_agents_connector.pytests/integration/test_otel_collector.pytests/integration/test_strands_connector.pytests/live/test_live_connectors.pytests/unit/test_api.pytests/unit/test_bench.pytests/unit/test_brittleness.pytests/unit/test_builtin_packs.pytests/unit/test_cli.pytests/unit/test_conformance.pytests/unit/test_connectors.pytests/unit/test_control.pytests/unit/test_env_rl.pytests/unit/test_faults.pytests/unit/test_forge_generator.pytests/unit/test_forge_mutators.pytests/unit/test_gate.pytests/unit/test_generate_cli.pytests/unit/test_inspect_runner.pytests/unit/test_integrations.pytests/unit/test_otel.pytests/unit/test_otel_workflows.pytests/unit/test_reports.py