Skip to main content

Lilith Python SDK

The official Python client for the Lilith Security Middleware.

Installation

pip install lilith-zero

Note: This package requires the Lilith binary core. The SDK will attempt to find it automatically or guide you to install it.

Usage

Zero-Config Connection

Lilith automatically discovers the binary on your PATH or in standard locations.

from lilith_zero import Lilith
from lilith_zero.exceptions import PolicyViolationError

client = Lilith(
    upstream="python my_tool_server.py", # The command to run your tools
    policy="policy.yaml"                 # Security rules
)

async with client:
    try:
        tools = await client.list_tools()
        result = await client.call_tool("read_file", {"path": "secret.txt"})
    except PolicyViolationError as e:
        print(f"Security Alert: {e}")

Manual Binary Path

If you need to point to a specific build (e.g. during development):

client = Lilith(
    upstream="...",
    binary="/path/to/custom/Lilith" 
)

Exceptions

  • PolicyViolationError: Raised when the Policy Engine determines a request is unsafe (Static Rule, Taint Check, or Resource Access).
  • LilithConnectionError: Raised if the middleware process cannot start or crashes.
  • LilithConfigError: Raised if the binary is missing or arguments are invalid.

License

Apache-2.0

Metadata

Release files for lilith-zero 0.2.2

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

Source distribution (sdist)

Source distribution for lilith-zero 0.2.2
File Size Uploaded
lilith_zero-0.2.2.tar.gz 18.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lilith-zero 0.2.2
File Interpreter ABI Platform
lilith_zero-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 35.1 kB

Release files / lilith_zero-0.2.2.tar.gz

Download URL lilith_zero-0.2.2.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
940e3fb3717875995f961d0fa1834331c77633bda97ce0dfa5680e724bb462a7
BLAKE2b-256 checksum
How to use checksums
e02fcdf67dc863ac6ebc75a36e424b76a5ed098615ac835791d59a4949897079
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

Release files / lilith_zero-0.2.2-py3-none-any.whl

Download URL lilith_zero-0.2.2-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7c4994e3de036c4e8a32e0269210255087d44d1d2c60720030f90730b3ef654
BLAKE2b-256 checksum
How to use checksums
1d089bdae3c6de1e0767dfae5a3301d783f174357c44079bf638b0f10ac195a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release 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