Framework Adapters
First-class adapters for the major JS agent frameworks. One-line integration for Mastra, Vercel AI, LangChain, OpenAI Agents, Anthropic, Genkit, LlamaIndex, Mistral, Ollama — plus MCP and Bedrock.
First-class adapters for every major JS agent framework — each ships pre-scan, post-scan, streaming, and tool-call governance. Wrap your existing tools in one line — the adapter intercepts every call, runs the policy pipeline before execution, and logs an audit event. No changes to your agent logic.
How Adapters Work
Every adapter follows the same three-step flow:
- Wrap — Adapter wraps your framework-native tools
- Enforce — Before each call,
gov.enforce()evaluates policies - Audit — Decision, agent, tool, and timestamp written to audit trail
Note: Adapters auto-register the agent on first use. You do not need to call
gov.register()manually when using an adapter.
Mastra
Middleware that plugs into the Mastra agent pipeline. Every tool call is governed before it reaches your handler.
Vercel AI SDK
Wraps your Vercel AI tools so every invocation is policy-checked. Returns governed tools you pass directly to generateText().
LangChain
Governs LangChain-style tools. Works with any tool that extends StructuredTool.
OpenAI Agents SDK
Wraps individual OpenAI agent tools. Governance runs before each function call.
Anthropic
Governs Anthropic tool-use calls. Policy enforcement runs before the tool handler executes.
Tip: All adapters accept the same options:
agentNameandowner. The agent is registered automatically with these identifiers on first use.
All adapters
Every adapter is available as a separate import path. Zero unused code in your bundle.
Featured — full LLM + tool coverage (pre + post + streaming + tools)
| Adapter | Import Path |
|---|---|
| Mastra (middleware) | plugins/mastra |
| Mastra Processor | plugins/mastra-processor |
| Vercel AI SDK | plugins/vercel-ai |
| LangChain / LangGraph | plugins/langchain |
| OpenAI Agents SDK | plugins/openai-agents |
| Anthropic | plugins/anthropic |
| Firebase Genkit | plugins/genkit |
| LlamaIndex | plugins/llamaindex |
| Mistral | plugins/mistral |
| Ollama | plugins/ollama |
Specialty
| Adapter | Import Path | Scope |
|---|---|---|
| MCP | plugins/mcp | Build a governed MCP server — input + output injection scans + tool-call audit. |
| AWS Bedrock Agents | plugins/bedrock | Entry-gate on InvokeAgent + scanOutput helper. Internal tool calls inside the Bedrock run are opaque (server-side inside AWS). |
Python, edge runtimes, and other languages
If your agent isn't TypeScript, call the Lua Governance REST API directly — same policy, scoring, audit, and injection-detection endpoints the SDK uses internally. The SDK itself is pure ESM with zero runtime deps, so it runs unmodified under Node, Deno, Bun, Cloudflare Workers, and any other Web-standard runtime — no adapter needed.
Import Pattern
Every adapter follows the same import convention:
Note: Each adapter is tree-shakeable. Only the adapter you import is included in your bundle — the other 19 are never loaded.