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
| Framework | Tool name CAIN sees | Plugs into |
|---|---|---|
| Python (any function) | transfer_funds | the function that acts |
| LangChain | transfer_funds | your agent's tool list |
| LangGraph | transfer_funds | the tools your graph's nodes call |
| OpenAI Agents SDK | transfer_funds | function tools |
| CrewAI | transfer_funds | CrewAI's before-tool-call hooks |
| LlamaIndex | transfer_funds | FunctionTool |
| Pydantic AI | transfer_funds | an agent capability |
| AutoGen (agentchat) | transfer_funds | the callables you give AssistantAgent |
| Google ADK | transfer_funds | the functions in an agent's tools |
| Claude Agent SDK | mcp__ops__transfer_funds | PreToolUse hooks |
| MCP client (Python) | transfer_funds | any MCP client session |
| OpenTelemetry | transfer_funds | your existing tracing |
| Any other framework | transfer_funds | any Python callable |
| TypeScript / JavaScript | transfer_funds | any async function |
| HTTP (any language) | transfer_funds | your 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