Skip to main content

ComplyEdge Python SDK

Runtime compliance engine for EU AI Act. Open source. Deterministic.

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)  # every input and output checked

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.

Value Corpus
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

# Development setup
pip install complyedge[dev]

# Local development from source
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"]

# Boolean check
if not is_safe(text, api_key=api_key, jurisdiction="EU"):
    raise ValueError("Compliance violation")

# Full result
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.

ComplyEdge runs as an MCP (Model Context Protocol) stdio server for any MCP-compatible host (Claude, Cursor, Inspector).

pip install 'complyedge[mcp]>=0.2.8'

Start with either entrypoint:

python -m complyedge.mcp_server
# or
complyedge-mcp

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):

Tool Description
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

Download files

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

Source Distribution

complyedge-0.2.8.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

complyedge-0.2.8-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file complyedge-0.2.8.tar.gz.

File metadata

  • Download URL: complyedge-0.2.8.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for complyedge-0.2.8.tar.gz
Algorithm Hash digest
SHA256 5b0e8f56340ab260465454ea7f73c525dd193612b137659f99c223b70fc1ab18
MD5 6d67535d04282e2b7109f96aae542cd9
BLAKE2b-256 2980a5bbf0a813a1871c77104c00ba14b5f71ec3fd9f589bfa135995573281be

See more details on using hashes here.

File details

Details for the file complyedge-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: complyedge-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.10

File hashes

Hashes for complyedge-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 44e4b9f26d3e7ae7269b1a50286b7dfc2d01c3e895474184e7b878d0b3619b98
MD5 3d9179cad969c830390fc23d7edbcb1a
BLAKE2b-256 8510338c8c94c9383dffda6c80b6969e13a7a52e8309963f6f6787d0052ac30e

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