Architecture
Clean pipeline. No microservices.
Clipeus is intentionally monolithic: one Next.js app, one scan route, one rules directory.
- 01
Frontend
Next.js App Router pages — marketing, playground, docs — calling the same API agents use.
- 02
REST API
POST /api/scan validates with Zod, then hands content to the scanner.
- 03
Scanner Engine
Normalizes text, runs Unicode inspection, orchestrates rule matching and scoring.
- 04
Rule Engine
Loads every JSON file from /rules at runtime. Patterns compile to RegExp.
- 05
Scoring Engine
Dedupes overlapping findings, sums weights, applies action multiplier, emits verdict.
- 06
JSON Response
Risk score, verdict, categories, flagged segments, explanation, confidence, timing.
Rules as data
Adding a category means adding a JSON file. The loader reads the directory — scanner code stays untouched.
Explainability first
Every match returns the exact substring and a reason string derived from the rule definition.
