Skip to main content

Python SDK for ComplyEdge Compliance API — runtime EU AI Act enforcement for AI agents

Project description

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

ComplyEdge runs as an MCP (Model Context Protocol) server, giving any MCP-compatible agent (Claude, Cursor, etc.) compliance checking with zero integration code.

pip install complyedge[mcp]

Add to your MCP client config (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "complyedge": {
      "command": "python",
      "args": ["-m", "complyedge.mcp_server"]
    }
  }
}

Exposed tools:

Tool Description
check_compliance Check text against regulation rules. Returns violations or PASS.
list_rules List available rules, filterable by jurisdiction.
scan_prompt Pre-generation compliance check on prompts.

The MCP server uses the same engine as the REST API — deterministic OPA/Rego on the hot path.

Documentation

See the ComplyEdge Documentation for complete guides.

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

complyedge-0.2.1.tar.gz (21.1 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.1-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: complyedge-0.2.1.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for complyedge-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d07b7282eca546bf9d0dc792d6666b6c44b19f4822cf807006abfda10b9a02dc
MD5 3c18a88b728951211d4ab411477a9c84
BLAKE2b-256 5cb9c35c558bc4dba50202af80b5f1a29282170c21dea5cfeb26c86a40526edf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: complyedge-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for complyedge-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 522b4d8df209b6752a6c07712e4604549efd67a627089d128cb4bd5ccc9e75ba
MD5 f61d1b94ace06298c98b3cbd0b2fb20b
BLAKE2b-256 d6d0b244ac61b42bbe7e4931af8bc2410b8804d42e67e116dfd8c8eb09f2663f

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