> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meshai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Compliance API

> Readiness score, FRIA, transparency cards, and incident reporting endpoints

## Readiness Score

```
GET /compliance/readiness
```

Get the EU AI Act readiness score for your tenant.

```bash theme={null}
curl https://api.meshai.dev/api/v1/compliance/readiness \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "total_score": 85,
      "max_score": 120,
      "rating": "good",
      "components": [
        { "name": "agent_registry", "score": 20, "max_score": 20, "status": "complete" },
        { "name": "risk_classification", "score": 15, "max_score": 20, "status": "partial" },
        { "name": "governance_policies", "score": 15, "max_score": 15, "status": "complete" },
        { "name": "human_oversight", "score": 15, "max_score": 20, "status": "partial" },
        { "name": "audit_trail", "score": 15, "max_score": 15, "status": "complete" },
        { "name": "fria_completion", "score": 5, "max_score": 20, "status": "partial" },
        { "name": "incident_readiness", "score": 0, "max_score": 10, "status": "missing" }
      ],
      "recommendations": [
        "Classify the remaining 2 agents with a risk level",
        "Complete FRIA for agents: hr-screener, loan-evaluator"
      ],
      "assessed_at": "2026-03-17T10:00:00Z"
    }
  }
  ```
</ResponseExample>

## FRIA (Fundamental Rights Impact Assessment)

### Get FRIA

```
GET /agents/{agent_id}/fria
```

```bash theme={null}
curl https://api.meshai.dev/api/v1/agents/agt_abc123/fria \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "fria_abc123",
      "agent_id": "agt_abc123",
      "version": 1,
      "status": "submitted",
      "processes": "The AI agent reviews job applications...",
      "frequency_and_scope": "Used daily by 5 HR managers...",
      "categories_of_persons": "Job applicants...",
      "specific_risks": "Risk of discriminatory bias...",
      "human_oversight_measures": "All AI-ranked lists reviewed by human...",
      "risk_mitigation_measures": "If bias detected: suspend agent...",
      "created_at": "2026-03-17T10:00:00Z",
      "created_by": "user@company.com"
    }
  }
  ```
</ResponseExample>

### Create FRIA

```
POST /agents/{agent_id}/fria
```

All six fields are required. See [FRIA](/governance/fria) for field descriptions.

```bash theme={null}
curl -X POST https://api.meshai.dev/api/v1/agents/agt_abc123/fria \
  -H "Authorization: Bearer msh_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "processes": "The AI agent reviews job applications and ranks candidates...",
    "frequency_and_scope": "Used daily by 5 HR managers. ~500 applications/month.",
    "categories_of_persons": "Job applicants, EU residents of all ages.",
    "specific_risks": "Risk of discriminatory bias in candidate ranking.",
    "human_oversight_measures": "All AI-ranked lists reviewed by human HR manager.",
    "risk_mitigation_measures": "If bias detected: suspend agent, notify applicants."
  }'
```

### Submit FRIA

```
POST /fria/{fria_id}/submit
```

Finalizes the FRIA and logs it in the audit trail.

```bash theme={null}
curl -X POST https://api.meshai.dev/api/v1/fria/42/submit \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

## Transparency Card

```
GET /agents/{agent_id}/transparency-card
```

Get the auto-generated transparency card for an agent.

```bash theme={null}
curl https://api.meshai.dev/api/v1/agents/agt_abc123/transparency-card \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "agent_id": "agt_abc123",
      "agent_name": "production-summarizer",
      "purpose": "Summarizes customer support tickets",
      "framework": "crewai",
      "model_provider": "openai",
      "model_name": "gpt-4o",
      "risk_level": "limited",
      "capabilities": ["Text summarization", "Ticket categorization"],
      "limitations": ["May miss context in multi-language tickets"],
      "human_oversight": "Output reviewed by support team leads",
      "data_sources": "Customer support ticket text (no PII stored)",
      "generated_at": "2026-03-17T10:00:00Z"
    }
  }
  ```
</ResponseExample>

## Incidents

### Create Incident

```
POST /incidents
```

```bash theme={null}
curl -X POST https://api.meshai.dev/api/v1/incidents \
  -H "Authorization: Bearer msh_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agt_abc123",
    "title": "Discriminatory output in hiring agent",
    "severity": "high",
    "description": "The HR screening agent systematically ranked female candidates lower...",
    "impact": "Approximately 120 applicants affected.",
    "immediate_actions": "Agent suspended immediately.",
    "root_cause": "Training data contained historical hiring bias.",
    "affected_persons_count": 120,
    "involves_health_or_death": false
  }'
```

### Get Incident

```
GET /incidents/{incident_id}
```

```bash theme={null}
curl https://api.meshai.dev/api/v1/incidents/inc_abc123 \
  -H "Authorization: Bearer msh_YOUR_API_KEY"
```

### Update Incident

```
PATCH /incidents/{incident_id}
```

```bash theme={null}
curl -X PATCH https://api.meshai.dev/api/v1/incidents/inc_abc123 \
  -H "Authorization: Bearer msh_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "mitigated",
    "update_note": "All affected applications manually re-reviewed."
  }'
```

### Authority Notification

There is no separate notify-authority endpoint. Record that a competent authority has been notified by updating the incident: `PATCH /incidents/{incident_id}` with body field `authority_notified: true`. See [Incident Reporting](/governance/incidents#update-an-incident) for the full workflow and deadlines.
