[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-117412":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":16,"stars30d":16,"stars90d":13,"forks30d":13,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":32,"updatedAt":33,"readmeContent":34,"aiSummary":10,"trendingCount":13,"starSnapshotCount":13,"syncStatus":15,"lastSyncTime":35,"discoverSource":36},117412,"Antirea","diamondrubinny\u002FAntirea","diamondrubinny","Drop-in anti reverse-engineering toolkit: detect, deceive (honeypot) and disrupt analysis tools (incl. CDP\u002FREA), a multi-language control panel with an AI advisor, and server-side execution that keeps proprietary logic off the client.","https:\u002F\u002Fnorea.rubinny.net",null,"JavaScript",85,0,58,2,28,56.8,"Apache License 2.0",false,"main",true,[23,24,25,26,27,28,29,30,31],"anti-reverse-engineering","anti-scraping","bot-detection","devtools-detection","honeypot","javascript","open-source","security","self-hosted","2026-11-23 19:32:09","2026-11-23 12:12:16","# Antirea\n\n[![CI](https:\u002F\u002Fgithub.com\u002Fdiamondrubinny\u002FAntirea\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fdiamondrubinny\u002FAntirea\u002Factions\u002Fworkflows\u002Fci.yml)\n[![License: Apache-2.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache_2.0-blue.svg)](.\u002FLICENSE)\n![Node](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnode-%E2%89%A522-brightgreen.svg)\n\n**Drop-in protection against reverse-engineering and cloning, with a control panel that shows who tried, from where, and how often.**\n\nAny website, SaaS, or app can add Antirea to deter analysis tools (including CDP\u002FDevTools-based ones such as REA), serve decoys to detected harvesters, and — for the logic that actually matters — run it on the server where it can never be reverse-engineered.\n\n> 🌍 Control panel available in English, עברית, Español, Français, Deutsch, العربية, Português, Русский, 中文.\n\n## Demo\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fmedia\u002Fdemo.gif\" alt=\"Antirea control panel walkthrough: live stats, honeypot activity, REA fingerprints, the AI advisor, and instant language switching (incl. RTL)\" width=\"820\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\u003Cem>Live stats → honeypot activity → REA fingerprints → AI advisor → instant language switch (English \u002F עברית \u002F العربية, RTL). \u003Ca href=\"docs\u002Fmedia\u002Fdemo.webm\">Full-quality clip\u003C\u002Fa>.\u003C\u002Fem>\u003C\u002Fp>\n\n## Screenshots\n\nThe self-hosted control panel — live stats, behavioural detection, honeypot\nactivity, top sources, and the adaptive AI advisor (dark & light themes, 20\nlanguages, RTL):\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fscreenshots\u002Fdashboard-dark.png\" alt=\"Antirea control panel overview (dark theme): event totals, timeline, by-country and by-signal breakdowns including REA fingerprints\" width=\"900\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fscreenshots\u002Fai-advisor.png\" alt=\"Antirea AI advisor: bounded, human-approved defense proposals and the learned knowledge base\" width=\"900\">\n\u003C\u002Fp>\n\n\u003Cdetails>\n\u003Csummary>Light theme — full page\u003C\u002Fsummary>\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fscreenshots\u002Fdashboard-light.png\" alt=\"Antirea control panel full page (light theme)\" width=\"900\">\n\u003C\u002Fp>\n\n\u003C\u002Fdetails>\n\n---\n\n## ⚠️ Read this first — what is hermetic, and what is not\n\nShipping a security tool means being honest about its guarantees. Antirea has **two regimes**:\n\n| What you protect | Can CDP\u002FREA reverse-engineer it? | Antirea's answer |\n|---|---|---|\n| **Your proprietary logic \u002F algorithm** | **No** — if it never reaches the browser, there is nothing to read | ✅ **`@antirea\u002Fsecure-fn` — runs it on the server. Hermetic.** |\n| **Code that must ship to the browser (UI)** | Yes, eventually — anything sent to a browser can be read | ⚠️ Detection + honeypot + behavioural engine. **Raises cost, not a wall.** |\n\n**There is no client-side technique that makes delivered JavaScript impossible to reverse-engineer.** Anyone claiming otherwise is selling false security. Antirea's *hermetic* guarantee is server-side execution; everything client-side is defense-in-depth that deters, detects, and reports. Use both.\n\n---\n\n## Packages\n\n| Package | Role |\n|---|---|\n| **`@antirea\u002Fsecure-fn`** | **The hermetic core.** Runs proprietary functions on the server; client sends inputs, gets outputs. CDP never sees the algorithm. |\n| `@antirea\u002Fhoneypot` | Express\u002Fconnect middleware. Behavioural detection (IP, cadence, timing, header instability) + serves decoys. Shadow mode by default. |\n| `@antirea\u002Fguard` | Browser library. Detects DevTools\u002FCDP\u002Fautomation and reports telemetry. `\u003Cscript>` or npm. |\n| `@antirea\u002Fchallenge` | **Proof-of-work gate** — makes high-volume scraping pay CPU (server issue\u002Fverify + browser solver). Plus honeypot **tarpit** and **JA3\u002FTLS** signal. See [`docs\u002FBOT-DEFENSE.md`](.\u002Fdocs\u002FBOT-DEFENSE.md). |\n| `@antirea\u002Fharden` | **Client-code hardening** — SRI\u002FCSP\u002Fsecurity headers, an obfuscation preset, encrypted-bundle delivery, and guard **domain lock** (flag rehosted clones). See [`docs\u002FHARDENING.md`](.\u002Fdocs\u002FHARDENING.md). |\n| `@antirea\u002Fwatermark` | **Traitor tracing** — per-viewer watermarking (identify a leaker), canary scanning (find leaks on GitHub), and attack-spike webhooks. See [`docs\u002FWATERMARKING.md`](.\u002Fdocs\u002FWATERMARKING.md). |\n| `@antirea\u002Fadaptive` | **Learns from attacks** and proposes bounded defense changes. Heuristics always; AI optional (BYO key). Suggest-only by default. |\n| `@antirea\u002Fcollector` | Ingest API + GeoIP + SQLite + the **multi-language control panel** (stats, settings, AI advisor). |\n\n---\n\n## Quickstart\n\n### 1. Run the collector + control panel\n\nRequires **Node.js 22+** (24 LTS recommended).\n\n```bash\nnpm install\nnpm run build            # builds every package; the collector imports adaptive + watermark\ncd packages\u002Fcollector && cp .env.example .env\nnode -e \"console.log('IP_SALT='+require('crypto').randomBytes(32).toString('hex'))\"\nnode -e \"console.log('ADMIN_TOKEN='+require('crypto').randomBytes(32).toString('hex'))\"\n# paste both into .env, then:\nnpm start\n```\n\nOpen `http:\u002F\u002Flocalhost:8080\u002F`, enter your `ADMIN_TOKEN`, pick a language.\n\n> Behind a reverse proxy, set `TRUST_PROXY` to the **number** of proxies in front\n> of the collector (`true` = 1, maximum 10; any other value refuses to start). Only\n> that hop of `X-Forwarded-For` is trusted, so clients cannot forge their IP to\n> dodge rate limits. This holds only if the collector is reachable **solely\n> through that proxy chain**: firewall direct access to the collector (and, with\n> `TRUST_PROXY=2`, to the inner proxy, so traffic cannot skip the CDN), and make\n> each trusted proxy *append* the client address to `X-Forwarded-For`.\n\n### 2. Add the honeypot to your server (one middleware)\n\n```ts\nimport express from \"express\";\nimport { honeypot } from \"@antirea\u002Fhoneypot\";\n\nconst app = express();\napp.use(honeypot({\n  siteId: \"my-site\",\n  protect: [\u002F^\\\u002Fassets\\\u002F.*\\.js$\u002F, \u002F\\.map$\u002F],  \u002F\u002F the files you want to protect\n  mode: \"shadow\",                              \u002F\u002F start here; switch to \"live\" after tuning\n  reportUrl: \"https:\u002F\u002Fcollector.example.com\u002Fapi\u002Fevents\",\n  allowlist: { verifyReverseDns: true },       \u002F\u002F protects Googlebot\u002FBing → SEO safe\n  \u002F\u002F Optional: control mode\u002Fthreshold\u002Fallow\u002Fblock lists live from the panel:\n  \u002F\u002F config: { url: \"https:\u002F\u002Fcollector.example.com\u002Fapi\u002Fsite-config\", siteKey: \"\u003Cthe panel's Site key>\" },\n}));\napp.use(express.static(\"public\"));\n```\n\n### 3. Add the guard to your pages (one script tag)\n\n```html\n\u003Cscript src=\"https:\u002F\u002Fyour-cdn\u002Fantirea-guard.iife.js\"\n        data-site-id=\"my-site\"\n        data-endpoint=\"https:\u002F\u002Fcollector.example.com\u002Fapi\u002Fevents\"\n        data-mode=\"silent\">\u003C\u002Fscript>\n```\n\n### 4. Protect the logic that matters — hermetically\n\n```ts\n\u002F\u002F SERVER — the algorithm lives here forever; CDP\u002FREA never sees it\nimport { createSecureFnRouter } from \"@antirea\u002Fsecure-fn\";\napp.use(\"\u002Fsecure\", createSecureFnRouter({\n  secret: process.env.SECUREFN_SECRET,\n  reportUrl: \"https:\u002F\u002Fcollector.example.com\u002Fapi\u002Fevents\",\n  maxInvokesPerMin: 60,\n  functions: { pricing: (args) => ({ result: args.x * 1337 + 17 }) },\n}));\n```\n```ts\n\u002F\u002F BROWSER — zero proprietary logic, zero secret\nimport { createSecureClient } from \"@antirea\u002Fsecure-fn\u002Fclient\";\nconst api = createSecureClient({ endpoint: \"\u002Fsecure\" });\nconst { result } = await api.invoke(\"pricing\", { x: 2 });\n```\n\nNot on Express? `@antirea\u002Fsecure-fn\u002Fweb` exports a standard\n`(Request) => Response` handler (Next.js App Router and other Node.js\nframeworks). Adapters, guards and a guide to choosing what to move server-side:\n[`docs\u002FSECURE-FN.md`](.\u002Fdocs\u002FSECURE-FN.md).\n\n---\n\n## Control panel\n\nAt `http:\u002F\u002F\u003Ccollector>\u002F` (behind your `ADMIN_TOKEN`):\n\n- **Live stats** — events, unique sources, timeline, by country, by signal.\n- **Top sources** — the most active (hashed) sources and their last action.\n- **Protection settings (live)** — toggle protection, switch Shadow\u002FLive, set the detection threshold, manage **Allow\u002FBlock IP lists**, and set the **Site key**. Changes are pulled by your honeypot within ~30s — no redeploy. (Requires wiring the honeypot `config` option in step 2.)\n- **Languages** — 20 languages (en, he, es, fr, de, ar, pt, ru, zh, it, ja, ko, tr, hi, nl, pl, id, vi, fa, uk), switch instantly; RTL for Hebrew, Arabic and Persian.\n\nThe project website, [norea.rubinny.net](https:\u002F\u002Fnorea.rubinny.net), is in six languages (English, Hebrew, Spanish, French, German, Arabic) with RTL, a localized cookie banner and privacy page.\n\n---\n\n## Behavioural detection — resistant to header tampering\n\nAttackers spoof the `User-Agent` and other headers. Antirea's engine (`@antirea\u002Fhoneypot`) **does not trust client headers.** It scores server-observed facts:\n\n- **Velocity** — requests per 10s from an IP.\n- **Timing regularity** — scripts fire at suspiciously even intervals (low coefficient of variation).\n- **Fast cadence** — sustained sub-human request spacing.\n- **Harvesting shape** — many distinct asset paths with zero real page navigations.\n- **Header instability** — one IP presenting several identities ⇒ forged\u002Frotated headers → **raises** the score. *Tampering with the header works against the attacker, not for them.*\n- **Header forgery** — a UA claiming modern Chromium but missing Client-Hints\u002FSec-Fetch is detected as a lie.\n\n**Honest scope:** this is statistical deterrence. A slow, single-identity scraper can stay under thresholds. For logic that must stay secret, use `@antirea\u002Fsecure-fn`.\n\n---\n\n## REA signature pack\n\nAntirea ships fingerprints for the `morluto\u002Frea` tool — **verified against REA\n6.8.0's source and measured on real Node and Chromium** — each documented with\nits evadability in [`docs\u002FREA-SIGNATURES.md`](.\u002Fdocs\u002FREA-SIGNATURES.md):\n\n- **Server** — REA's source-map fetcher runs on Node's `fetch`: its `Accept`\n  header contains the `application\u002Fsource-map+json` media type, which no\n  browser sends (`rea.sourceMapAccept`). Node's own defaults —\n  `user-agent: node`, `accept-language: *` and a *partial* Sec-Fetch set — form\n  one combined runtime fingerprint (`ua.runtimeFetch`,\n  `forgery.partialSecFetch`, `acceptLanguage.wildcard`), capped below the decoy\n  threshold: a plain Node script harvesting your bundles is **reported**, and is\n  decoyed only when corroborated (e.g. it requests a `.map`, which is how a REA\n  fork with a changed `Accept` is still caught).\n- **Source-map canary** (`canary.sourceMap`) — REA fetches every source map a\n  page declares; point a bundle at an unlinked map URL with\n  `sourceMapCanaryComment()` — or let the Vite\u002FRollup plugin\n  (`@antirea\u002Fhoneypot\u002Fbuild`) add one to every chunk — and a hit means *some* source-map consumer read it\n  (REA, a harvester — or a developer with DevTools open). Strong evidence of\n  analysis, not proof of REA; not scored for allowlisted or disabled traffic.\n- **Client** — REA's scripted-scenario patches: unique `rea-restore-*` \u002F\n  `rea-service-workers-*` markers (`rea.scenarioSwPolicy`, near-certain) and\n  Playwright's service-worker block (`automation.swBlockPatch`); the default\n  Playwright profile (`rea.playwrightDefaults`); and the `debugger` pause REA\n  never suppresses (`cdp.debuggerPause`).\n\nREA has no stealth code. It **can** read a protected bundle that was already\ndecrypted before it attached — see the honest\n[what REA can and cannot defeat](.\u002Fdocs\u002FREA-SIGNATURES.md#what-rea-can-and-cannot-defeat-honest)\ntable. These are deterrence + intelligence; the hermetic protection remains\n`@antirea\u002Fsecure-fn`.\n\n## Client logic that must ship → WASM\n\nFor logic that can't move to the server (latency\u002Foffline), ship the sensitive\npart as **WebAssembly**: a CDP\u002FREA client dumps an opaque binary, not readable\nJS. Load it through the same attestation gate so detected clients get a decoy:\n\n```ts\nimport { instantiateProtectedWasm } from \"@antirea\u002Fguard\";\nconst logic = await instantiateProtectedWasm(\"logic\", { endpoint: \"\u002F__p\u002F\" });\nlogic.priceQuote(2);\n```\n\nWorking example in `examples\u002Fwasm-logic\u002F` (AssemblyScript → `.wasm`, with a test\nproving the formula is absent from the binary). Full guide: [`docs\u002FWASM.md`](.\u002Fdocs\u002FWASM.md).\nStrong deterrence, not hermetic — WASM can still be disassembled.\n\n## CDP \u002F REA specifics\n\nA tool attached via the Chrome DevTools Protocol reads source directly from the engine. For **client code** Antirea adds: a CDP probe in the guard (`debugger`-timing — REA's passive capture does not suppress pauses — plus `Error.stack`\u002F`RegExp.toString` console traps) and **attestation-gated delivery** (`importProtected`) so protected modules are fetched out-of-band and replaced with decoys under CDP. These raise cost; `blackboxing` and a forged attestation header defeat them. For **logic**, `@antirea\u002Fsecure-fn` is the real answer.\n\n---\n\n## Adaptive AI advisor (optional, `@antirea\u002Fadaptive`)\n\nLearns from the attacks it sees and proposes defense changes. **Off by default; turn it on in the collector's `.env` (`AI_ENABLED=true` + an API key).**\n\n- **Heuristics run always** (no key needed): they summarize recent events, build a **knowledge base** of recurring attack signatures (signal combos, with confidence that grows as a pattern recurs), and propose bounded tweaks.\n- **AI advisor (BYO key, default Claude `claude-opus-5-5`)**: sends only an **aggregated, non-PII summary** (counts, country codes, signal names — never raw IPs or User-Agents) and returns analysis + proposals.\n- **Control panel → AI Advisor tab**: run analysis, review proposals, **Approve & apply** or **Reject**.\n\n**Safety design (important for a feedback-driven system):**\n- **Suggest-only by default.** A human approves every change. `AI_AUTO_APPLY` is off by default and, even on, only applies *small threshold steps* — never mode switches, never IP blocks.\n- **Model output is untrusted.** Every proposal is clamped to hard bounds (`threshold ∈ [0.4, 0.95]`, `mode ∈ {shadow, live}`) before storage, so a poisoned or prompt-injected model cannot push a defense outside the safe envelope.\n- **Poisoning is possible in principle** — an attacker who feeds crafted traffic could try to nudge recommendations. Human-in-the-loop + bounds + no auto-hard-block are the mitigations. Review proposals; don't enable auto-apply unless you understand this.\n- **No raw IPs leave the collector**, so the AI never proposes IP blocks (that stays a manual operator action from the Top-sources view).\n\n## Security & privacy (GDPR \u002F IL Privacy Law — draft, needs legal review)\n\n- **No raw visitor IP is stored.** For every event the collector derives a country and stores `sha256(ip + secret salt)` only. (IP addresses an administrator types into the Allow\u002FBlock lists are configuration and are stored as entered.)\n- Telemetry is minimal: event type, signal names, path (query stripped by default), UA, language, screen, timezone.\n- Admin panel + APIs require a bearer token; the per-site config read requires a Site key.\n- Automatic retention pruning (`RETENTION_DAYS`, default 90).\n- Payload caps, rate limiting, strict validation, security headers, configurable CORS.\n- You must provide a privacy policy and a lawful basis for processing. **Have a lawyer review it.**\n\n---\n\n## Limitations (please read before relying on it)\n\n1. **Client code cannot be made unreadable.** Only `secure-fn` (server execution) is hermetic.\n2. **Behavioural detection is statistical** — false positives are possible, so **Shadow mode is the default**; tune before going Live. Keep the bot allowlist current to protect SEO.\n3. **CDP source reads bypass client defenses**; a determined operator with blackboxing evades the client layer.\n4. In-process behavioural state and rate limits are **per-instance**; multi-instance deployments need a shared store (e.g. Redis).\n5. **GeoLite2 (geoip-lite) licensing** for commercial use needs verification.\n\n---\n\n## Deploy\n\n- **Docker:** `docker compose up --build` (see `docker-compose.yml`). The image runs\n  on Node 24 as the unprivileged `node` user; data lives on the `\u002Fdata` volume.\n  **Upgrading an existing deployment?** Follow the one-time volume-ownership and\n  database-path steps in the [CHANGELOG upgrade notes](.\u002FCHANGELOG.md#upgrade-notes).\n- **Windows Server:** run the collector as a Windows Service — see\n  [`packages\u002Fcollector\u002Fwindows\u002FREADME.md`](.\u002Fpackages\u002Fcollector\u002Fwindows\u002FREADME.md).\n  (The `honeypot`\u002F`secure-fn` packages need no installer; they `npm install`\n  into your app. The Microsoft Store is not used — a server belongs in a\n  service, not a sandboxed Store app.)\n\n## Development & tests\n\n```bash\nnpm install\nnpm run build:guard\n# verified test suites:\nnode packages\u002Fsecure-fn\u002Ftest\u002Fe2e.mjs      # 13 checks: session, server-side result, replay, forgery, rate limit, proxy IP, body rules\nnode packages\u002Fhoneypot\u002Ftest\u002Fbehavior.mjs  # 4 checks: cadence, header churn, harvesting, human-like\nnpm run test:integration                  # e2e proof vs. the real server (see below)\n```\n\n**End-to-end proof.** `test\u002Fintegration.mjs` boots the real example server\n(honeypot in live mode + secure-fn) and asserts the whole chain works: an\nanalysis-shaped request (headless UA, or REA's source-map `Accept`) receives an\ninert **decoy**; a real browser receives the **real** asset; `secure-fn` returns\nthe computed **output** while the proprietary constant **never appears** in\nanything served to clients.\n\nSee `examples\u002Fprotected-site\u002F` for a focused demo, and\n[`examples\u002Ffull-stack\u002F`](.\u002Fexamples\u002Ffull-stack\u002F) for one app that wires **all\nseven packages** together with an 11-check end-to-end test (`node\nexamples\u002Ffull-stack\u002Ftest.mjs`).\n\n## Contributing translations\n\nAdd a language by adding one entry (same keys) to `packages\u002Fcollector\u002Fpublic\u002Fi18n.js`. English is authoritative; other translations are community-provided and not professionally reviewed — corrections welcome.\n\nHebrew docs: [`README.he.md`](.\u002FREADME.he.md). Design notes: [`PLAN.md`](.\u002FPLAN.md).\n\n## Author & credit\n\nCreated and maintained by **Diamond Rubinny**.\n\nEvery source file carries a credit header, and the minified guard bundle keeps\na credit banner. **This credit must be preserved** in any copy or derivative\nwork (Apache-2.0 §4 + [`NOTICE`](.\u002FNOTICE)). Don't strip the `Diamond Rubinny`\nnotices.\n\n## License\n\nLicensed under the **Apache License 2.0** — see [`LICENSE`](.\u002FLICENSE) and\n[`NOTICE`](.\u002FNOTICE). Using, modifying, or redistributing the code requires\nretaining its copyright and attribution notices.\n\n---\n\n\u003Csub>**Website:** \u003Chttps:\u002F\u002Fnorea.rubinny.net> · **Keywords:** NoREA, anti-REA, block REA, stop REA,\nREA reverse engineering, anti reverse engineering, reverse-engineering protection, source code\nprotection, code cloning protection, CDP \u002F DevTools detection, honeypot, anti-bot, anti-scraping,\nanti-tampering, bot detection, WASM code protection, protect JavaScript, threat intelligence,\nTypeScript, Node.js.\u003C\u002Fsub>\n","2026-11-24 04:55:37","CREATED_QUERY"]