Everything on the main branch at the tag pre-sprint-baseline (commits from Sep 4 to Oct 1, 2026) is preexisting. This is the full RingGuard payment-fraud system, originally built for the Razorpay Buildathon:
- synthetic data generator
- heterogeneous graph builder
- ring detection
- risk engine
- evaluation
- FastAPI backend
- React dashboard
- attack simulator
- documentation
Everything on the branch swarm-hackathon after the pre-sprint-baseline tag is new work.
To see exactly what was added, compare the two:
https://github.com/jiya2401/RingGuard/compare/pre-sprint-baseline...swarm-hackathon
| Date | New work |
|---|---|
| Nov 6 | (to be filled in) |
| Nov 7 | (to be filled in) |
| Nov 8 | (to be filled in) |
Razorpay Buildathon · Track 2 portfolio project
Risk is not always visible in a transaction. Sometimes it is visible in the network around it.
RingGuard builds a heterogeneous payment graph, discovers coordinated account clusters, scores their structural/temporal/behavioral/money-flow evidence, subtracts legitimate-sharing evidence, and gives an investigator one grounded view of risk history, graph relationships, blast radius, counterfactuals, and recommended actions.
All data and monetary values are synthetic/simulated. RingGuard does not use or imply access to real Razorpay data.
- Deterministic synthetic ecosystem with eight abuse archetypes and five classes of hard negatives.
- Causal heterogeneous NetworkX graph and deterministic Louvain ring discovery.
- Multi-layer interpretable risk plus explicit WHY FLAGGED / WHY NOT FRAUD.
- Observation-window-preserving risk history and emerging-ring detection.
- Leakage-free train/validation/test splits; Logistic Regression and Random Forest flat vs graph-enhanced comparisons.
- Precision, recall, F1, ROC-AUC, PR-AUC, FPR, precision@K, ring recall, emerging latency, hard-negative FPR, holdout, and adversarial evaluation.
- Risk propagation, two-hop blast radius, Ring DNA, and real evidence-removal counterfactual recomputation.
- Fourteen typed investigation tools and a deterministic grounded copilot that requires no external AI key.
- FastAPI endpoints for overview, queues, rings, graph, timeline, evidence, history, blast radius, counterfactuals, simulation, actions, and copilot.
- React + TypeScript + Vite + Tailwind dashboard with an interactive Cytoscape graph, filters, charts, evidence views, simulator, notes, and error states.
- Deterministic attack simulation through the production graph/risk pipeline.
- SQLite persistence for monitor, investigate, escalate, dismiss, mark legitimate, confirm abuse, and investigator notes.
| Model | Precision | Recall | F1 | ROC-AUC | PR-AUC | FPR |
|---|---|---|---|---|---|---|
| Flat Logistic Regression | 0.1824 | 1.0000 | 0.3085 | 0.8236 | 0.1651 | 0.2811 |
| Graph Logistic Regression | 0.8407 | 1.0000 | 0.9134 | 0.9957 | 0.9040 | 0.0119 |
The complete generated report is in
docs/evaluation_results.json. The high graph
AUC is a synthetic benchmark result, not a production claim. Under combined
infrastructure dilution and timing smear, recall falls to 0.4575; see
docs/evaluation.md and
docs/limitations.md.
Prerequisites: Python 3.14, Node 22, and Corepack/pnpm.
git clone https://github.com/<your-username>/RingGuard.git
cd RingGuard
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
cd frontend
corepack enable
pnpm install
cd ..Generate deterministic demo data and evaluation results:
python scripts\generate_demo.py --seed 42 --out data\ecosystem.json
python scripts\run_evaluation.py --seed 42 --out docs\evaluation_results.jsonRun the backend (terminal 1):
python -m uvicorn backend.api.app:app --host 127.0.0.1 --port 8000 --reloadRun the frontend (terminal 2, from the repo root):
cd frontend
pnpm run dev Open http://localhost:5173. API health is
http://127.0.0.1:8000/health; OpenAPI is
http://127.0.0.1:8000/docs.
With the virtual environment activated:
# Backend
python -m pytest
python -m compileall -q backend config scripts
python scripts\e2e_smoke.py --demo
# Frontend
cd frontend
pnpm run lint
pnpm run typecheck
pnpm run test
pnpm run buildGenerated data/, .venv/, node_modules/, caches, SQLite databases, and
frontend dist/ are gitignored.
Synthetic events -> heterogeneous graph -> coordination projection
-> ring discovery -> interpretable risk - legitimate-sharing deduction
-> history / evidence / propagation / counterfactuals
-> typed tools -> deterministic copilot -> FastAPI -> React/Cytoscape UI
See docs/architecture.md for module and causality
details. RINGGUARD_PROGRESS.md is the handoff ledger for every milestone.
No deployment or external account access is performed automatically. The repo
contains separate backend/frontend Dockerfiles plus compose.yaml:
docker compose up --buildThen open http://localhost:8080. Full instructions and production caveats are
in docs/deployment.md.
docs/demo_script.md— five-minute judge flowdocs/judge_review.md— hostile self-review and fixesdocs/evaluation.md— protocol and real resultsdocs/limitations.md— remaining constraintsIMPLEMENTATION_PLAN.md— M1-M24 acceptance plan
RingGuard is a portfolio prototype for explainable investigation workflows, not a production fraud decision system.