Python SDK for Lelu — framework-agnostic authorization engine for AI agents with confidence-aware controls, Docker deployment, and human-in-the-loop workflows (Beta)
Project description
Lelu · Python SDK
⚠️ Beta Version 0.3.61b0 - This is a beta release. Features and APIs may change.
Python client for Lelu — the confidence-aware authorization engine for autonomous AI agents.
Author: Abenezer Getachew
Maintainer: Abenezer Getachew
Installation
pip install lelu-agent-auth-sdk
Or run the public Lelu engine image:
docker pull abenezer0923/lelu-engine:latest
docker run --rm -p 8083:8080 abenezer0923/lelu-engine:latest
Quick start
Option 1: Use Hosted Engine (Recommended)
Connect to the hosted Lelu engine for instant setup:
import asyncio
from lelu import LeluClient, AgentAuthRequest, AgentContext
async def main():
async with LeluClient(base_url="https://lelu-engine.onrender.com") as client:
result = await client.agent_authorize(AgentAuthRequest(
actor="invoice_bot",
action="invoice:create",
context=AgentContext(
confidence=0.92,
acting_for="user_123",
),
))
print(result.allowed, result.reason)
asyncio.run(main())
Option 2: Run Locally
For development, you can run the engine locally:
import asyncio
from lelu import LeluClient, AgentAuthRequest, AgentContext
async def main():
async with LeluClient(base_url="http://localhost:8082") as client:
result = await client.agent_authorize(AgentAuthRequest(
actor="invoice_bot",
action="invoice:create",
context=AgentContext(
confidence=0.92,
acting_for="user_123",
),
))
print(result.allowed, result.reason)
asyncio.run(main())
Start the local engine with Docker:
docker compose up -d
API
| Method | Description |
|---|---|
agent_authorize(req) |
Confidence-aware agent authorization |
authorize(req) |
Human RBAC authorization |
mint_token(req) |
Mint a JIT-scoped JWT |
revoke_token(token_id) |
Revoke a token immediately |
is_healthy() |
Health-check the engine |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lelu_agent_auth_sdk-0.3.61b0.tar.gz.
File metadata
- Download URL: lelu_agent_auth_sdk-0.3.61b0.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eebc57cff84f0b8249646eb044d27ff7219435c0441b353c8094b2ce24af51f
|
|
| MD5 |
a320c75a7afee074d9b811d65bdfbda1
|
|
| BLAKE2b-256 |
5a7d69cc1bb3e8251906189b195bcec289fa26ef544144e542c6dbd7e3bc7da8
|
File details
Details for the file lelu_agent_auth_sdk-0.3.61b0-py3-none-any.whl.
File metadata
- Download URL: lelu_agent_auth_sdk-0.3.61b0-py3-none-any.whl
- Upload date:
- Size: 29.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fd717c2d6e822bb865e58d5a68078f01e4fc15bae95323da479ad4801e32994
|
|
| MD5 |
fc2513ef8cbc51eae38442433dad30b7
|
|
| BLAKE2b-256 |
05b7e73a24b248ac09cee12ad36d5f37030aff5d104f3d52b380db40ea555781
|