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

Metadata

Release files for lelu-agent-auth-sdk 0.3.63

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lelu-agent-auth-sdk 0.3.63
File Size Uploaded Provenance Actions
lelu_agent_auth_sdk-0.3.63.tar.gz 30.2 kB Without provenance Details for lelu_agent_auth_sdk-0.3.63.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lelu-agent-auth-sdk 0.3.63
File Interpreter ABI Platform Actions
lelu_agent_auth_sdk-0.3.63-py3-none-any.whl Python 3 none any Details for lelu_agent_auth_sdk-0.3.63-py3-none-any.whl

Total release size: 58.1 kB

Release files / lelu_agent_auth_sdk-0.3.63.tar.gz

Download URL lelu_agent_auth_sdk-0.3.63.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
43c2c2350d6f4c4d048f6b5bd2a83a16d85fe389ba25c76201b54781b5e7c576
BLAKE2b-256 checksum
How to use checksums
0d311695db520b5b9b352e5968a229e2be95873d2355d9530bbbb75f68c48418
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / lelu_agent_auth_sdk-0.3.63-py3-none-any.whl

Download URL lelu_agent_auth_sdk-0.3.63-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac35ced84b42bdc7a335772c350f723ad57bd925f52f32ac25d65b8b35ab3df6
BLAKE2b-256 checksum
How to use checksums
6fba3d83b932fcaed8382ac97c7ada979c5f1d47fa7ef3f70e428c9ba55c5495
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for lelu-agent-auth-sdk 0.3.63

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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