Installation

Install an official Lelu SDK, configure environment variables, and initialize the client in your app.

1Choose Installation Method

Lelu can be installed in two ways: using Docker (recommended for quick start) or by installing SDKs directly.

Docker (Recommended)

Get Lelu running in minutes with pre-built Docker images. Includes the engine, platform, UI, and MCP server.

terminal
# Pull and run all services
docker pull leluauth/lelu-engine:latest
curl -O https://raw.githubusercontent.com/lelu-auth/lelu/main/docker-compose.production.yml
docker-compose -f docker-compose.production.yml up -d
Complete stack ready in 2 minutes

SDK Integration

Install Lelu SDKs directly into your application. Requires running the Lelu engine separately.

terminal
# TypeScript/JavaScript
npm install @lelu-auth/lelu

# Python
pip install auth-pe
More configuration required

New to Lelu? We recommend starting with Docker to get familiar with the system.

The Docker setup includes all components and a web UI for monitoring. You can switch to SDK integration later for production deployments.

2Install the Package

Let's start by adding Lelu to your project:

terminal
npm install @lelu-auth/lelu

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 and manage policies directly from your terminal:

TypeScript/Node.js

terminal
# 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

terminal
# 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

terminal
# Build and run CLI
cd sdk/go/cmd/lelu
go build -o lelu
./lelu audit-log
./lelu policies list

Note: CLI commands require the Lelu platform service to be running (not just the engine).

Set LELU_PLATFORM_URL to point to your platform instance (default: http://localhost:9091).

4Set Environment Variables

Create a .env file in the root of your project and add the following environment variables:

1Lelu Engine URL

The URL where your Lelu Engine is running. This should point to your deployed Lelu Engine instance.

.env
LELU_ENGINE_URL=https://your-lelu-engine.example.com

2API Key

Your Lelu API key for authenticating requests to the engine. Generate a secure key using openssl rand -base64 32.

.env
LELU_API_KEY=your_secure_api_key_here
Security notice: Never commit your API keys to version control. Add .env to your .gitignore file.

5Configure Lelu Client

Initialize the Lelu client in your application to start authorizing agent actions:

lib/lelu.ts
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:

lelu_client.py
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: