API Reference

xAI Governance API

Data & AI governance with an AI assistant

xAI Governance exposes governance APIs (AI system inventory, data catalog) plus an AI-powered suite on Workers AI: EU AI Act risk classification, PII detection, ISO 42001 policy drafting. It also ships an MCP server for AI agents to query governed data.

Base URL

https://governance.xai.io.vn

Authentication

Business endpoints require an SSO session (cookie `xv_session`) and the matching RBAC permission (admin/officer/steward/viewer). The MCP server uses an org-scoped Bearer token.

AI Assistant (Workers AI)

POST /api/ai/classify-risk

Classify an AI system risk tier per the EU AI Act

Auth: SSO session · `ai:write` permission

Body parameters

FieldTypeDescription
description* string AI system description
lang 'vi' | 'en' Result language

Example request

curl -X POST 'https://governance.xai.io.vn/api/ai/classify-risk' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: xv_session=<token>' \
  -d '{ "description": "Chấm điểm tín dụng tự động", "lang": "vi" }'

Example response

{
  "tier": "high",
  "reason": "Hệ thống chấm điểm tín dụng ảnh hưởng quyền tiếp cận tài chính.",
  "obligations": [
    "Đánh giá tác động (FRIA)",
    "Giám sát của con người (human oversight)",
    "Ghi log & truy vết quyết định"
  ]
}

Error codes

403Missing `ai:write` permission
POST /api/ai/detect-pii

Detect PII types & suggest data classification

Auth: SSO session · `data:write` permission

Body parameters

FieldTypeDescription
description* string Dataset/system description

Example response

{
  "containsPii": true,
  "piiTypes": ["full_name", "national_id", "phone"],
  "classification": "confidential"
}
POST /api/ai/draft-policy

Draft a policy for an ISO 42001 control

Auth: SSO session · `policy:write` permission

Body parameters

FieldTypeDescription
controlRef* string Control ref, e.g. `A.2.2`
context* string Business context
lang 'vi' | 'en' Language

Example response

{
  "controlRef": "A.2.2",
  "title": "Chính sách AI có trách nhiệm",
  "draft": "Tổ chức cam kết phát triển và vận hành hệ thống AI…"
}

Governance resources

POST /api/ai-systems

Create an AI system record in the inventory

Auth: SSO session · `ai:write` permission

Body parameters

FieldTypeDescription
name* string AI system name
purpose* string Intended purpose
lifecycle_stage string Lifecycle stage

Example response

{ "ok": true, "id": "ais_5c9e" }

MCP server (for AI agents)

POST /mcp

Streamable HTTP MCP — read-only tools, org-scoped

Auth: Org-scoped Bearer token

Example request

{
  "mcpServers": {
    "xai-governance": {
      "url": "https://governance.xai.io.vn/mcp",
      "headers": { "Authorization": "Bearer <org_token>" }
    }
  }
}

Example response

// Các tool MCP khả dụng:
// • list_knowledge_sources  → nguồn tri thức đã duyệt cho RAG
// • search_governed_data    → tìm dataset + thuật ngữ
// • list_ai_systems         → inventory hệ thống AI + tier rủi ro
// • get_glossary            → định nghĩa thuật ngữ nghiệp vụ
// • get_compliance_status   → tổng quan tuân thủ