Skip to content

AI Governance Metrics

God Mode exposes an AI governance scorecard at /god-mode/ai through /api/god-mode/ai. The goal is to make AI quality, safety, cost, and approval readiness visible to platform operators without relying on static status claims.

Metrics Included

Data Sources

Cost Policy

The scorecard uses reported estimatedUsd when present. If cost is not reported but creditsUsed is present, it applies the internal credit estimate of $0.01 per credit. If neither value exists, cost remains 0 rather than inventing provider pricing.

Safety Policy

Governance health is intentionally conservative. Missing citation coverage, correction requests, hallucination reports, and failed eval suites reduce the score. Critical eval failures are surfaced at suite level so operators can see whether the problem is missing citations, missing review gates, unsafe client language, or incomplete structured fields.

Verification

Run focused tests:

npm run test:run -- ai-governance-metrics ai-evals

Run targeted lint and typecheck when changing the route or UI:

npx eslint src/lib/ai/governance-metrics.ts src/__tests__/lib/ai-governance-metrics.test.ts src/app/api/god-mode/ai/route.ts 'src/app/(dashboard)/god-mode/ai/page.tsx'
npm run typecheck

Next Improvements

Source: docs/dev/ai-governance-metrics.md