Skip to content

Quickstart

You need Docker with Compose v2. Nothing else.

  1. Clone and configure:

    Terminal window
    git clone https://github.com/OneLab-X/ai-gov.git && cd ai-gov
    cp .env.example .env
  2. Start everything:

    Terminal window
    docker compose up --build

    This starts PostgreSQL, Redis, OPA, object storage, the API, a Celery worker, the scheduler and the web console. On first boot the API runs migrations, seeds jurisdictions, policies and four example AI systems, and loads the policies into OPA.

  3. Open the console at http://localhost:3000 and sign in. All demo accounts use the password ChangeMe123!:

    Email Role Can do
    admin@aigov.example.com admin everything, including policies and users
    risk@aigov.example.com risk_officer inventory, classification, checks, evidence
    viewer@aigov.example.com viewer read-only
What Where
Web console http://localhost:3000
API docs (Swagger / ReDoc) http://localhost:8000/docs, http://localhost:8000/redoc
Readiness probe http://localhost:8000/ready
OPA http://localhost:8181

Every /api/v1 response is wrapped as {"success": true, "data": ...}, so the payload is under .data.

Terminal window
API=localhost:8000/api/v1
TOKEN=$(curl -s $API/auth/login -H 'content-type: application/json' \
-d '{"email":"admin@aigov.example.com","password":"ChangeMe123!"}' | jq -r .data.access_token)
AUTH="authorization: Bearer $TOKEN"
# 1. Register a system
SYSTEM=$(curl -s -X POST $API/systems -H "$AUTH" -H 'content-type: application/json' -d '{
"name": "Loan Decisioning Engine",
"description": "Approves or declines consumer loan applications",
"status": "active",
"system_metadata": {
"purpose": "Decide consumer loan applications",
"use_case": "credit_scoring",
"industry": "fintech",
"autonomy_level": "human_on_the_loop",
"data_categories": ["personal_data", "financial"],
"deployment_regions": ["EU"],
"data_subject_regions": ["EU", "IN"],
"offered_in_regions": ["EU", "IN"],
"service_accessible_regions": ["GLOBAL"],
"makes_automated_decisions": true
}
}' | jq -r .data.id)
# 2. Detect jurisdictions and classify risk (writes immutable classification rows)
curl -s -X POST $API/systems/$SYSTEM/classify -H "$AUTH" \
-H 'content-type: application/json' -d '{}' | jq '.data.most_restrictive_tier'
# 3. Evaluate policies through OPA
curl -s -X POST $API/systems/$SYSTEM/check-policies -H "$AUTH" \
-H 'content-type: application/json' -d '{}' | jq '.data.summary'
# 4. Generate an evidence package (202 Accepted, then poll)
PKG=$(curl -s -X POST $API/systems/$SYSTEM/evidence -H "$AUTH" \
-H 'content-type: application/json' -d '{"include_history": true}' | jq -r .data.package_id)
sleep 3
curl -s $API/systems/$SYSTEM/evidence/$PKG -H "$AUTH" | jq '.data.status'