Guide3 min read

Naïve Inside Your Agent Framework (Governed Tools, Any Orchestrator)

Naïve as the governed tool layer under any agent framework — keep your orchestrator; add identity, connections, caps, and approvals via agentTools() or MCP.

Read the docs →

Guide
TL;DR
  • Your agent framework runs the loop reasoning, planning, memory inside the harness. Naïve is the governed tool layer underneath: identity, money, comms, connections, and policy on every real-world action.
  • You do not replace LangGraph, Vercel AI SDK, CrewAI, or your custom loop. You inject Naïve's tools so regulated calls hit the governance gateway capped, approval-routed, audited, revocable.
  • Two integration paths: in-process `agentTools()` in TypeScript (lowest latency) or per-user MCP sessions (any language, untrusted runtimes).
  • Provision once: Account Kit + tenant user. Runtime code only binds `forUser(id)` and hands tools to the framework.
  • Every guide in the docs integrations index follows the same pairing pattern adapter code differs, governance does not.
  • Start BYO runtime; add hosted execution later if you want Naïve to operate the compute.

Naïve inside your agent framework means keeping the orchestrator you already chose and adding a governed tool layer underneath it. LangGraph runs the graph; Vercel AI SDK runs generateText; CrewAI runs the crew — Naïve is autonomous company infrastructure that handles what happens when the model tries to spend money, send email, connect an app, or read a vaulted secret.

This post is the map, not a per-framework tutorial. The docs integrations index holds the step-by-step guides; here is the mental model that makes every guide the same story with different adapter code.

What does each layer own?

LayerOwnsDoes not own
Your frameworkModel calls, agent state, planning loops, handoffs, streamingPer-user identity, cards, OAuth token storage, spend enforcement
NaïveTenant users, Account Kits, governed tools, approvals, audit, revokeYour prompt, your graph topology, your model provider choice

The split matters because teams often try to bolt payment and OAuth onto the framework. That duplicates work and leaves policy in prompts. Naïve keeps orchestration in your stack and moves real-world authority to a governance gateway that checks every tool call server-side — the same model described in The Governed Agent Profile.

How does the pairing work?

  Your framework (orchestration)          Naïve (governed tools)
  ─────────────────────────────          ───────────────────────
  model picks a tool
        │
        ▼
  framework invokes tool  ──────────▶  gateway checks Account Kit
                                              │
                                         execute · 202 pending_approval · forbidden
                                              │
                                         audit log · revocable session

Two wiring patterns cover every guide in the index:

1. In-process agentTools() (TypeScript)

Best when the agent runs in a backend you control:

import { Naive } from "@usenaive-sdk/server";
 
const naive = new Naive({ apiKey: process.env.NAIVE_API_KEY! });
const user = await naive.users.create({ email: "customer@acme.com" });
const kit = naive.forUser(user.id).agentTools();
 
// Adapt kit.tools into LangGraph / AI SDK / OpenAI Agents format;
// dispatch with kit.handle(name, input) — AccountKit-gated server-side.

See LangGraph or Vercel AI SDK for the exact adapter.

2. Scoped MCP session (any language)

Best for Python stacks, edge runtimes, and untrusted hosts:

const client = naive.forUser(user.id);
const session = await client.session({ ttlMs: 15 * 60 * 1000 });
// session.mcp.url + session.mcp.headers → your framework's MCP client

Python guides (CrewAI, Pydantic AI, AutoGen, …) mint the session over REST and attach it to the framework's MCP transport. Details: delegated, revocable MCP sessions.

Which guide matches your stack?

Every row follows the same control-plane setup (Account Kit + user) and differs only in adapter code:

StackDocs guideTypical wiring
Vercel AI SDKintegrations/vercel-ai-sdkIn-process agentTools()
LangGraph / LangChainintegrations/langgraphIn-process agentTools()
OpenAI Agents SDKintegrations/openai-agentsIn-process or MCP
CrewAIintegrations/crewaiMCP (MCPServerSSE)
Pydantic AIintegrations/pydantic-aiMCP
Python / edge / voiceintegrations/overviewMCP session + REST control plane

The full table — Mastra, Cloudflare Agents, AutoGen, Google ADK, Semantic Kernel, LlamaIndex, Claude Agent SDK, Agno, DSPy, smolagents, Letta — lives on the integrations overview.

Where does the runtime run?

Framework choice and runtime hosting are separate decisions. Hosted vs bring-your-own runtime compares both paths; the default recommendation is BYO: inject governed tools into the loop you already ship. Naïve-hosted microVMs are optional when you want managed compute with credentials injected at boot.

What stays enforced?

No matter which framework or transport you pick:

  • Identity — every action runs as a specific tenant user.
  • Policy — the Account Kit bounds primitives and apps.
  • Spend — cards and credits respect kit limits; the model cannot raise its own ceiling.
  • Human-in-the-loop — sensitive actions freeze as approvals until a human decides.
  • Revoke — suspend the agent profile or kill an MCP session in one call.

Where to start

  1. Read Building AI Agents Into Your SaaS if you have multiple customers — forUser(id) is the isolation boundary every framework guide assumes.
  2. Pick the integration guide that matches your orchestrator.
  3. Wire one gated action end to end — connect an app, issue a capped card, or send from a per-user inbox — before widening the kit.

For a full tutorial using MCP, see Build a bring-your-own-agent platform.

Frequently Asked Questions
Does Naïve replace my agent framework?+
No. Naïve is runtime-agnostic governance at the tool-call boundary. LangGraph, Vercel AI SDK, OpenAI Agents, CrewAI, Pydantic AI, and custom loops keep doing orchestration — model calls, state, handoffs. Naïve supplies the governed primitives the framework does not: per-tenant identity, virtual cards, inbox, vault, 1,000+ connectable apps (per published docs), and server-side caps, approvals, audit, and revoke on every regulated action.
What are the two ways to integrate Naïve with a framework?+
In-process (TypeScript): import `@usenaive-sdk/server`, provision with `naive.forUser(id)`, adapt `client.agentTools()` into the framework's native tool format, and run the loop. MCP session (any language): mint a scoped SSE session for the tenant user and point the framework's MCP client at it — Python, edge workers, and voice stacks typically use this path. Both enforce the same Account Kit policy server-side.
When should I use agentTools() vs an MCP session?+
Use `agentTools()` when the agent runs in your trusted Node backend — lowest latency, simplest adapter. Use MCP when the runtime is Python, .NET, an edge worker, a voice pipeline, or any host you do not fully control: mint a short-lived session (default TTL 15 minutes, max 24 hours per published docs), pass URL + headers to the MCP client, revoke when done. See the delegated MCP sessions explainer for the lifecycle.
Do I configure a different Naïve setup per framework?+
No. Account Kits and tenant users are provisioned once on the control plane. Each framework guide is an adapter layer — how tools enter LangGraph's `tool()` vs CrewAI's MCP workbench vs LiveKit's `MCPServerHTTP`. Policy, spend caps, and approvals are identical because enforcement lives on Naïve's servers, not in framework config.
Where are the step-by-step framework guides?+
The docs integrations index lists every pairing guide: Vercel AI SDK, LangGraph, OpenAI Agents, Mastra, Cloudflare Agents, AutoGen, Google ADK, Semantic Kernel, Pydantic AI, LlamaIndex, Claude Agent SDK, Agno, DSPy, smolagents, Letta, and CrewAI — each with tested adapter code and version notes. Pick the guide that matches your orchestrator; the governance story is the same in all of them.
What should I read before picking a framework guide?+
Read [hosted vs bring-your-own runtime](/blog/hosted-vs-bring-your-own-runtime-for-ai-agents) for where the loop runs, [The Governed Agent Profile](/blog/the-governed-agent-profile) for caps/approvals/revoke, and [Build a bring-your-own-agent platform](/blog/how-to-build-a-bring-your-own-agent-platform) for an end-to-end MCP tutorial. The [SDK overview](https://usenaive.ai/docs/sdk/overview) covers `agentTools()` and session minting.
NT
Naïve Team

Building the agent-native backend.

Keep reading