Skip to main content

Shift-left compliance for AI – local, private, no cloud.

Project description

ComplAInce ⚖️

Local, private, no-cloud AI compliance auditing.

ComplAInce is a CLI tool and Streamlit report viewer that helps you detect bias in your models and classify your AI system under the EU AI Act (2024/1689) – entirely on your own machine, no data leaves your environment.


⚡ Quick start

pip install complyai
complyai scan \
  --path data.csv \
  --protected-col gender \
  --label-col hired \
  --pred-col model_prediction \
  --use-case employment
Scanning data.csv ...

EU AI Act Risk Level: 🟠 HIGH
  High-risk – Employment & worker management (recruitment, promotion, termination)
  Reference: Annex III §4

Top 3 Bias Metrics:
  - 2SD Rule: -5.5932
  - Disparate Impact: 0.5997
  - Four Fifths Rule: 0.5997

Rows analysed: 500
Protected attribute groups: 0 vs 1

Report saved to: ./audit_report_2026-04-22_13-28-15.json

Then open the report in the interactive viewer:

complyai-ui
# → http://localhost:8501

🔧 Installation

Requirements: Python 3.11+

pip install complyai

For development:

git clone https://github.com/patrikredo/complyai
cd complyai
pip install -e ".[dev]"

🚀 CLI reference

complyai scan

complyai scan --path <CSV> [options]

Arguments:
  --path           Path to the dataset CSV file                  (required)
  --protected-col  Column for the protected attribute            (default: gender)
  --label-col      Column for the ground-truth label             (default: hired)
  --pred-col       Column for the model prediction               (default: model_prediction)
  --use-case       EU AI Act use-case category                   (default: other)
  --simulate       Use dummy data – no CSV needed, for testing

complyai-ui

Launches the Streamlit report viewer at http://localhost:8501. Upload any audit_report_*.json to explore results interactively.


🗂️ Use-case categories

--use-case Risk level Typical applications
biometric PROHIBITED Real-time biometric surveillance
social_scoring PROHIBITED Social scoring by public authorities
law_enforcement HIGH Predictive policing, evidence assessment
employment HIGH Recruitment, promotion, termination
credit HIGH Credit scoring, insurance pricing
education HIGH Admission, assessment, monitoring
healthcare HIGH Clinical decision support
critical_infrastructure HIGH Energy, water, transport safety
migration HIGH Asylum, border control
chatbot LIMITED Virtual agents, customer service bots
recommendation LIMITED Content personalisation
other MINIMAL Low-risk general-purpose AI

📊 Bias metrics (via holisticai)

Metric Reference Interpretation
Statistical Parity 0 Difference in positive prediction rates
Disparate Impact 1 Ratio of positive rates (< 0.8 = bias)
Four Fifths Rule 1 Regulatory 80% rule (EEOC)
Cohen D 0 Standardised effect size
Equality of Opportunity Difference 0 Difference in true positive rates
False Positive Rate Difference 0 Difference in false positive rates
Average Odds Difference 0 Average of TPR + FPR differences
Accuracy Difference 0 Difference in accuracy between groups

📁 Report format

Reports are saved as audit_report_<timestamp>.json:

{
  "metadata": {
    "timestamp": "2026-04-22T13:28:15",
    "scanned_file": "data.csv",
    "tool_version": "complyai 0.2.0",
    "python_environment": { "version": "3.11.x", "os": "Darwin" },
    "simulated": false
  },
  "eu_ai_act": {
    "use_case": "employment",
    "risk_level": "HIGH",
    "article": "Annex III §4",
    "classification": "High-risk – Employment & worker management",
    "obligations": ["Conformity assessment required before deployment.", "..."]
  },
  "bias_analysis": {
    "protected_column": "gender",
    "label_column": "hired",
    "prediction_column": "model_prediction",
    "rows_analysed": 500,
    "group_a": "0",
    "group_b": "1",
    "metrics": {
      "Statistical Parity": -0.2515,
      "Disparate Impact": 0.5997
    }
  }
}

🏗️ Project structure

complyai/
├── cli.py            # complyai scan entry point
├── eu_act.py         # Rule-based EU AI Act Annex III classifier
└── streamlit_app.py  # complyai-ui report viewer

📜 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

complyai-0.2.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

complyai-0.2.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file complyai-0.2.0.tar.gz.

File metadata

  • Download URL: complyai-0.2.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for complyai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 72cb192af45e63e8ef897e9e7058c4e1534828ded2f86f8cad005a5724223936
MD5 16aed952e8744a3040ee7ac0e36d240f
BLAKE2b-256 7c19148a4c27d3000ec5588d0b6c30814b250f9a10a94cb9cb1918b5bdc9dcea

See more details on using hashes here.

File details

Details for the file complyai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: complyai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.1

File hashes

Hashes for complyai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e856cadbaaa858eb64d80d5c4d55eba9b6294f4913ec7b1aa76a8f429379e63
MD5 ccb6ecdf124199b094ccbc1546d6db77
BLAKE2b-256 730361d1959407b4cffe0ee14449efa1b2972e1bb9417075827d9bb00fdb3204

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