Intent-drift firewall for autonomous AI agents. Every tool call is evaluated against a baseline; decisions (allow / warn / block) come with full explanations. Built for trust, adoption, and audit.
- Agents act — Your agent calls tools. NeoLayer does not decide which tools.
- NeoLayer evaluates — Each call is evaluated for intent drift against a baseline.
- Policy intervenes — Allow, warn, or block based on drift and sensitivity.
See WHY_NEOLAYER.md for risk mitigation and design principles.
npm install
cp .env.example .env # set GEMINI_API_KEY from https://aistudio.google.com/apikey
npm run verify-env && npm run verify-db
npm start
# Open http://localhost:3000 → Run SimulationSee QUICKSTART.md for detailed setup.
Integrate in under 30 minutes. See docs/integrations/.
Hello World (Node.js):
import { IntentGuardWrapper } from './src/wrapper/intentguard-wrapper.js';
const wrapper = new IntentGuardWrapper({
apiUrl: 'http://localhost:3000',
agentName: 'my-agent',
baselineIntent: 'Help users with support tickets'
});
await wrapper.initialize();
const safeSearch = wrapper.wrapTool('search_tickets', searchTickets, {
sensitivity: 'medium',
declaredPurpose: 'Find open tickets'
});
const tickets = await safeSearch({ status: 'open' });What gets intercepted: Tool name, params, sensitivity, declared purpose.
On block: Tool does not run; IntentGuardBlockError thrown.
On warn: Tool runs; warning logged; human review recommended.
- Wrapper SDK — Intercept tool calls; enforce allow/warn/block.
- Intent inference — Gemini-based with semantic context; no silent fallbacks.
- Policy + explainability — Risk breakdown, human-readable explanation, contributing signals.
- Dry-run —
POST /api/policy/dry-runto see what NeoLayer would do without enforcement. - Session risk summary —
GET /api/sessions/:id/risk-summaryfor executive view. - REST API — Sessions, tool-calls, intent, policy; simulation and trace replay.
- Docker — Dockerfile and docker-compose.
- Node.js ≥ 18
- SQLite (better-sqlite3)
- Gemini API key (required for intent inference)
| Script | Purpose |
|---|---|
npm start |
Start server |
npm run verify-env |
Check Node, .env, GEMINI_API_KEY |
npm run example |
Run Node wrapper example |
| Method | Path | Description |
|---|---|---|
| POST | /api/sessions | Create session |
| POST | /api/tool-calls | Intercept tool call |
| POST | /api/policy/dry-run | Dry-run evaluation (no enforcement) |
| GET | /api/sessions/:id/risk-summary | Session risk summary (executive view) |
| GET | /api/policy/config | Policy config |
See QUICKSTART.md for full API list.
- WHY_NEOLAYER.md — Problem, core ideas, what NeoLayer mitigates
- QUICKSTART.md — Setup and first run
- ARCHITECTURE.md — Simplified architecture
- DEBUGGING.md — Gemini failures, policy tuning, logs
- docs/integrations/ — Node, Python, LangGraph integration guides
MIT.