CAIN-42 CAIN Studio

Recipes

Recipes: CAIN in your agent, step by step

17 integrations × the tools agents actually call: 184 pages, each with working code and live panels.

Last reviewed 2026-10-03

Every recipe has the same seven steps: get a key, install, put CAIN in front of the tool, see the live decision for that exact call, write a rule and test it before saving, handle held calls, check before you ship. Steps 4 to 6 are live panels that call the real API with your key.

Code follows the usage in each adapter's own source in cainstudio 0.4.2; every rule was run through the production rule tester with the arguments shown.

By framework

Python (any function)

Plugs into the function that acts. 10 recipes.

LangChain

Plugs into your agent's tool list. 10 recipes.

LangGraph

Plugs into the tools your graph's nodes call. 10 recipes.

OpenAI Agents SDK

Plugs into function tools. 10 recipes.

CrewAI

Plugs into CrewAI's before-tool-call hooks. 10 recipes.

LlamaIndex

Plugs into FunctionTool. 10 recipes.

Pydantic AI

Plugs into an agent capability. 10 recipes.

AutoGen (agentchat)

Plugs into the callables you give AssistantAgent. 10 recipes.

Google ADK

Plugs into the functions in an agent's tools. 10 recipes.

Claude Agent SDK

Plugs into PreToolUse hooks. 10 recipes.

MCP client (Python)

Plugs into any MCP client session. 10 recipes.

OpenTelemetry

Plugs into your existing tracing. 10 recipes.

Any other framework

Plugs into any Python callable. 10 recipes.

Claude Code hooks

Plugs into Claude Code's PreToolUse hook. 3 recipes.

Cursor hooks

Plugs into Cursor's permission hooks. 3 recipes.

TypeScript / JavaScript

Plugs into any async function. 10 recipes.

HTTP (any language)

Plugs into your own call site. 10 recipes.

By what the agent can do

Payments

An agent that can move money

Refunds

A support agent that issues refunds

Email

An agent that sends email

SQL

An agent with database access

Shell

An agent that runs shell commands

HTTP requests

An agent that fetches urls

Files

An agent that writes files

Deployments

An agent that ships code

Customer data

An agent that exports records

Code merges

An agent that merges pull requests

Coding agents (Claude Code, Cursor)

Shell commands

Claude code or cursor running commands

Secrets on disk

The editor touching credentials

Web fetches

The agent fetching urls

Calls in detail: the API reference.

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