Essay

Why fraud models should only propose. By Amir Shachar.

Read the essay
Skip to content
Riskernel

Agent Guardrails

Deterministic guardrails for money-moving AI agents.

Before an autonomous support, ops, or treasury agent executes a refund, payout, credit-limit change, or payee update, Riskernelâ„¢ enforces four deterministic sub-5ms checks and writes a SHA-256 hash-chained audit record.

Short answer

Prompt filters and identity tokens cannot tell whether a 2,500 USD refund against a 49 USD order violates your ledger or whether eight 48 USD payouts in four minutes breach a cumulative blast-radius cap. Riskernel’s Algogens kernel checks every tool proposal against live ledger state, YAML policy rules, and sliding-window caps before any money-moving tool runs.

60-second quickstart · Apache-2.0
# 1. Install open-core Python & MCP guardrails
pip install finagent-guard

# 2. Run all 20 adversarial scenarios (Unprotected vs Protected)
finagent-guard demo

# 3. Inspect & verify the tamper-evident SHA-256 chain
finagent-guard audit-verify audit_trace.jsonl
finagent-guard replay audit_trace.jsonl

# 4. Generate a policy template for your payout/refund tools
finagent-guard init-policy --out policy.yaml

Zero API keys required for the local benchmark. Runs in Python 3.11+, MCP JSON-RPC servers, and OpenAI or Anthropic tool wrappers with exact Decimal monetary arithmetic.

Architecture Comparison · Why prompt guards fail

Why prompt filters, KYA, and behavioral biometrics miss financial drains.

Text guardrails inspect words. Agent identity checks authenticate callers. Neither verifies whether a proposed tool call matches ledger truth, stays inside policy bounds, or compounds into a cross-session drain.

Four-way comparison for money-moving AI agents
Prompt Guards / DLP Know Your Agent (KYA) Behavioral Biometrics Riskernel Kernel
What it inspects Prompt text, regex, PII patterns Agent credentials, OAuth scopes, tokens Keystroke, pointer, session cadence Typed tool arguments, live ledger state, and blast radius
Indirect prompt injection Bypassed by encoded or disguised text in merchant names or tickets Valid token still signs the poisoned tool call No visibility into backend agent tool parameters Blocked before execution by schema, telemetry grounding, and policy checks
Smurfing & split bursts Stateless per-message scoring Per-request auth without cumulative state Flags anomalous humans, misses authorized agents Sliding-window velocity & cumulative caps across session, user, and new payee
Monetary precision & repair Binary block or pass on text Binary allow or deny Probabilistic session score Exact Decimal math with ALLOW, BOUNDED_REPAIR, HOLD_FOR_APPROVAL, or BLOCK
Regulator audit replay Text logs without state proof Token issuance logs only Heuristic risk score SHA-256 hash-chained JSONL trail with deterministic bit-for-bit replay
Provenance: Reflects the live architecture implemented in finagent-guard and the patent-pending Riskernelâ„¢ engine (US provisional 64/197,364).

Deterministic Kernel · Sub-5ms Gate

Four deterministic checks plus SHA-256 audit replay.

Under the Algogens framework, models only propose. Four deterministic validators inspect every tool proposal in order before any financial API or MCP server executes it.

  1. Check 01

    Schema integrity

    Enforces strict typed Pydantic v2 models (ToolProposal), exact Decimal monetary precision, currency normalization, and allowlisted tool names. Rejects unknown arguments and privilege-escalation flags such as bypass_check=True.

  2. Check 02

    Telemetry grounding

    Queries the ground-truth ledger or ERP backend before execution. Verifies that the referenced order exists, refund totals never exceed settled order amounts, payout destinations match verified records, and snapshot telemetry is not stale.

  3. Check 03

    Policy consistency

    Evaluates declarative YAML Policy-as-Code: role-to-tool permissions, restricted destination corridors, new-payee cooling windows, idempotency replay protection, and dual-control thresholds that route borderline cases to HOLD_FOR_APPROVAL.

  4. Check 04

    Blast radius

    Tracks sliding time windows across session, agent, user, new payee, and global caps. Stops smurfing (such as eight 48 USD refunds under a 50 USD single-call limit), multi-account split wires, and credit-limit-to-payout drains.

  • ALLOW

    All four checks pass within policy thresholds. Tool executes with idempotency protection.

  • BOUNDED_REPAIR

    An over-broad action is deterministically clamped within safe policy bounds (for example, capping a partial refund to remaining order balance) when permitted by policy.

  • HOLD_FOR_APPROVAL

    Legitimate but high-value or new-payee actions pause cleanly for human review instead of auto-executing.

  • BLOCK

    Fabricated IDs, prompt injections, restricted corridors, replay attempts, and blast-radius breaches are halted before funds move.

SHA-256 hash-chained audit record
{
  "seq": 1,
  "tool_name": "issue_refund",
  "amount": "2500.00",
  "decision": "BLOCK",
  "failed_checks": ["telemetry_grounding", "blast_radius"],
  "latency_ms": 0.42,
  "prev_hash": "0000...gen",
  "record_hash": "a8f4c19e...SHA256"
}

Deployment Tiers · Open-Core & Enterprise

Start with Apache-2.0 open-core. Scale to federated Riskernel Cloud.

Every deterministic check runs locally in your own Python process or MCP gateway. Add Riskernel Enterprise Cloud when you want cross-institution federated signals and continuous adversarial hardening.

Open-Core · Apache-2.0

finagent-guard

  • Runs locally in-process, via @guard_financial_tool, or as an MCP JSON-RPC tools/call interceptor
  • All four deterministic sub-5ms checks with exact Decimal arithmetic
  • YAML Policy-as-Code (default_fintech_policy.yaml and strict_treasury_policy.yaml)
  • In-memory and SQLite ground-truth ledger and sliding-window state stores
  • 20-scenario adversarial red-team benchmark and self-contained HTML scorecard
  • SHA-256 hash-chained JSONL audit log with audit-verify and replay

Enterprise Platform · Riskernelâ„¢

Riskernel Enterprise Cloud

  • Federated pattern sharing: cross-institution scam and prompt-injection intelligence where raw client data never leaves your boundary
  • Cross-tenant payee & mule graph: real-time RiskSignalProvider API enrichment for first-time payout corridors and mule rings
  • Purple Algogen adversarial testing: continuous held-out scam-script mutation runs tailored to your agent tools
  • Fraud Surface OS integration: 47 ms median scoring (Riskernel-reported; single calls vary) with signed SHAP explanations
  • 14-day parallel shadow test and private Agent Launch Review attack tree signed by Amir Shachar

Empirical Evidence · Benchmarks & Field Notes

Tested against 1,280 scam-script attacks and 20 financial exploits.

Every claim on this page is backed by reproducible code, held-out attack transcripts, and empirical benchmarks.

Benchmark 01 · ScamScript-Bench

1,280 adversarial attack runs, zero unauthorized drains

Evaluated across 32 attack scenarios, 4 models, and 2 policy profiles (5 trials each), plus 320 benign customer runs. Deterministic pre-execution gating stopped all 1,280 attack runs while passing all 320 benign requests without false refusals.

Inspect ScamScript-Bench & transcripts

Benchmark 02 · finagent-guard Red Team

53,124.00 USD drained unprotected, 0.00 USD under Riskernel Kernel

Across 20 adversarial and control scenarios (including indirect prompt injection, smurfing under caps, double-refund replay, ATO-to-new-payee drains, Arup-style split wires, and stale telemetry races), unprotected runs lost 53,124.00 USD across 18 attacks while protected runs stopped 18 of 18 attacks with 0.00 USD loss, zero false positives, 0.038 ms median kernel latency (0.072 ms 99th percentile), and 49 of 49 SHA-256 records replayed bit for bit.

Read the 20-exploit red-team teardown

Technical field notes on agentic financial guardrails

  1. 20 Ways Money-Moving AI Agents Get Drained (and How Deterministic Gates Stop All 20)

    Across 20 realistic money-moving AI agent scenarios, 18 exploits drained 53,124.00 USD unprotected while four deterministic sub-millisecond checks cut attack loss to 0.00 USD with zero false positives.

  2. Why KYA (Know Your Agent) Does Not Stop Agent Fraud

    KYA proves who built and authorized an AI agent at checkout, yet fails when authenticated agents get hijacked or structure sub-cap refunds against internal ledgers.

  3. Why Behavioral Biometrics Break on AI Agents

    Behavioral biometrics measures physical human friction, leaving server-side MCP and refund agents blind and human co-pilots exposed to indirect prompt injection.

  4. Why Cyber Prompt Guards Cannot Protect Money-Moving Agents

    Cyber prompt guards inspect text for jailbreak syntax, whereas financial agent exploits use polite, policy-compliant requests to drain ledgers via smurfing and tool abuse.

  5. Unblocking the CISO and Risk Committee on Refund and Payout Agents

    A 14-day practitioner playbook to unblock CISO and Risk Committee sign-off on autonomous refund and payout agents using deterministic Policy-as-Code envelopes and sliding-window blast-radius caps.

  6. Regulator Replay for Autonomous Financial Agents: SR 26-2, Reg E, UK PSR, and PSD3

    Why LLM prompt logs fail Federal Reserve SR 26-2, Reg E, UK PSR APP reimbursement, and EU PSD3 audits, and how SHA-256 hash-chained deterministic replay satisfies examiners.

  7. Can Your AI Agent Be Talked Into Moving Money? Testing Chat and Voice Agents Against Scam Scripts

    How fraudsters social-engineer customer-facing AI chat and voice agents, where those agents fail, and a self-check fraud teams can run.

  8. What Is the Worst Your AI Agent Could Do? Putting a Money Number on It

    Most AI agent reviews test the model. Risk committees need the worst-case loss if an agent is hijacked. How to estimate it from tool scopes and limits.

  9. Propose, then verify: where a language model belongs in a fraud stack

    A language model can propose fraud rules and explanations, but a deterministic check, separate from the model, should decide what runs in a payment flow.

Questions teams ask

Frequently asked questions on AI agent financial guardrails

Why are prompt guardrails and DLP not enough for money-moving AI agents?

Prompt filters inspect text tokens before or after a model call, so they have no visibility into your order ledger, cumulative refund velocity, or payee newness. An attacker can send completely polite text or an indirect prompt injection inside a merchant name that causes an unprotected agent to issue an oversized refund or split payouts under a single-transaction cap.

How does finagent-guard integrate with MCP servers, Python tools, and Stripe handlers?

You can wrap any Python function with @guard_financial_tool, intercept MCP JSON-RPC tools/call payloads via MCPFinancialGuardMiddleware, or wrap LLM tool loops with OpenAIToolGuard and AnthropicToolGuard so every financial call passes through FinancialRiskKernel before executing.

What happens when a deterministic check fails on a borderline legitimate request?

Riskernel supports four explicit outcomes: ALLOW, BOUNDED_REPAIR, HOLD_FOR_APPROVAL, and BLOCK. A borderline legitimate request above an auto-approval cap routes cleanly to HOLD_FOR_APPROVAL instead of silently executing or causing a permanent failure.

How do auditors verify what an AI agent proposed and why it was blocked?

Every evaluation writes a SHA-256 hash-chained JSONL record linking the input proposal, telemetry snapshot, policy version, individual check results, and final decision. Running finagent-guard audit-verify detects any log tampering, and finagent-guard replay reproduces the exact decision bit for bit.

Agent Launch Review

Deploying an AI agent with refund, limit, or payout tools?

Tell us what your agent can touch in two lines. You get a private attack tree back: how the agent tool flow gets abused, worst-case blast radius, and the three deterministic controls that stop it. Signed by Amir Shachar. No call needed.

What you send stays private. One signed reply from Amir, no mailing list.