Installation
Install an official Lelu SDK, configure environment variables, and initialize the client in your app.
On this page
1Choose Installation Method
Lelu can be installed in two ways: using Docker (recommended for quick start) or by installing SDKs directly.
One-Command Setup
Install SDK and automatically start all services with Docker. Includes engine, platform, UI, and database. Perfect for getting started quickly.
npm install lelu-agent-auth npx lelu-agent-auth init
Alternative Installation Methods
Manual Docker Setup
Pull and run Docker images manually. For users who prefer more control over the setup process.
# Clone and run all services locally git clone https://github.com/lelu-auth/lelu.git cd lelu docker-compose up -d
SDK Only
Install the lightweight SDK with CLI tools for audit logs and policy management. Uses local SQLite storage by default (like Prisma).
# TypeScript/JavaScript npm install lelu-agent-auth npx lelu audit-log # Python pip install lelu-agent-auth-sdk lelu audit-log
New to Lelu? We recommend starting with the one-command setup for the quickest start.
The SDK includes CLI tools for audit logs and policy management with local SQLite storage. For a visual UI, use Docker or visit lelu-ai.com.
2Install the Package
Let's start by adding Lelu to your project:
npm install lelu-agent-auth
If your frontend and backend are in separate repositories, install the Lelu SDK in each service that calls the Lelu Engine.
3CLI Commands
After installing, you can use the built-in CLI commands to view audit logs, manage policies, and launch the visual UI directly from your terminal:
Visual UI (Docker)
Launch the visual dashboard for managing policies and viewing audit logs. The UI runs as a separate Docker container (like Prisma Studio).
# Visit the hosted version # https://lelu-ai.com/ # Or run locally with Docker docker-compose up -d
TypeScript/Node.js
# View audit logs npx @lelu-auth/lelu audit-log # Manage policies npx @lelu-auth/lelu policies list npx @lelu-auth/lelu policies get auth npx @lelu-auth/lelu policies set auth ./auth.rego
Python
# After installing: pip install lelu-agent-auth-sdk lelu audit-log lelu policies list lelu policies get auth lelu policies set auth ./auth.rego
Go
# Build and run CLI cd sdk/go/cmd/lelu go build -o lelu ./lelu audit-log ./lelu policies list
Note: CLI commands use local SQLite storage by default (~/.lelu/lelu.db).
To use a remote platform, set LELU_PLATFORM_URL environment variable.
4Generate API Key & Set Environment Variables
First, generate an API key to authenticate with the Lelu engine. Then create a .env file with your configuration.
1Generate API Key
API keys authenticate your requests and identify your tenant. Choose one of the following methods:
Method 1: PowerShell Script (Recommended for Self-Hosted)
# Generate and store API key automatically ./generate-api-key.ps1 # Your key will be: # - Generated with secure random bytes # - Stored in Redis # - Added to your .env file automatically
2API Key
Your Lelu API key for authenticating requests to the engine. Generate a secure key using openssl rand -base64 32.
LELU_API_KEY=your_secure_api_key_here
.env to your .gitignore file.5Configure Lelu Client
Initialize the Lelu client in your application to start authorizing agent actions:
import { LeluClient } from "@lelu-auth/lelu";
export const lelu = new LeluClient({
baseUrl: process.env.LELU_ENGINE_URL!,
apiKey: process.env.LELU_API_KEY!,
});
// Example: Authorize an agent action
const decision = await lelu.agentAuthorize({
actor: "support_agent",
action: "issue_refund",
context: { confidence: 0.85 }
});
if (decision.requiresHumanReview) {
console.log("Action queued for human approval");
} else if (decision.allowed) {
console.log("Action approved autonomously");
}For Python applications:
from lelu import LeluClient
import os
lelu = LeluClient(
base_url=os.environ["LELU_ENGINE_URL"],
api_key=os.environ["LELU_API_KEY"]
)
# Example: Authorize an agent action
decision = lelu.agent_authorize(
actor="support_agent",
action="issue_refund",
confidence=0.85
)
if decision.requires_human_review:
print("Action queued for human approval")
elif decision.allowed:
print("Action approved autonomously")✓That's it!
You're all set! Lelu is now configured and ready to use. Check out the following resources to learn more:
