A comprehensive command-line tool for automated compliance assessments of AI systems according to the EU AI Act, General Data Protection Regulation (GDPR), and guidelines from the Federal Office for Information Security (BSI).
The Compliance Tool implements a multi-agent system with three specialized agents:
- Legal-Analyst: Evaluates high-risk classification, provider and deployer obligations according to the EU AI Act
- Privacy-Agent: Analyzes data protection compliance, legal bases, and processing obligations according to GDPR
- BSI-Security-Agent: Verifies technical security measures and IT baseline protection requirements
The system supports Human-in-the-Loop (HITL) interventions for clarification requests and maintains a persistent memory of learned facts.
- Python 3.12 or higher
- uv (Python package manager)
- OpenAI-compatible API or local LLM (e.g., Ollama with Gemma model)
- At least 8 GB RAM for vector search and PDF processing
- SQLite3 (included by default in Python)
cd comptool
uv syncuv run python main.py db init
uv run python main.py db seedThis creates the SQLite database with the required tables for applications, assessments, and logging.
Place the following PDF documents in data/docs/:
- EU AI Act PDF
- GDPR/DSGVO PDF
- BSI Guidelines PDF
Then load them into the vector search database:
uv run python main.py pdf loadCopy .env.example to .env and configure your API settings:
cp .env.example .envEdit .env with your settings:
OPENAI_MODEL=gemma4:e2b
OPENAI_BASE_URL=http://localhost:11434/v1
OPENAI_API_KEY=
OPENAI_EMBEDDING_MODEL=nomic-embed-text-v2-moe:latest
VECTOR_DB_PATH=tmp/lancedb
The CLI provides comprehensive control over all system functions:
uv run python main.py <command> [options]| Command | Description |
|---|---|
status |
Show system status |
db init |
Initialize database |
db seed |
Seed default data |
db info |
Show database information |
db reset |
Reset database |
pdf load |
Load PDF documents |
pdf status |
Check PDF status |
pdf list |
List available PDFs |
pdf search "query" |
Search knowledge base |
app list |
List applications |
app create -n "name" -d "description" |
Create application |
app show <id> |
Show application details |
app delete <id> |
Delete application |
app update <id> |
Update application |
assess list |
List assessments |
assess create <app_id> |
Create assessment |
assess show <id> |
Show assessment details |
assess export <id> --format md |
Export assessment |
agent test |
Test agent system |
agent query "query" |
Query agents |
config show |
Show configuration |
config check |
Check configuration |
log list |
List log entries |
log export |
Export logs |
export report <id> |
Export compliance report |
health |
Run health checks |
clean |
Clean temporary files |
reset |
Reset system |
-
Initialize the database:
uv run python main.py db init uv run python main.py db seed
-
Load PDF documents (optional):
uv run python main.py pdf load
-
Create an application:
uv run python main.py app create \ -n "AI Chatbot for Customer Support" \ -d "AI-powered chatbot for handling customer inquiries" \ --department "IT" \ --user-role "Provider" \ --data-sources "Kundendaten"
-
Create compliance assessment:
uv run python main.py assess create <app_id>
-
List assessments:
uv run python main.py assess list
-
Export assessment report:
uv run python main.py assess export <assessment_id> --format md
uv run python main.py app create \
-n "AI Employee Screening Tool" \
-d "Automated CV screening system for HR department" \
--department "HR" \
--user-role "Provider" \
--data-sources "Mitarbeiterdaten"uv run python main.py app create \
-n "AI Marketing Content Generator" \
-d "Automated content generation for social media campaigns" \
--department "Marketing" \
--user-role "Provider" \
--data-sources "Verhaltensdaten" \
--status "review"uv run python main.py app create \
-n "AI Medical Image Analysis" \
-d "Assistive system for radiologist image interpretation" \
--department "Forschung" \
--user-role "Provider" \
--data-sources "Gesundheitsdaten" \
--status "draft"uv run python main.py app create \
-n "AI Credit Scoring System" \
-d "Automated creditworthiness evaluation" \
--department "Legal" \
--user-role "Deployer" \
--data-sources "Finanzdaten" \
--status "review"-
Create Application
uv run python main.py app create \ -n "AI Hiring Platform" \ -d "Automated candidate selection and interview scheduling" \ --department "HR" \ --user-role "Provider" \ --data-sources "Mitarbeiterdaten" \ --status "draft"
-
Create Assessment
uv run python main.py assess create 1
-
List Assessments
uv run python main.py assess list
-
View Assessment Details
uv run python main.py assess show 1
-
Export Report
uv run python main.py assess export 1 --format md -
Export Logs for Audit
uv run python main.py log export --app-id 1 --format md
| Variable | Default | Description |
|---|---|---|
OPENAI_MODEL |
gemma4:latest |
LLM model name |
OPENAI_EMBEDDING_MODEL |
bge-m3:latest |
Embedding model name |
OPENAI_BASE_URL |
http://localhost:11434/v1 |
API endpoint URL |
OPENAI_API_KEY |
ollama |
API key (empty for local) |
VECTOR_DB_PATH |
tmp/lancedb |
Vector database path |
KNOWLEDGE_TABLE |
compliance_docs |
Knowledge table name |
MEMORY_DB_FILE |
tmp/memory.db |
Memory database file |
The system has been tested with:
- Local: Ollama with
gemma4:e2b(Gemma 4 9B) - Cloud: OpenAI GPT-4o
Other compatible models should work but may require prompt adjustments.
A compliance assessment is divided into three sections:
- Risk classification (high-risk categorization)
- Applicability of specific articles
- Provider obligations
- Deployer obligations
- Specific requirements for the use case context
- Legal bases for data processing
- Data protection principles (lawfulness, processing, storage limitation)
- Data subject rights (access, deletion, objection)
- Need for Data Protection Impact Assessment (DPIA)
- Data security and encryption requirements
- Encryption requirements (at rest and in transit)
- Access controls and authentication
- Network security and segmentation
- Patch and update management
- Incident response planning
The system uses Agno's UserControlFlowTools for dynamic user input. When the agent needs additional information, it pauses execution and requests user input through structured fields.
- Agent identifies missing information during assessment
- Agent calls
get_user_inputtool with structured field definitions - System pauses and displays fields to user
- User provides input for each field
- System continues assessment with user input
- Agent may request additional input in multiple rounds if needed
The agent may request information about:
- Application details (purpose, functionality, context)
- Data processing (types of data, volume, sensitivity)
- Regulatory scope (GDPR, BSI, specific industry regulations)
- Technical architecture (if relevant to security assessment)
intervention list- List all pending HITL interventionsintervention answer <id> <answer>- Answer a specific intervention
# Create assessment (will pause for user input if needed)
python main.py assess create 1
# List pending interventions
python main.py intervention list
# Answer an intervention
python main.py intervention answer int_20260415120000000 "Application is a web-based HR tool for employee management."| Column | Type | Description |
|---|---|---|
| id | INTEGER (PK) | Unique application ID |
| name | TEXT | Short name |
| description | TEXT | Detailed description |
| department | TEXT | Department or context |
| data_sources | JSON | List of data sources |
| user_role | TEXT | Role (Provider/Deployer) |
| status | TEXT | draft/review/completed |
| created_at | TIMESTAMP | Creation timestamp |
| updated_at | TIMESTAMP | Last update timestamp |
| Column | Type | Description |
|---|---|---|
| id | INTEGER (PK) | Assessment ID |
| application_id | INTEGER (FK) | Reference to application |
| report_text | TEXT | Structured Markdown report |
| report_json | JSON | Structured data |
| risk_level | TEXT | high/medium/low |
| provider_obligations | JSON | List of obligations |
| deployer_obligations | JSON | List of obligations |
| created_at | TIMESTAMP | Creation timestamp |
| Column | Type | Description |
|---|---|---|
| id | INTEGER (PK) | Log ID |
| run_id | TEXT | Unique run ID |
| application_id | INTEGER (FK) | Application reference |
| entry_type | TEXT | thought/action/result |
| message | TEXT | Log message |
| created_at | TIMESTAMP | Timestamp |
Run the test suite with pytest:
uv run pytest tests/
uv run pytest tests/test_mammalian_xray_compliance.py -vSee tests/README.md for details.
- Vector search is limited to PDF documents that must be manually provided
- Assessment results depend on the LLM's knowledge and provided documents
- HITL interventions require user interaction and may be time-intensive
- The system is not designed for productive legal advice - results should be validated by legal professionals
- Regularly test with sample applications
- Update PDF documents with the latest guidelines
- Regularly backup the SQLite database
- Log all assessments for audit purposes
- Use results as a foundation, not a substitute for qualified legal advice
See LICENSE file.
Note: This tool does not generate legally binding advice. For specific legal questions, consult a qualified attorney.