EU AI Act compliance attestations for AI agents
Project description
lexprotocol
EU AI Act compliance attestations for AI agents. One line of code.
Enforcement date: August 2, 2026.
pip install lexprotocol
Quick start
from lexprotocol import attest
# Before or after a regulated action, get a compliance attestation
result = attest("credit_decision", "My lending AI system")
print(result.citation)
# → "LexProtocol Attestation LEX-ATT-20260715-a1b2c3 | credit_decision | EU | Inhouselegal.co"
print(result.risk_tier) # → "high_risk"
print(result.compliant) # → True
print(result.applicable_articles) # → ["Article 6", "Article 9", "Annex III"]
Classify risk tier
from lexprotocol import classify
tier = classify("My hiring recommendation system", use_case="employment_screening")
print(tier.risk_tier) # → "high_risk"
print(tier.basis) # → "Employment decisions fall under Annex III..."
For AI agent frameworks
LangChain
from lexprotocol import attest
from langchain.agents import tool
@tool
def make_credit_decision(applicant_data: str) -> str:
"""Make a credit decision with EU AI Act compliance."""
decision = your_model.predict(applicant_data)
attestation = attest("credit_decision", "LangChain credit scoring agent")
return f"{decision}\n\n{attestation.citation}"
CrewAI
from lexprotocol import attest
class ComplianceAgent(Agent):
def execute_task(self, task):
result = super().execute_task(task)
if task.requires_compliance:
att = attest(task.action_type, self.role)
result.metadata["attestation"] = att.citation
return result
AutoGen
from lexprotocol import attest
def compliant_action(action_type, system_desc, action_fn, *args, **kwargs):
"""Wrapper that attests any agent action."""
attestation = attest(action_type, system_desc)
result = action_fn(*args, **kwargs)
return {"result": result, "attestation": attestation.citation}
EU AI Act risk tiers
| Tier | Examples | Requirements |
|---|---|---|
prohibited |
Real-time biometric surveillance, social scoring | Cannot be deployed |
high_risk |
Credit decisions, hiring, medical devices | Conformity assessment, audit trail required |
limited_risk |
Chatbots, deepfakes | Transparency obligations |
minimal_risk |
Spam filters, AI games | No specific obligations |
Configuration
import os
os.environ["LEXPROTOCOL_API"] = "https://lexprotocol.fly.dev" # default
# Or use the client directly
from lexprotocol import LexProtocolClient
client = LexProtocolClient(api_base="https://lexprotocol.fly.dev")
result = client.attest("credit_decision", "My system")
Zero dependencies
lexprotocol uses Python's built-in urllib by default. Optionally install requests or httpx for better performance:
pip install lexprotocol[requests]
pip install lexprotocol[httpx]
Links
- Homepage: https://thelexprotocol.com
- API docs: https://lexprotocol.fly.dev/docs
- MCP server: https://smithery.ai/servers/chase-wl9l/lexprotocol-mcp
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lexprotocol-1.0.0.tar.gz
(5.6 kB
view details)
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 lexprotocol-1.0.0.tar.gz.
File metadata
- Download URL: lexprotocol-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50753ea23ddf6b1d90023f737651bb1b1d54c300f0be7ad52915c1d4209a96e2
|
|
| MD5 |
98bd50fdec3e4f77cb614cac1521e5b5
|
|
| BLAKE2b-256 |
3b8972d240eed170924e287d5875dade70e281f3995eb5612c0cdf30879585ce
|
File details
Details for the file lexprotocol-1.0.0-py3-none-any.whl.
File metadata
- Download URL: lexprotocol-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d830b84709276217e0ef69bd25ddbc9bb5dbfbde33f10915389562c8bc902caa
|
|
| MD5 |
29d0e43a4cefac11b84968bb170e3060
|
|
| BLAKE2b-256 |
45977f03839c5fd224b90126e6908d7376dd1b5b2526da820069669a085e8d8a
|