Skip to main content

Lelu · Python SDK

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

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-ai.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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lelu_agent_auth_sdk-0.4.0.tar.gz (42.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lelu_agent_auth_sdk-0.4.0-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

Details for the file lelu_agent_auth_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: lelu_agent_auth_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 42.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lelu_agent_auth_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 53b2a024cc6037b5176c88fa43163ca9547c88ba2e7e7785ed9a11e959a8f255
MD5 45dc3374ee1c45077c7b4c241db4279e
BLAKE2b-256 017d02e3e43a92015c9cc003ae883c9b884e1d5bbd7b2c62b574ed4483559373

See more details on using hashes here.

File details

Details for the file lelu_agent_auth_sdk-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lelu_agent_auth_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3866200ca784fef5465107a0bf0cd66cdaacdb666ddf95301aa922038cca38b4
MD5 8ad1d9d13b6a7804926045bef3d379f9
BLAKE2b-256 1c8d8c28cdfcad8cf016619be2eec20145e7da2c03c4f2728246342810fd38c7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.41

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.67

2 files

0.3.66

2 files

0.3.65

2 files

0.3.64

2 files

0.3.63

2 files

0.3.62

2 files

0.3.61

2 files

0.3.6

2 files

0.3.5

2 files

0.3.0

2 files

0.2.0

2 files

0.1.9

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page