Kairos Lab · Defense Stack

Built to hold the line

Three open-source defensive layers for Express.js applications. From passive stealth to active retaliation — deploy the layer that fits your threat model.

Layer 01 · Passive
KIP
Kairos Invisible Protocol. Stealth 404s, rate limiting, honeypot traps, timing jitter. Makes your API surface disappear.
Layer 02 · Active
NEMESIS
Active defense system. Correlation engine, tiered alerting, Cloudflare auto-block, escalating tarpits. Attacker enters, never leaves clean.
Layer 03 · Intelligence
MANTIS
Behavioral fingerprinting and anti-LLM-agent detection. 5 signals, Redis-backed scoring, drip-stream tarpit for automated crawlers.
// Layer 01 · Passive · Express middleware
KIP v1
Drop-in Express middleware that makes your attack surface invisible. All 404s look identical regardless of whether a route exists — automated scanners can't distinguish real endpoints from fake ones. Honeypot routes silently fingerprint attackers.
Open Source
Stealth 404
Every non-existent route returns a consistent 404 with timing jitter (30–150ms). Scanners see a flat surface — no fingerprinting by response timing.
Honeypot traps
Register fake "attractive" routes (/.env, /admin, /git/config). Any request to them auto-bans the IP for 30 minutes and logs the attempt.
Rate limiting
Layered limits: login (5 req/15min), sensitive routes (20 req/15min), global (100 req/15min). All configurable. Express-rate-limit backed.
Strike tracking
3 honeypot hits = permanent session ban until restart. Strikes accumulate across routes — a probe sequence gets caught even if each individual request seems innocent.
npm install github:Valisthea/Kairos-Invisible-Protocol GitHub →
// Layer 02 · Active · Express middleware
NEMESIS v3
Active defense system for Express.js. When an attacker triggers a honeypot or crosses a threat threshold, NEMESIS escalates in real time: Discord/Telegram alert → Cloudflare IP block → escalating tarpit delays. Correlation engine links events across time windows so probes spread over hours still get caught.
Open Source
Correlation engine
Links honeypot hits, failed auth attempts, and scan patterns across a 1-hour window. A slow probe that evades rate limits still gets correlated.
Tiered alerting
Discord and Telegram webhooks with severity levels (INFO → WARNING → CRITICAL). Configurable per-event. You know the moment someone enters your honeypot.
Cloudflare auto-block
On CRITICAL threshold: automatically pushes the attacker's IP to Cloudflare's blocklist via API. No manual intervention needed.
Escalating tarpit
Detected attackers hit progressively longer response delays — 1s → 5s → 30s. They're still "connected" and burning resources, you're not.
Fake payload generators
Feed attackers convincing but useless data: fakeEnv(), fakeGitConfig(), fakeSqlDump(). Wastes their time analyzing garbage.
SQLite-backed store
All threat events, IP records, and correlation data persist locally via better-sqlite3. No external dependency required for the base install.
npm install github:Valisthea/kairos-nemesis GitHub →
// Layer 03 · Intelligence · Next.js edge middleware
MANTIS v1
Behavioral fingerprinting and anti-LLM-agent detection for Next.js applications. MANTIS runs 5 detection signals at the edge — user agent, header order, canary routes, behavioral patterns, probe sequences — combining scores into a Redis-backed fingerprint. Detected agents are redirected to a drip-stream tarpit that burns compute without returning useful content.
Next.js · Edge
5-signal detection
User agent analysis, HTTP header order fingerprinting, canary route traps, behavioral anomaly detection, and probe sequence recognition — all combined into a single threat score.
Edge runtime
Runs in Next.js edge middleware — zero cold start, global distribution, sub-1ms detection before your app code executes.
Redis-backed scoring
Threat fingerprints persist in Upstash Redis. A score > 0.9 triggers tarpit routing, even if the agent switches behavior between requests.
Drip-stream tarpit
Detected agents receive a response in 2-byte chunks with 50–150ms delays. The connection is held open, content is useless — LLM context windows fill with garbage.
Supabase audit log
Every detection event writes to mantis_sessions, mantis_events, and mantis_blocklist tables. Full audit trail for threat intel.
Kill switch
Emergency disable flag in middleware — zero-downtime bypass for debugging or incident response without a deploy.
// Integrated in kairos-recon — standalone package coming soon Follow for release →
Design philosophy
Every layer is optional. You can run KIP alone for passive stealth, add NEMESIS when you want active retaliation, and layer MANTIS when LLM agents become a threat vector. None of them require each other. None of them phone home.

These tools were built because we needed them for our own infrastructure before we audited anyone else's. KIP and NEMESIS run in production on Kairos Lab systems. MANTIS was designed after observing automated LLM agents indexing and probing APIs at scale.