DClaw RiskGovernance · v1.0
AI-native enterprise risk management

Enterprise risk you can
actually quantify.

Identify risks with a domain-aware Copilot. Score them qualitatively or run a FAIR Monte Carlo simulation. Map controls, track KRIs, model scenarios. All in one open-source stack.

70 API endpoints · 13 pages · 28 tests passing · MIT licence

12 / 12
PRD features
70
API endpoints
28 / 28
Tests passing
10k+
FAIR iterations
Try it live

Seed the demo, click around, wipe it clean.

One click populates every page — risks, controls, a quantitative assessment, KRIs, incidents, a scenario, vendors, an emerging-risk signal, a survey, and two indexed documents for the Copilot.

Current dataset
View it

Heads up: Clear deletes everything in the domain tables — not just the seeded rows. Use it on a demo database only.

Everything the PRD asks for.

13 features across P0 foundation, P1 platform, and P2 vertical layers. Each one ships with an AI angle, a working backend, and a frontend page.

P0.1

AI Risk Copilot

A domain-aware chat assistant that knows every risk in your register. Ask it to identify new risks from a project brief, classify a draft risk into severity / probability, or explain why an exposure number changed.

  • ·Ollama (local) → OpenRouter (cloud) fallback chain
  • ·TF-IDF retrieval over your knowledge base feeds every reply
  • ·Suggested actions extracted from each response
P0.2

Risk Register

Full CRUD register with category filtering, status workflow (identified → assessed → treated → monitored → closed), and a 5×5 heat map that updates as severity and probability change.

  • ·AI-assisted category + severity classification
  • ·Per-risk time-series trend from assessment history
  • ·Owner, velocity, and AI rationale captured per row
P0.3

FAIR Monte Carlo Assessment

Triangular-distribution loss magnitude × uniform-distribution event frequency, simulated thousands of times. Persists P10/P50/P90/mean and a 50-point loss-exceedance curve.

  • ·Deterministic with a seed, suitable for unit testing
  • ·Qualitative scoring also supported, auto-syncs onto the parent risk
  • ·Loss-exceedance curve rendered as inline SVG
P0.4

Control Mapping

Catalogue controls (preventive / detective / corrective / compensating), map them to risks with per-link effectiveness scoring, and run gap analysis to see uncovered risks and unused controls.

  • ·Many-to-many association with per-link effectiveness 1-5
  • ·Framework tagging (NIST 800-53, ISO 27001, SOC 2)
  • ·Two-sided gap analysis endpoint
P1.3

Risk Reporting

Executive-ready aggregates: counts by category and status, top-N risks, mean qualitative score, control coverage %, and total annualised P50/P90 exposure across all quantified risks.

  • ·AI-written 3-paragraph board narrative, grounded only in real numbers
  • ·Per-risk exposure roll-up using the latest quantitative assessment
  • ·Compares qualitative posture to quantitative loss exposure
P1.2

Key Risk Indicators

Track operational metrics that signal risk crossing tolerance. Warn / critical thresholds with above-or-below direction, auto-derived status, and a breaches feed for the dashboard.

  • ·Optional FK to a Risk so breaches surface contextually
  • ·Direction switch handles both 'higher is worse' and 'lower is worse'
  • ·Per-KRI custom units and owner
P1.1

Incident Linkage

Log realised incidents and link them to risks in the register. The Copilot mines the incident log for recurring themes and surfaces them by risk category.

  • ·AI pattern detection across the last 50 incidents
  • ·Severity 1-5 + status workflow
  • ·Patterns categorised by risk family (operational, cyber, supplier...)
P2.4

Scenario Planning

Define what-if multipliers per risk category, then stress-test the entire register in one click. Returns baseline vs. projected scores with a delta % so you can see where exposure concentrates.

  • ·AI scenario generation from a free-text description
  • ·Per-risk projected severity, probability, score
  • ·Stored as JSONB so multipliers are auditable and versionable
P2.3

Third-Party Risk

Vendor catalogue with criticality 1-5 and a 0-100 risk score. Click 'AI score' to get an LLM-generated score plus a rationale tied to the vendor's category and any notes.

  • ·Last-assessed-at tracked per vendor
  • ·Rationale preserved alongside the score
  • ·Heuristic fallback when the LLM is unreachable
P2.1

Emerging Risk Feed

Pluggable feed reader with the NIST NVD CVE 2.0 JSON API wired in by default (CVSS → 1-5 impact mapping). Add a new feed by registering a single async function.

  • ·Cross-feed deduplication on (source, title)
  • ·Synthetic feed for offline / CI environments
  • ·CVE detail links rendered in the UI
P2.2

Risk Culture Surveys

Author surveys with one or more dimensions (Speak-up, Tone-at-top, Accountability). Anonymous respondents submit 0-100 scores. Closing a survey auto-aggregates responses into per-dimension culture scores.

  • ·Opaque respondent hash — no PII stored
  • ·Multi-question, multi-dimension support
  • ·Aggregated scores feed the reporting dashboard
P1.4

Compliance Coverage

Joined view of compliance requirements (ISO 27001:2022, SOC 2 Type II, NIST 800-53 Rev 5) against your local control library. Coverage % per framework, plus a per-requirement gap list.

  • ·Configurable to proxy to a real DClaw Compliance instance
  • ·Mock-mode fixture so the demo always renders
  • ·Push your control library upstream with one API call
Copilot

Knowledge Base + RAG

Upload policies, runbooks, and procedures. The Copilot retrieves the top-3 most relevant passages for every user query using TF-IDF cosine similarity and grounds its answer in your text.

  • ·Dependency-free retriever — no vector DB required
  • ·Search endpoint to preview retrieval before it hits the Copilot
  • ·Swap in a Qdrant-backed retriever without touching call sites
Copilot mandate · §9

Every page has a Copilot that knows your data.

The floating chat in the bottom-right knows every risk, every control, and every document you've uploaded. It retrieves the three most relevant knowledge-base passages for each question using TF-IDF and grounds the LLM response in your text — so answers are specific, not generic.

  • Risk register injected into the system prompt
  • TF-IDF retrieval over your knowledge base on every query
  • Suggested actions extracted from every reply
  • Falls back: Ollama (local) → OpenRouter (cloud) → mock
Copilot transcript
What's our top risk and what should I do?
Your top risk is Cloud provider outage [Operational], severity 5 × probability 4. Three actions:
  • Schedule a workshop with the SRE team this week
  • Invest 20 % of cloud spend in a secondary region
  • Mirror critical apps between providers for faster recovery
via ollama+openrouter+mock
FAIR Monte Carlo — 10,000 iterations
P10
$88k
P50
$320k
P90
$911k
Mean
$419k
$9k$1.7M
Annualised loss-exceedance curve
P0.3 · Risk Assessment

Quantify exposure with FAIR Monte Carlo.

Give us your loss range (min / mode / max) and event frequency band. We sample a triangular loss distribution and a uniform frequency thousands of times, then return percentiles and a full loss-exceedance curve. Deterministic with a seed, so the math is unit testable.

Loss model
Triangular(min, mode, max)
Frequency model
Uniform(min, max) per year
Default iterations
10,000
Output
P10/P50/P90/mean + 50-point curve

Boring, proven stack.

No JavaScript-of-the-week. Everything in production use at scale, chosen so anyone on your team can read and extend it.

Frontend
Next.js 14 App Router · Tailwind · shadcn/ui
Backend
FastAPI · Pydantic v2 · SQLAlchemy 2.0 async
Database
PostgreSQL 16 · Alembic migrations
LLM
Ollama (local) → OpenRouter (cloud) fallback
Auth
Logto JWT (with DEV bypass for development)
Numerics
NumPy for FAIR Monte Carlo simulation

Run it locally in two commands.

Clone the repo, copy .env.example to .env, then docker compose up --build.