Guides
Build it right, the first time.
Task-oriented walkthroughs of the patterns we run in production, sequenced rather than alphabetised. Work down the page and each group assumes the one above it is already done.
12 guides, 11 of which carry runnable code for their stack; the rest is review material. 8 are written in Python, 3 against TypeScript ORMs, and 1 applies to either — the policy model is the same in both languages, so a guide written in one transfers to the other with the client swapped.
Start here
Wire it to the ORM you already run.
These are the setup guides. Pick the one matching the ORM already in your codebase, follow it end to end, and you finish with a policy-enforced layer over your own schema plus a tool call an agent can make against it. Nothing here assumes a rewrite: the policy wraps the client you have.
OrmAI with Drizzle
Drizzle is the ORM of choice for teams who want type safety without code generation. Here's how to wrap it with OrmAI's policy engine.
drizzle · typescript · edge
OrmAI with Prisma
Wrap your Prisma client with OrmAI's policy engine. Field-level redaction, tenant scoping, and audit logs over Prisma — without changing your schema.
prisma · typescript · nextjs
Quickstart: OrmAI with FastAPI and SQLAlchemy
Stand up a policy-enforced agent database layer in 5 minutes. SQLAlchemy models, FastAPI endpoints, OrmAI policy, and a working tool call you can hand to Claude or GPT.
quickstart · fastapi · sqlalchemy · python
Controls and integrations
Decide what the agent may see, change, and spend.
Once the wiring holds, this is what you add. One half covers the policy controls themselves — redaction, tenant scoping, query budgets, approval-gated writes, and the audit trail that records all four. The other half covers adapters, so those same controls reach an MCP client, a LangGraph node, or a Vercel AI SDK tool call without being re-implemented per framework.
OrmAI as an MCP server for Claude
Expose OrmAI's policy-enforced tools as a Model Context Protocol server. Drop it into Claude Desktop, Cursor, or any MCP client.
mcp · claude · anthropic · cursor
OrmAI with the Vercel AI SDK
Expose OrmAI tools to the Vercel AI SDK so your Next.js / Hono / Sveltekit agent has type-safe, policy-enforced database access.
vercel-ai-sdk · typescript · nextjs · agents
OrmAI with LangGraph
Wire OrmAI tools into a LangGraph state machine so each node has scoped, audited database access.
langgraph · langchain · python · agents
Write operations with approval gates
How to let an agent mutate state without losing your nerve. Reason-required writes, two-person approvals, dry runs, and rollback by design.
writes · mutations · approvals · human-in-the-loop
Query budgets and runaway agents
Bound how much your agent can scan, return, mutate, and spend per minute. The patterns that keep one curious prompt from melting your database.
performance · budgets · rate-limiting · operations
Audit logs you'll actually trust
What to log, where to put it, and how to query it when the security team asks 'what did the agent do?'
audit · compliance · soc2 · observability
Field-level redaction for PII
Stop your agent from ever seeing what it shouldn't. Mask, hash, or deny columns at the policy level — without touching application code.
pii · redaction · compliance · security
Multi-tenant isolation for AI agents
How to enforce tenant scoping for every read and write your AI agent makes — and why doing it any other way leaks data.
multi-tenant · isolation · security · rls
Before you ship
Review what you built.
Not setup material. Written to be read against a system that already runs, in the week before you point it at production data.
Not what you came for?
Guides assume you have already decided to build this. If you are still weighing the approach, the comparisons put OrmAI beside raw SQL, text-to-SQL, hand-rolled tools, and MCP database servers and name the cases where each of those is the better call. If you want the argument rather than the procedure, the articles cover why text-to-SQL breaks down under multi-tenancy, what capability-based security would mean for agents, and how to build an audit trail a model cannot quietly edit. Terms used without ceremony here are defined in the glossary.