Inspiration
Named after the ancient Chinese barbican (wèngchéng, 瓮城)—a defensive courtyard between an outer gate and an inner citadel—Wèngchéng rethinks AI-powered cybersecurity. Traditional honeypots rely on static files that attackers quickly fingerprint, while modern "AI security" wrappers burn thousands of LLM tokens and add latency classifying every routine /.env or SQLi bot scan.
What it does
Wèngchéng sits as a reverse-proxy deception layer in front of a protected portal (Aegis Cloud), splitting traffic in under 2 milliseconds with zero LLM tokens spent on normal users or known probes:
- PASS (
0 tokens): Legitimate requests go straight to the real portal with zero added latency. - DIVERT (
0 tokens on cache hit): Known attacks (/.env,/wp-admin, SQLi, scraper bursts) are silently routed into synthetic canary endpoints and adaptive slow-drip tarpits that waste attacker time instead of API budget. - WAKE (
1 wakeup on cache miss): Only when an attacker probes a genuinely novel, unmapped endpoint does Wèngchéng wake NVIDIA NIM (poolside/laguna-xs-2.1) once to synthesize a schema-matched JSON decoy, tag it with a canary, and cache it for all future hits. - 403 Portcullis Gate: Operators can engage a live hard-lock portcullis from the SOC console to block hostile sessions immediately.
How we built it
- Deterministic Sentinel (
src/server/sentinel.ts): Pre-compiled regex signatures, path rules, user-agent checks, and fixed-memory sliding windows running synchronously in<2ms. - Deception & Tarpit Engine (
src/server/deception.ts&src/server/llm.ts): Serves cached synthetic canaries, progressive slow-drip delays, and on-demand NVIDIA NIM / OpenRouter decoy synthesis with automatic offline procedural fallback so the system works even with zero API keys. - Real-Time Control Plane (
src/server/realtime.ts&src/client/): WebSocket telemetry stream tracking live requests checked, tokens saved, AI wakeups, and downloadable SOC incident reports. - Interactive Scrollytelling & Explainer (
redesign/&manim/): Custom WebGL wireframe frontend and a 60fps Manim architectural explainer video.
Try it out
- Live Interactive Preview: Open wengcheng.pages.dev to explore the architecture and sandbox interface directly in your browser.
- Full Node + NVIDIA NIM Backend (3 commands locally):
bash npm install && cp .env.example .env && npm run devOpen http://localhost:3000, click Take the guided tour, toggle the 403 gate, and trigger a Novel probe to watch AI wakeups increment once and serve subsequent hits from cache.
Built With
- cloudflare-pages
- express.js
- manim
- node.js
- nvidia-nim
- react
- tailwind
- websockets