概要
Open source authorization engine for AI agents. Confidence-aware gating · Human-in-the-loop review · Policy-as-code · Full audit trail
セキュリティ・プライバシー計測したスター増加
- 24時間
- +2
- 7日間
- +7
- 15日間
- +13
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナル
Lelu
Authorization engine for AI agents.
Every action checked. Every decision logged. Humans in the loop when it matters.
Live Sandbox · One-Command Start · Examples · MCP Server · Contributing · Governance · Security Roadmap · Discussions
https://github.com/user-attachments/assets/f9dfae5e-48b6-4731-a457-dabf8464ad86
What is Lelu?
Lelu is an open-source authorization engine that sits between your AI agent and the real world. Before the agent acts (issuing a refund, sending an email, deleting a record) it asks Lelu, and gets one of four decisions:
- ✅
allow: the action runs - ⛔
deny: blocked, with a reason - 🙋
human_review: the agent pauses until a person approves - 🧪
compute: redirected to a safer alternative or sandbox
It's one HTTP call from any language or framework, every decision is written to a signed, hash-chained audit log, and the engine runs on your own machine or infrastructure.
Lelu sits next to your policy engine, not in place of it. OPA, Cedar and your identity provider decide who may do what; Lelu adds a human-approval step bound to the exact call that was reviewed, the audit record, and advisory signals (a prompt-injection screen, confidence gating, anomaly scoring) that can only make a decision stricter.
What Lelu does not do
Read this before you depend on Lelu. Each limit has a tracking issue.
- It advises; it does not enforce on its own. Something on the agent's side must obey the decision.
lelu-mcp proxy, the coding-agent hooks 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. Set
LELU_REVIEWER_KEYSso only a reviewer can approve, and keep the admin key away from the agent. Without it, the agent that triggered a review can approve it. - Actor names are self-asserted unless the caller presents a workload token (
X-Lelu-Agent-Token). - YAML roles and deny lists match action names, not arguments. Put argument checks in a rule's
when:condition (CEL, see config/argument-conditions.yaml) or in Rego. - The injection screen is a speed bump: a short list of English phrases, easy to evade.
- Audit events can be dropped under load unless you set
LELU_AUDIT_BLOCK_ON_FULL=true. - Single process. The engine keeps state in SQLite and memory; don't run more than one replica.
- Set
JWT_SIGNING_KEYandVAULT_KEYto random values. The defaults are public.
More: security roadmap · threat model · OWASP agentic Top 10 · EU AI Act · 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 with the coding-agent preset (edits, tests and local git allowed; installs, pushes, deploys and secrets go to review; destructive actions denied):
claude mcp add lelu -- npx -y lelu-mcp start --transport stdio --preset coding-agent
To enforce on another MCP server rather than offer a tool, put the proxy in front of it: npx -y lelu-mcp proxy -- <server command>. Cursor, Claude Desktop and proxy setup → sdk/mcp
Quickstart (SDK)
npm install lelu-agent-auth # TypeScript, or: pip install lelu-agent-auth-sdk
import { lelu } from "lelu-agent-auth";
// Finds the engine `npx lelu-mcp start` runs on this machine.
// 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); // pauses until a person approves
} else if (decision.decision === "compute") {
await saferAlternative(decision.safeTool, decision.safeArgs);
} else {
throw new Error(decision.reason); // denied
}
Works with OpenAI, Anthropic, LangChain, LangGraph, CrewAI, Strands Agents, Vercel AI SDK and MCP.
How it works
Every action goes through a layered pipeline, and the strictest outcome wins:
- Prompt-injection screen: exact, homoglyph, fuzzy, structural and entropy checks
- Confidence gate: a caller-supplied signal that can only tighten a decision
- Policy: YAML roles and rules, OPA/Rego, CEL
when:conditions on arguments - Risk model:
criticality × (1 − confidence) × reliability × anomaly_factor - Session taint: after a sensitive read, egress in the same session goes to review
- Human review: approvals bound to the exact call, standing grants, multi-reviewer quorum (docs/APPROVALS.md)
The audit log can be verified, replayed against a new policy, exported as evidence, or streamed to a SIEM: audit receipts · policy replay · evidence · SIEM export.
Stack: Go engine · Next.js dashboard · SQLite for the engine · Postgres for the dashboard
Examples
quickstart · langchain · crewai · strands · bedrock · agentgateway
SDKs: TypeScript · Python · Go · MCP server · Claude Code and Codex hooks
Self-hosting: npx -y lelu-mcp start, or build from source with go build ./cmd/engine or docker build -f engine/Dockerfile .. Options are in examples/quickstart.
FAQ
Is it really free?
Yes. The engine, SDKs, MCP server, plugins and dashboard are MIT licensed, and you can self-host all of it. lelu-ai.com also offers a hosted version; its paid plans pay for hosting, call volume and support, never for security features (GOVERNANCE.md).
Can't the agent just lie about its confidence?
Yes, today. The engine can check that a confidence signal is well-formed, not that it came from a real provider response. So confidence can only tighten a decision, never loosen it.
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. Reviewers can also approve for a while rather than once, and a rule can require more than one reviewer (docs/APPROVALS.md).
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.
Contributors
Thanks to everyone who has helped build Lelu. Code, docs, examples, design and security reports all count (emoji key). Had a pull request merged and you're not here? Open an issue or mention it in your next PR.
MIT © Lelu
関連プロジェクトを探す
読み込み中…