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.2.tar.gz (14.5 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.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lilith_zero-0.1.2.tar.gz
  • Upload date:
  • Size: 14.5 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.2.tar.gz
Algorithm Hash digest
SHA256 02c48d6be3f7451e0a1a0b9d3c61ca22a928dc91872307a1ee339dfdd3b58b98
MD5 68befe6bbd1e805d4f3af999934acea5
BLAKE2b-256 17b111651debdb429e8ac15f67b01abe5fc3deca137e963cd7248e45d0bc90bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lilith_zero-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 23bf472d5c103003089be9c13cfb9dadea95cc9aaf95b37bac98f16c71be436c
MD5 9bdf87ff5d1d8f4e3d863ce5955e3f0d
BLAKE2b-256 a4e49b7580c231901f996880548eaf536eea95d0d4e4d22c8c2b95122e15a920

See more details on using hashes here.

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