Skip to main content

Lilith MCP Middleware SDK

Project description

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

Project details


Download files

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

Source Distribution

lilith_zero-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

lilith_zero-0.1.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file lilith_zero-0.1.1.tar.gz.

File metadata

  • Download URL: lilith_zero-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lilith_zero-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5db0cdd7fd14e2057a9c08e68f8844cdf961c9810e0a010c036ea29b26f32626
MD5 a65f1255daf40c51c2cfbb85bb9bc200
BLAKE2b-256 502a85b10a6a377a336265cf92a793ad97894945a700ace932947d9cab319468

See more details on using hashes here.

Provenance

The following attestation bundles were made for lilith_zero-0.1.1.tar.gz:

Publisher: publish_pypi.yml on BadC-mpany/lilith-zero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lilith_zero-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lilith_zero-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for lilith_zero-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58ea1aeb21ee71d57a42d1b26237c47b1fb851d6822e296a6e919c8dada2b30e
MD5 983242ee36de6b953197e9714c34d411
BLAKE2b-256 c98fe3c56c72cb813d17e3454b8256a1e3b600e24a4b51a66c4a9a04e5de20eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for lilith_zero-0.1.1-py3-none-any.whl:

Publisher: publish_pypi.yml on BadC-mpany/lilith-zero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page