CAIN-42 CAIN Studio

Recipes

Guard payments

For an agent that can move money, in 15 frameworks.

Last reviewed 2026-10-02

Small transfers run; anything over $100 waits for a person. The amount the rule reads is the one the model actually chose, because the adapter sends the call's real arguments.

The rule

{
  "name": "payments-guard",
  "effect": "require_approval",
  "priority": 10,
  "match_path": "/tools/transfer_funds",
  "conditions": [
    {
      "field": "amount_usd",
      "op": "gt",
      "value": 100
    }
  ]
}

Measured on production (2026-10-02, rule tester): the risky call below matches this rule and the safe one does not.

Risky{"amount_usd": 5000, "to_account": "acct-991"}
Safe{"amount_usd": 25, "to_account": "acct-991"}

Pick your framework

FrameworkTool name CAIN seesPlugs into
Python (any function)transfer_fundsthe function that acts
LangChaintransfer_fundsyour agent's tool list
LangGraphtransfer_fundsthe tools your graph's nodes call
OpenAI Agents SDKtransfer_fundsfunction tools
CrewAItransfer_fundsCrewAI's before-tool-call hooks
LlamaIndextransfer_fundsFunctionTool
Pydantic AItransfer_fundsan agent capability
AutoGen (agentchat)transfer_fundsthe callables you give AssistantAgent
Google ADKtransfer_fundsthe functions in an agent's tools
Claude Agent SDKmcp__ops__transfer_fundsPreToolUse hooks
MCP client (Python)transfer_fundsany MCP client session
OpenTelemetrytransfer_fundsyour existing tracing
Any other frameworktransfer_fundsany Python callable
TypeScript / JavaScripttransfer_fundsany async function
HTTP (any language)transfer_fundsyour own call site

Try CAIN-42 on your own agents

Create a free account and every new account starts with a 7-day trial of the full platform. Or try the sandbox first, with no account at all.

Create a free account →  ·  Try the sandbox  ·  See the whole ecosystem