Lelu-ai/lelu has 78 GitHub stars and 24 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-18 11:52 UTC. Last push 2026-11-17.
Measured star growth
- in 24h
- +1
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Open source authorization engine for AI agents. Confidence-aware gating · Human-in-the-loop review · Policy-as-code · Full audit trail
AIREADME.md
Original
Lelu
Authorization engine for AI agents.
Every action checked. Every decision logged. Humans in the loop when it matters.
Live Sandbox · One-Command Start · Claude Code Plugin · Examples · MCP Server · Contributing · Discussions
What is Lelu?
Lelu is an open-source authorization engine that sits between your AI agent and the real world. Before the agent takes any action — issuing a refund, sending an email, deleting a record — it asks Lelu first, and Lelu returns one of four decisions:
- ✅
allow— the action runs - ⛔
deny— blocked, with a reason - 🙋
human_review— the agent pauses until a human approve - 🧪
compute— redirected to a safer alternative or sandbox
It's one HTTP call from any language or framework, every decision is written to an audit log, and the engine runs entirely on your own machine or infrastructure.
Why Lelu?
A decision point and approval layer for AI agent actions — with a signed record of every decision.
Lelu sits next to your policy engine, not in place of it. OPA, Cedar, Cerbos and your identity provider decide who may do what; Lelu adds a human-approval step that is bound to the exact call that was reviewed, and a signed, hash-chained record of every decision. It also offers advisory signals — a phrase-based prompt-injection screen and a confidence gate — that can only make a decision stricter. See What Lelu does not do before you rely on it.
OPA, Casbin, and AWS AVP handle role & permission checks, but stop there. Lelu does that too, and adds:
- Advisory prompt-injection screening (phrase matching; English only, easy to evade — a speed bump, not a defence)
- Confidence gating on a caller-supplied confidence signal (the engine cannot verify it)
- Human-in-the-loop pause → approve → resume (Slack / Teams / PagerDuty)
- Behavioral anomaly & reputation scoring
- A full audit log of every decision
What Lelu does not do
Read this before you depend on Lelu. These limits come from an independent audit of version 0.0.14 and are being worked on; each has a tracking issue.
- It advises; it does not enforce. Lelu returns a decision. Something on the agent's side must obey it. The Claude Code plugin and a gateway integration put that step outside the model; an MCP tool the model may choose to call does not.
- One API key does everything by default. In the default single-key mode the key an agent authorizes with can also change the policy and resolve reviews. Run with separate credentials: set
LELU_REVIEWER_KEYS(so only a reviewer key can approve) and keep the admin key away from the agent. - Human review is self-service until you set
LELU_REVIEWER_KEYS. Without it, any holder of the API key can approve a review, including the agent that triggered it. The engine logs a warning at boot. - Actor names are self-asserted unless the caller presents a workload token (
X-Lelu-Agent-Token). Policy keyed on actor name protects nothing against a caller that lies about it. - YAML policy matches action names, not arguments. Use Rego for argument-aware rules. A deny list over names can be sidestepped by renaming the action.
- The injection screen is a speed bump. It matches a short list of English phrases and misses most paraphrases, other languages and encodings. It also flags ordinary text that contains words like "act as a".
- Audit events can be dropped under load unless you set
LELU_AUDIT_BLOCK_ON_FULL=true. - Single process. The engine stores state in SQLite and process memory. Do not run more than one replica.
- Set
JWT_SIGNING_KEYandVAULT_KEYto random values. The defaults are public.
Found something else? See SECURITY.md.
Try it in one command
No account, no Docker, no config — the real engine runs on your machine:
npx -y lelu-mcp start
Give Claude Code guardrails right now:
claude mcp add lelu -- npx -y lelu-mcp start --transport stdio --preset coding-agent
Your agent gets a lelu_agent_authorize tool using the coding-agent preset: editing files, running tests and local git are allowed; package installs, pushes, deploys and anything touching secrets or env files go to human review; destructive actions are denied; everything else is default-denied. Rules live in ~/.lelu/policy.coding-agent.yaml (omit --preset for the general starter policy in ~/.lelu/policy.yaml). Cursor / Claude Desktop setup and full docs → sdk/mcp
Claude Code plugin — no tool-calling required
The MCP server above gives your agent a tool it can choose to call. The Claude Code plugin goes further: it hooks directly into every Bash, Edit, and Write call via Claude Code's own PreToolUse hook, so protection doesn't depend on the agent remembering to ask.
git clone https://github.com/lelu-ai/lelu.git && cd lelu
claude plugin marketplace add ./
claude plugin install lelu@lelu
./plugin-claude-code/install.sh
Expansion-aware — rm -rf ~/, rm -rf $HOME, and reversed/separated/long-form flag variants are all caught, where a regex on the raw command text catches 7/10 and false-positives on 4/4 benign commands — plus retry-storm detection and a session budget for runaway unattended sessions. Shadow mode by default, nothing blocks until you ask it to. Full docs → plugin-claude-code
The plugin stores its ledger, mode, socket, and daemon log in
$HOME/.lelu/claude-plugin by default. Set LELU_DATA_DIR to use another
directory; LELU_HOME is also accepted as a compatibility alias when
LELU_DATA_DIR is not set.
Quickstart (SDK)
npm install lelu-agent-auth # TypeScript — or: pip install lelu-agent-auth-sdk
import { lelu } from "lelu-agent-auth";
// Zero-config: discovers the engine `npx lelu-mcp start` runs on this
// machine (URL + key live in ~/.lelu) — no account, nothing to configure.
// Self-hosted or cloud instead? lelu({ baseUrl, apiKey }).
const auth = lelu();
const decision = await auth.authorize({
tool: "delete_record",
context: { confidence: 0.82, actingFor: "user_42" },
});
if (decision.decision === "allow") {
await deleteRecord(id);
} else if (decision.decision === "human_review") {
await notifyReviewer(decision.reviewId); // agent pauses, human approves, resumes (reviewId is the queue ID)
} else if (decision.decision === "compute") {
await saferAlternative(decision.safeTool, decision.safeArgs); // redirected to sandbox
} else {
throw new Error(decision.reason); // denied
}
Four outcomes. Every decision audited. No other changes to how you build. Works with OpenAI, Anthropic, LangChain, LangGraph, CrewAI, Strands Agents, Vercel AI SDK, and MCP.
How it works
Every action flows through a layered pipeline — the strictest outcome wins:
- Prompt-injection filter — 5 layers: exact → homoglyph → fuzzy → structural → entropy
- Confidence gate — caller-supplied token log-probs¹ — low confidence → deny or downgrade
- Policy evaluator — YAML roles + OPA/Rego, deny-first, wildcard patterns
- Risk model —
criticality × (1 − confidence) × reliability × anomaly_factor - Human-review queue — uncertain decisions pause for approval (Slack / Teams / PagerDuty)
- Behavioral analytics — shadow-agent detection, reputation scoring, baseline drift alerts
¹ The engine checks that the signal is well-formed for the named provider; it cannot check that the numbers came from a real provider response. Treat it as an input to a stricter decision, not as evidence. A provider with no log-probs (e.g. Anthropic Claude) is rejected, and MissingSignalMode decides instead.
Also in the box: stable agent identity with RS256 workload JWTs and MCP OAuth 2.1 · an experimental AES-256-GCM OAuth token vault (providers are off until you configure VAULT_<NAME>_CLIENT_ID; set VAULT_KEY) · an experimental NHI inventory with six heuristic checks over the engine's own data (/v1/nhi/inventory).
Stack: Go engine · Next.js dashboard · SQLite for the engine (single process; Redis optional for the review queue) · Postgres for the dashboard and control-plane API only
Examples
- quickstart — the real engine on SQLite: one request per outcome, live prompt-injection catch
- langchain — gate a plain LangChain
StructuredToolbefore execution - crewai — gate CrewAI tool calls; a prompt-injected refund agent gets stopped
- strands — register as a Strands intervention handler; denials, safe-tool redirects and human approval all use Strands' own actions
- bedrock — gate Amazon Bedrock agents on the model's reported confidence (offline demo with a mock response)
- agentgateway — Lelu as the decision brain behind agentgateway (ext-authz PEP)
SDKs: TypeScript · Python · Go · MCP server
Self-hosting: npx -y lelu-mcp start runs the real engine with no build step, or build it yourself from source — go build ./cmd/engine or docker build -f engine/Dockerfile . — full options in examples/quickstart.
FAQ
Is it really free?
Yes — the engine, SDKs, MCP server, and dashboard are MIT licensed. Self-host everything with npx -y lelu-mcp start, or build the engine yourself from source. The hosted sandbox at lelu-ai.com is just a convenience.
Can't the agent just lie about its confidence?
Yes, today. By default the engine rejects a bare self-reported number, but it accepts a confidence_signal object, and it cannot tell whether that object came from a real provider response. Closing this properly needs the signal to come from something the agent does not control, such as an LLM gateway that sees the provider reply. Until then, confidence can only be used to tighten a decision, and a caller who wants to loosen it can.
Does this replace OPA / Casbin / my IAM?
No — it sits on top. Lelu evaluates OPA/Rego and YAML policies as one step of its pipeline, then adds what those tools can't see: prompt-injection detection, confidence gating, behavioral anomaly scoring, and a human-review queue.
What happens when a decision is human_review?
The agent pauses, a reviewer gets pinged (Slack / Teams / PagerDuty), and the action resumes or dies with their verdict. Every decision — including the human's — lands in the audit log.
Contributing
Contributions of every size are welcome — from a typo fix to a new framework integration. Most wanted right now: 🔌 framework integrations (OpenAI Agents SDK, LlamaIndex, AutoGen), 📜 Rego policy templates (SOC 2, HIPAA, GDPR), and 📚 examples.
Pick up a good first issue, grab a help wanted task, or start a thread in Discussions. Setup and guidelines → CONTRIBUTING.md
If Lelu is useful to you, a ⭐ star helps more people find it — and tells us to keep going.
MIT © Lelu