ComplyEdge Python SDK
Runtime compliance engine for EU AI Act. Open source. Deterministic.
Choose the Right Package
complyedge is the Python client for the hosted ComplyEdge runtime API. It
enforces policy decisions in your application and records the resulting
evidence trail. For an offline command-line linter with no API key, use
TrustLint instead.
Installation
pip install complyedge
Quick Start — EU AI Act in Three Lines
from complyedge import compliance_check
@compliance_check(jurisdiction="EU", agent_id="my-agent")
def my_agent(prompt):
return llm.generate(prompt)
That's it. Every input and output is checked against the EU AI Act rule corpus (Article 5, Article 50, GPAI). Violations are blocked before they reach the user, with legal citation, rule ID, and timestamp on every check.
The decorator reads your API key from the COMPLYEDGE_API_KEY environment variable by default. Pass api_key_env="MY_VAR" to use a different one.
Multi-Jurisdiction Enforcement
jurisdiction selects which rule corpus is evaluated server-side.
EU | EU AI Act Article 5 + Article 50 + GPAI (Articles 51–55) |
US | HIPAA, SOX, COPPA, TCPA, BIPA |
@compliance_check(jurisdiction="EU", agent_id="hr-screening")
def hr_screening(candidate: str) -> str:
return llm.generate(candidate)
Per-rule scoping (e.g. only Article 5) is planned but not yet exposed in the SDK — all rules for the selected jurisdiction run today.
Additional Installation Options
pip install complyedge[dev]
pip install -e ./sdks/python
Client API — Without the Decorator
from complyedge import ComplyEdge
ce = ComplyEdge(api_key="your-key")
result = ce.check("AI-generated content", jurisdiction="EU")
if result.allowed:
print("Content approved")
else:
for v in result.violations:
print(f"{v.rule_id}: {v.citation}")
Or the global convenience functions:
from complyedge import is_safe, check
import os
api_key = os.environ["COMPLYEDGE_API_KEY"]
if not is_safe(text, api_key=api_key, jurisdiction="EU"):
raise ValueError("Compliance violation")
result = check(text, api_key=api_key, jurisdiction="EU")
MCP Server — Use ComplyEdge as an AI Agent Tool

Agent/MCP tools that check prompts and outputs against ComplyEdge’s TrustLint
corpus with article-cited findings — not another EU AI Act risk-tier chatbot
and not a law-search database.
Hosted Streamable HTTP (preferred for remote / Smithery Toolbox):
https://mcp.complyedge.io/mcp
npx -y @smithery/cli@latest mcp add complyedge/complyedge --client cursor
Local stdio for any MCP-compatible host (Claude, Cursor, Inspector):
pip install 'complyedge[mcp]>=0.2.8'
python -m complyedge.mcp_server
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"complyedge": {
"command": "complyedge-mcp"
}
}
}
(command/args with python -m complyedge.mcp_server is also valid.)
Exposed tools (TrustLint offline YAML corpus):
check_compliance | Check text against TrustLint rules. Returns PASS/FAIL with article-cited findings. |
list_rules | List available TrustLint rules, filterable by jurisdiction. |
scan_prompt | Pre-generation prompt scan. Returns SAFE or RISK_DETECTED. |
No API key is required for these tools. The optional extra installs mcp and
trustlint (engine + bundled rules). This MCP path does not run the REST API
policy engine.
Documentation