# watt-tang/clawguard architecture

> Architecture diagram of the GitHub repository watt-tang/clawguard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/watt-tang/clawguard
- Repository: https://github.com/watt-tang/clawguard

## Overview

ClawGuard is a full-stack security-governance platform. Users navigate its React console to review product security, exposure, vulnerability intelligence, research, and Skill governance; the web API serves these views and supports refreshes, scans, and account workflows. Skill assessment branches into static scanners and ProvLoom dynamic analysis, while risk and research services aggregate external intelligence. The README documents the major capabilities and API surface; sampled source confirms selected authentication, research persistence, and analysis behavior, but not every route or service-to-scanner call.

Main entry points: [`web/server/index.mjs`](https://github.com/watt-tang/clawguard/blob/main/web/server/index.mjs) (Express API), [`web/src/App.jsx`](https://github.com/watt-tang/clawguard/blob/main/web/src/App.jsx) (React application), [`web/server/services/skillStaticScanApiService.mjs`](https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillStaticScanApiService.mjs) (Static scan API), [`web/server/services/openclawRiskService.mjs`](https://github.com/watt-tang/clawguard/blob/main/web/server/services/openclawRiskService.mjs) (OpenClaw risk)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web console"]
  node_app["React application<br/>[App.jsx]"]
  node_exposure_ui["Exposure views"]
  node_risk_ui["Risk views"]
  node_research_ui["Research views"]
  node_skill_ui["Skill governance"]
  node_auth_ui["Auth session<br/>[useAuth.js]"]
end

subgraph group_api["API and intelligence"]
  node_api_server["Express API<br/>[index.mjs]"]
  node_auth_service["Account workflows<br/>[authService.mjs]"]
  node_exposure_service["Exposure monitoring"]
  node_risk_service["OpenClaw risk"]
  node_research_service["Research aggregation"]
  node_skill_intel["Skill intelligence"]
  node_skill_search["Skill search"]
  node_static_scan_api["Static scan API"]
  node_dynamic_service["Sandbox service"]
end

subgraph group_assessment["Skill assessment"]
  node_scanner2["Static scanner<br/>[scanner.py]"]
  node_scanner7["Static skill scanner"]
  node_scanner5["Agent scanner"]
end

subgraph group_dynamic["Dynamic analysis"]
  node_provloom["Dynamic analysis"]
  node_risk_analyzer["Evidence risk analysis<br/>[decision_engine.py]"]
end

subgraph group_external["Data and providers"]
  node_mysql[("MySQL database")]
  node_threat_sources(("Advisory sources"))
  node_research_sources(("Research sources"))
  node_llm_provider(("LLM provider"))
end

node_user(("Platform user"))

node_user -->|"navigates"| node_app
node_app -->|"selects view"| node_exposure_ui
node_app -->|"selects view"| node_risk_ui
node_app -->|"selects view"| node_research_ui
node_app -->|"selects view"| node_skill_ui
node_app -->|"uses session"| node_auth_ui
node_exposure_ui -->|"requests data"| node_api_server
node_risk_ui -->|"requests data"| node_api_server
node_research_ui -->|"requests data"| node_api_server
node_skill_ui -->|"requests data"| node_api_server
node_auth_ui -->|"auth requests"| node_api_server
node_api_server -->|"dispatches auth"| node_auth_service
node_api_server -->|"dispatches exposure"| node_exposure_service
node_api_server -->|"dispatches risk"| node_risk_service
node_api_server -->|"dispatches research"| node_research_service
node_api_server -->|"dispatches intelligence"| node_skill_intel
node_api_server -->|"dispatches search"| node_skill_search
node_api_server -->|"dispatches scans"| node_static_scan_api
node_api_server -->|"dispatches sandbox"| node_dynamic_service
node_auth_service -->|"reads and writes"| node_mysql
node_exposure_service -->|"reads data"| node_mysql
node_risk_service -->|"stores intelligence"| node_mysql
node_risk_service -->|"aggregates advisories"| node_threat_sources
node_research_service -->|"fetches papers"| node_research_sources
node_research_service -->|"persists snapshots"| node_mysql
node_skill_intel -->|"reads intelligence"| node_mysql
node_skill_search -->|"searches records"| node_mysql
node_static_scan_api -->|"runs static scan"| node_scanner2
node_static_scan_api -->|"runs static scan"| node_scanner7
node_static_scan_api -.->|"orchestrates scanner"| node_scanner5
node_dynamic_service -->|"runs assessment"| node_provloom
node_provloom -->|"scores evidence"| node_risk_analyzer
node_provloom -.->|"requests analysis"| node_llm_provider

click node_app "https://github.com/watt-tang/clawguard/blob/main/web/src/App.jsx"
click node_exposure_ui "https://github.com/watt-tang/clawguard/blob/main/web/src/features/openclaw-exposure/pages/OpenclawExposurePage.jsx"
click node_risk_ui "https://github.com/watt-tang/clawguard/blob/main/web/src/features/openclaw-risk/pages/OpenclawRiskPage.jsx"
click node_research_ui "https://github.com/watt-tang/clawguard/blob/main/web/src/features/security-research/pages/SecurityResearchPage.jsx"
click node_skill_ui "https://github.com/watt-tang/clawguard/blob/main/web/src/features/skill-governance/pages/SkillGovernancePage.jsx"
click node_auth_ui "https://github.com/watt-tang/clawguard/blob/main/web/src/hooks/useAuth.js"
click node_api_server "https://github.com/watt-tang/clawguard/blob/main/web/server/index.mjs"
click node_auth_service "https://github.com/watt-tang/clawguard/blob/main/web/server/services/authService.mjs"
click node_exposure_service "https://github.com/watt-tang/clawguard/blob/main/web/server/services/exposureService.mjs"
click node_risk_service "https://github.com/watt-tang/clawguard/blob/main/web/server/services/openclawRiskService.mjs"
click node_research_service "https://github.com/watt-tang/clawguard/blob/main/web/server/services/securityResearchService.mjs"
click node_skill_intel "https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillIntelligenceService.mjs"
click node_skill_search "https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillSearchService.mjs"
click node_static_scan_api "https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillStaticScanApiService.mjs"
click node_dynamic_service "https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillDynamicSandboxService.mjs"
click node_scanner2 "https://github.com/watt-tang/clawguard/blob/main/scanners/scanner2/core/scanner.py"
click node_scanner7 "https://github.com/watt-tang/clawguard/tree/main/scanners/scanner7/static_skill_scanner"
click node_scanner5 "https://github.com/watt-tang/clawguard/tree/main/scanners/scanner5"
click node_provloom "https://github.com/watt-tang/clawguard/tree/main/provloom/app"
click node_risk_analyzer "https://github.com/watt-tang/clawguard/blob/main/provloom/app/analyzer/decision_engine.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_exposure_ui,node_risk_ui,node_research_ui,node_skill_ui,node_auth_ui,node_user toneBlue
class node_api_server,node_auth_service,node_exposure_service,node_risk_service,node_research_service,node_skill_intel,node_skill_search,node_static_scan_api,node_dynamic_service toneAmber
class node_scanner2,node_scanner7,node_scanner5 toneMint
class node_provloom,node_risk_analyzer toneRose
class node_mysql,node_threat_sources,node_research_sources,node_llm_provider toneIndigo
```

## Components

### Web console

- [React application](https://github.com/watt-tang/clawguard/blob/main/web/src/App.jsx): `web/src/App.jsx`
- [Exposure views](https://github.com/watt-tang/clawguard/blob/main/web/src/features/openclaw-exposure/pages/OpenclawExposurePage.jsx): `web/src/features/openclaw-exposure/pages/OpenclawExposurePage.jsx`
- [Risk views](https://github.com/watt-tang/clawguard/blob/main/web/src/features/openclaw-risk/pages/OpenclawRiskPage.jsx): `web/src/features/openclaw-risk/pages/OpenclawRiskPage.jsx`
- [Research views](https://github.com/watt-tang/clawguard/blob/main/web/src/features/security-research/pages/SecurityResearchPage.jsx): `web/src/features/security-research/pages/SecurityResearchPage.jsx`
- [Skill governance](https://github.com/watt-tang/clawguard/blob/main/web/src/features/skill-governance/pages/SkillGovernancePage.jsx): `web/src/features/skill-governance/pages/SkillGovernancePage.jsx`
- [Auth session](https://github.com/watt-tang/clawguard/blob/main/web/src/hooks/useAuth.js): `web/src/hooks/useAuth.js`

### API and intelligence

- [Express API](https://github.com/watt-tang/clawguard/blob/main/web/server/index.mjs): `web/server/index.mjs`
- [Account workflows](https://github.com/watt-tang/clawguard/blob/main/web/server/services/authService.mjs): `web/server/services/authService.mjs`
- [Exposure monitoring](https://github.com/watt-tang/clawguard/blob/main/web/server/services/exposureService.mjs): `web/server/services/exposureService.mjs`
- [OpenClaw risk](https://github.com/watt-tang/clawguard/blob/main/web/server/services/openclawRiskService.mjs): `web/server/services/openclawRiskService.mjs`
- [Research aggregation](https://github.com/watt-tang/clawguard/blob/main/web/server/services/securityResearchService.mjs): `web/server/services/securityResearchService.mjs`
- [Skill intelligence](https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillIntelligenceService.mjs): `web/server/services/skillIntelligenceService.mjs`
- [Skill search](https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillSearchService.mjs): `web/server/services/skillSearchService.mjs`
- [Static scan API](https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillStaticScanApiService.mjs): `web/server/services/skillStaticScanApiService.mjs`
- [Sandbox service](https://github.com/watt-tang/clawguard/blob/main/web/server/services/skillDynamicSandboxService.mjs): `web/server/services/skillDynamicSandboxService.mjs`

### Skill assessment

- [Static scanner](https://github.com/watt-tang/clawguard/blob/main/scanners/scanner2/core/scanner.py): `scanners/scanner2/core/scanner.py`
- [Static skill scanner](https://github.com/watt-tang/clawguard/tree/main/scanners/scanner7/static_skill_scanner): `scanners/scanner7/static_skill_scanner`
- [Agent scanner](https://github.com/watt-tang/clawguard/tree/main/scanners/scanner5): `scanners/scanner5`

### Dynamic analysis

- [Dynamic analysis](https://github.com/watt-tang/clawguard/tree/main/provloom/app): `provloom/app`
- [Evidence risk analysis](https://github.com/watt-tang/clawguard/blob/main/provloom/app/analyzer/decision_engine.py): `provloom/app/analyzer/decision_engine.py`

### Data and providers

- **MySQL database**
- **Advisory sources**
- **Research sources**
- **LLM provider**

### Other components

- **Platform user**

## Connections

- Platform user → React application: navigates
- React application → Exposure views: selects view
- React application → Risk views: selects view
- React application → Research views: selects view
- React application → Skill governance: selects view
- React application → Auth session: uses session
- Exposure views → Express API: requests data
- Risk views → Express API: requests data
- Research views → Express API: requests data
- Skill governance → Express API: requests data
- Auth session → Express API: auth requests
- Express API → Account workflows: dispatches auth
- Express API → Exposure monitoring: dispatches exposure
- Express API → OpenClaw risk: dispatches risk
- Express API → Research aggregation: dispatches research
- Express API → Skill intelligence: dispatches intelligence
- Express API → Skill search: dispatches search
- Express API → Static scan API: dispatches scans
- Express API → Sandbox service: dispatches sandbox
- Account workflows → MySQL database: reads and writes
- Exposure monitoring → MySQL database: reads data
- OpenClaw risk → MySQL database: stores intelligence
- OpenClaw risk → Advisory sources: aggregates advisories
- Research aggregation → Research sources: fetches papers
- Research aggregation → MySQL database: persists snapshots
- Skill intelligence → MySQL database: reads intelligence
- Skill search → MySQL database: searches records
- Static scan API → Static scanner: runs static scan
- Static scan API → Static skill scanner: runs static scan
- Static scan API → Agent scanner: orchestrates scanner
- Sandbox service → Dynamic analysis: runs assessment
- Dynamic analysis → Evidence risk analysis: scores evidence
- Dynamic analysis → LLM provider: requests analysis
