Skip to content

yLeah/neolayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeoLayer

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.

Three Core Ideas

  1. Agents act — Your agent calls tools. NeoLayer does not decide which tools.
  2. NeoLayer evaluates — Each call is evaluated for intent drift against a baseline.
  3. Policy intervenes — Allow, warn, or block based on drift and sensitivity.

See WHY_NEOLAYER.md for risk mitigation and design principles.

Quick Start

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 Simulation

See QUICKSTART.md for detailed setup.

Wrapper Quickstart

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.

Features

  • 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-runPOST /api/policy/dry-run to see what NeoLayer would do without enforcement.
  • Session risk summaryGET /api/sessions/:id/risk-summary for executive view.
  • REST API — Sessions, tool-calls, intent, policy; simulation and trace replay.
  • Docker — Dockerfile and docker-compose.

Requirements

  • Node.js ≥ 18
  • SQLite (better-sqlite3)
  • Gemini API key (required for intent inference)

Scripts

Script Purpose
npm start Start server
npm run verify-env Check Node, .env, GEMINI_API_KEY
npm run example Run Node wrapper example

API Summary

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.

Documentation

License

MIT.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors