Documentation
Everything you need to integrate NjiraAI into your AI agents.
Getting Started
Getting Started
Everything you need to start governing your AI agents with NjiraAI — from API key to your first BLOCK verdict.
Architecture Reference
The structural model of the NjiraAI policy system across Gateway and SDK implementations.
Policy Management
A complete runbook for authoring, validating, and rolling out NjiraAI policies safely.
SDK Quickstart
Integrate NjiraAI into your AI agent in minutes with Python and TypeScript.
Guides
Context Propagation
A setup guide for ensuring traces and spans remain connected across async boundaries.
Enforcement (Tool Boundaries)
A runbook for safely intercepting inputs and outputs at the tool boundary.
Gateway Routing & Integration
A runbook for protecting remote AI agents using the Njira Gateway transparent proxy.
Performance Tuning & Cost Management
A runbook for optimizing latency and cost using NjiraAI's tiered model cascade.
Modes and Failure Behavior
A runbook for configuring gateway resiliency, shadow versus active modes, and handling upstream outages.
Serverless Deployment Runbook
A pre-flight guide to guarantee trace delivery in short-lived v8/Lambda runtimes.
Observability & Telemetry Manual
An implementation guide for capturing LLM spans, tool executions, and custom policy events.
Operational Metrics & Capacity
A runbook for monitoring request volume, verdict distributions, and data retention.
Agent Playbooks
Quickstart: NjiraAI in 3 Steps
Get your first ALLOW/BLOCK verdict from NjiraAI in under 5 minutes.
Integrate with SDK
Add NjiraAI governance to your AI agent using the Python or TypeScript SDK.
Integrate via Proxy (Gateway)
Route agent traffic through the NjiraAI Gateway for zero-code governance.
Shadow → Active Rollout
Safely roll out NjiraAI from observe-only to active enforcement.
Policy Packs
Apply, simulate, and customize NjiraAI policy packs for your agent.
Troubleshooting
Common errors and fixes when integrating NjiraAI.
Integrations
CrewAI (Python)
Enforce at tool boundaries using CrewAI tool hooks (before/after).
Express (TypeScript)
Add NjiraAI middleware to Express apps for automatic context and tracing.
FastAPI (Python)
Add NjiraAI middleware to FastAPI apps for automatic context and tracing.
Fastify (TypeScript)
Add NjiraAI middleware to Fastify apps for automatic context and tracing.
LangChain.js (TypeScript)
Trace LangChain.js runs via callbacks and optionally enforce at tool boundaries.
LangChain (Python)
Trace LangChain runs via callbacks and optionally enforce at tool boundaries.
Next.js (TypeScript)
Use NjiraAI with Next.js App Router route handlers.
Examples
CrewAI Basic
Hook NjiraAI into CrewAI tool execution for enforcement and tracing.
Express Basic
A minimal Express app with NjiraAI enforcement and tracing.
FastAPI Basic
A minimal FastAPI app with NjiraAI enforcement and tracing.
LangChain Python Basic
Trace LangChain Python with NjiraAI callbacks and enforce at tool boundaries.
LangChain.js Basic
Trace LangChain.js with NjiraAI callbacks and enforce at tool boundaries.
Next.js Route Handler
Use NjiraAI with Next.js App Router API routes.