OrmAI

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.

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.

python code

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

typescript code

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

python code

OrmAI with LangGraph

Wire OrmAI tools into a LangGraph state machine so each node has scoped, audited database access.

langgraph · langchain · python · agents

python code

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

python code

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

python code

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

python code

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

python code

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.