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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lilith_zero-0.2.2.tar.gz.
File metadata
- Download URL: lilith_zero-0.2.2.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
940e3fb3717875995f961d0fa1834331c77633bda97ce0dfa5680e724bb462a7
|
|
| MD5 |
ba806daa106903578afa68aad21ab23b
|
|
| BLAKE2b-256 |
e02fcdf67dc863ac6ebc75a36e424b76a5ed098615ac835791d59a4949897079
|
Provenance
The following attestation bundles were made for lilith_zero-0.2.2.tar.gz:
Publisher:
release.yml on BadC-mpany/lilith-zero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lilith_zero-0.2.2.tar.gz -
Subject digest:
940e3fb3717875995f961d0fa1834331c77633bda97ce0dfa5680e724bb462a7 - Sigstore transparency entry: 1389415957
- Sigstore integration time:
-
Permalink:
BadC-mpany/lilith-zero@9873567e99bdef51907de498bad7bcfdf09f4489 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/BadC-mpany
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9873567e99bdef51907de498bad7bcfdf09f4489 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lilith_zero-0.2.2-py3-none-any.whl.
File metadata
- Download URL: lilith_zero-0.2.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7c4994e3de036c4e8a32e0269210255087d44d1d2c60720030f90730b3ef654
|
|
| MD5 |
35b39befaec25dfa7d396213c8baef0f
|
|
| BLAKE2b-256 |
1d089bdae3c6de1e0767dfae5a3301d783f174357c44079bf638b0f10ac195a6
|
Provenance
The following attestation bundles were made for lilith_zero-0.2.2-py3-none-any.whl:
Publisher:
release.yml on BadC-mpany/lilith-zero
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lilith_zero-0.2.2-py3-none-any.whl -
Subject digest:
f7c4994e3de036c4e8a32e0269210255087d44d1d2c60720030f90730b3ef654 - Sigstore transparency entry: 1389416024
- Sigstore integration time:
-
Permalink:
BadC-mpany/lilith-zero@9873567e99bdef51907de498bad7bcfdf09f4489 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/BadC-mpany
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9873567e99bdef51907de498bad7bcfdf09f4489 -
Trigger Event:
push
-
Statement type: