Listed from the MCP registry; nobody on Odel publishes it.
antiRea advisory bot-abuse signals as stateful MCP sessions (evaluation and demos).
Runs on your machine from its package; the steps are below.
At most: only reads or looks up information.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
npx -y @dannyphan190/anti-rea-mcp
MCP client config
{
"mcpServers": {
"antirea": {
"command": "npx",
"args": [
"-y",
"@dannyphan190/anti-rea-mcp"
]
}
}
}
Build it. Ship it. Keep it yours.
antiRea is a server-side TypeScript library that meters dataset access per identity and flags coordinated bot abuse - bulk extraction crews, scheduler-driven herds, seat squatting. Advisory only: it flags, you decide.
Website - Threat model - Limitations - Changelog
English - Tiếng Việt - 中文 - Español
Cloning tools can watch your app's pages, bundles and traffic, then rebuild what they saw. You cannot hide code a browser has already received - so antiRea defends the other side: the data itself.
Unprotected. Anyone with an account can take your data home. In our tests, one account walked away with the entire 10,000-record dataset in under 200 requests. Quietly. Nothing unusual in the logs.
Protected. Real users notice nothing. Each identity can only ever receive a capped slice - 20% of the dataset in our test setup - so copying stops being an export and becomes an identity problem. Split the work across many accounts, and the herd detector flags the coordination.
Unprotected, your data leaves whole, free and invisible. Protected, it leaves in slices, at a cost, and on the record.
Full numbers: Measured results.
npm install @dannyphan190/anti-rea
Node.js 20+. Zero runtime dependencies. Also available via GitHub Release.
Request quotas cap speed. A record budget caps how much of the dataset one identity can ever receive, however politely it asks.
import { createRecordBudget, createHerdDetector } from "@dannyphan190/anti-rea";
// One identity receives at most 2,000 distinct records per day.
const budget = createRecordBudget({ maxDistinctPerWindow: 2_000 });
const herd = createHerdDetector({
onFlag: snap => { /* snap.band: "budget_cut_supported" | "graduated_only" */ },
});
// Check before the handler runs:
if (!budget.check("account:123", 1).allowed) { /* return 429 */ }
// Then record what the response actually served:
budget.consume("account:123", recordIdsServed);
herd.observe({ type: "list", identity: "account:123", ip: serverSeenIp, recordIds: recordIdsServed });
Use the same identity string (account:<id>) in both, and a herd
flag can feed straight into a budget cut via applyHerdLadder().
Five groups. Start at the top; each layer is independent.
| Group | What it does, in plain words | Main pieces | Honest limit |
|---|---|---|---|
| Meter | Caps how much data any one identity can ever receive, and how fast | Record budget (createRecordBudget), quota and pagination guard (createQuotaGuard), priced exports (createExportGuard), session cursors (mintCursor / verifyCursor), flow scoring (createFlowScorer) | Attackers can rotate identities - pair with real signup cost on your side |
| Surface | Controls WHAT may cross the boundary: fields a response never declared (the password hash in a profile payload) and fields a request was never offered (the role in a profile update) | Field guard, both directions (createSurfaceGuard) - built-in sensitive/privileged denylists plus per-route schema allowlists; advisory by default, strip or block only when the host says so | Sees field names, not values or ownership - a declared field filled with someone else's data is still your authorization logic's job |
| Ownership | Spots one identity sweeping through other people's objects (the BOLA/IDOR walk - sequential ids, random ids, or a slow spread over hours) and reports it with evidence | Ownership probe (createOwnershipProbe) - per-identity distinct-owner ratio over rolling windows (1 h by default, add 6 h for slow sweeps), public routes exempt, incremental state with O(1) verdict reads; advisory only | A flag is a shape, not proof - authorization stays your job, and a sweep under the floors or concentrated on few owners is out of reach |
| Watch | Spots coordination: many identities quietly tiling your dataset, probing decoys, or crowding a room | Herd detector (createHerdDetector + applyHerdLadder), phase signals (createHerdPhaseSignal, createActivityPhaseSignal), room guard (createRoomGuard), canary traps and decoys (handleCanaryTrapRequest, createCanaryMaze, createDecoyMirage), automation telemetry (detectAutomationSignals), source-map hygiene (verify-build.py / run-audit.cjs), volume-rank rule (applyVolumeRankRule), empirical-mix calibration (selectEmpMixThreshold), session-timing features (computeHoldTypeFeatures / createHoldTypeScorer), early-minimal occupancy signal (createOccupancyEarlyMinimalSignal) | Detection is not enforcement - low-tiling herds get a graduated response, and one adaptive herd was flagged yet still finished |
| Prove | Pins down what a verdict means: which config produced it, who actually signed, what may ground a consequence | Config provenance (createConfigProvenance), Web Bot Auth verification (createWebBotAuthVerifier), step-up proofs (issueStepUpProof, createStepUpProofVerifier), step-up consequence shaping (createStepUp402Responder), evidence roles (evidentiaryRoleOf, auditEvidencePack, decorateSignalResult) | A verified signature is identity, not authorization - your auth checks stay exactly as they are |
| Trace | Optional client-side aids for leaks and replay | Context-bound envelopes (encryptPayload / decryptPayload, createInMemoryReplayGuard), forensic watermark (mountForensicWatermark), preference declaration log (createDeclarationLog) | Traceability, not access control - overlays can be cropped, and the browser holds its own context |
Recommended order: quota guard first (see below), then the record budget, then herd detection.
Method, in short. We test against Ledgerly, a synthetic SaaS
holding 10,000 records behind 120 accounts, run twice: unprotected,
and the same app with antiRea wired in. Attack runs are driven by
REA 6.8.0 (rea-agents) and by general-purpose agents following the
standard clone workflow; polite-user runs measure the cost to
legitimate traffic. An independent benchmark was published in
issue #1 - most claims
held up, and the gaps it found are fixed and in the changelog.
Full method and per-layer table: docs/EVIDENCE.md.
| Layer | Headline result |
|---|---|
| No protection (baseline) | The full 10,000-record dataset leaves in 160-193 requests |
| Record budget | One identity is capped at exactly 20% of the dataset |
| Herd detector + CUSUM evidence | REA-style identity rotation stopped at 5%; an adaptive crew needed 25 identities and ~19 minutes |
| Declared cohort ceiling | The cohort union stopped at exactly 600 records, zero served past the cap |
| Legitimate users | Declared team 1,200/1,200 with zero friction; polite users zero consequences |
| Action budget (lab) | Feature-abuse herd completed 16/80 operations (20%); ordinary users 48/48, zero consequences |
| Advisory signals (lab) | Five slow-shape signals: 0-1.67% false flags on legitimate traffic - per-signal numbers in the full table |
What this adds up to. The casual one-shot clone is gone. Bulk extraction becomes an identity problem: every extra slice costs another account and more visibility. It does not stop a determined, well-resourced rebuilder - and the real price of an identity (signup friction, verified accounts, payment) is set by you, which is why budgets are per identity and herd flags distinguish "cut the budget" from "step up scrutiny".
antiRea ships an official MCP server for AI agents:
@dannyphan190/anti-rea-mcp
(source), built on the
official @modelcontextprotocol/sdk, speaking MCP over stdio.
It exposes the library's eight advisory signal kinds as six tools -
list_signals, create_signal, observe, observe_reference,
evaluate, close_signal - so an agent can open a signal session,
feed it events and read the verdict.
{
"mcpServers": {
"anti-rea": {
"command": "npx",
"args": ["-y", "@dannyphan190/anti-rea-mcp"]
}
}
}
It is an evaluation and demo channel. Production protection still belongs in-process, in your own app.
The decoy surface learns to answer on the auth tier and on the write path, and antiRea grows its first client component - for one item only, under the DEC-1 decision, which breaks the server-only rule at exactly U2 and nowhere else. Everything is opt-in and OFF by default; runtime dependencies remain zero. A host that enables nothing gets byte-identical behavior to 3.3.1 on real surfaces.
createShadowAuthTier): a decoy auth tier - a fake permission matrix and decoy records - served only to identities the host's own flag gate marks as flagged. The module accepts no host data source at all: everything it serves is synthetic. Measured (Neon tactics trial): a gpt-5.4-level agent absorbed the shadow tier as a real auth component in 2 of 3 deciding runs (P-T3a HIT 2/3 - the caveat travels with the claim); safety PASS with 0 real account ids in any shadow response, and clean identities received byte-identical refusals with the tier on and off. The shadow loop is closed over the documented public demo credentials only; a flagged identity presenting a valid real token passes through to the host's real flow.createDecoyWriteSurface): a write-side decoy contract with a frozen fake constraint set - a fake required field, an inverted price format, a fake id space. Decoy 422 responses name the violated constraint, so a clone built against the decoy inherits the fake rules. The module holds no reference to any host store; writes land only in a module-owned sink, and the audit counts routed writes only. Measured (B-N4 trial): agent clones carried all three fake constraints into a clean twin, each producing exactly one purely fake-attributable failure; false positives PASS 36/36 byte-identical. The trial's one audit-gate incident is disclosed in full in the changelog (Addendum E).createPolymorphicChallenge + the DEC-1 client component): each session, the server issues a JavaScript payload morphed from the session seed - identifiers rotated, step order shuffled, decoy steps mixed in - which the client component executes to answer a step-up; the server verifies arithmetically from the same seed. Challenges are short-lived and single-use: the first verify attempt consumes the challenge, pass or fail. Framing, frozen: U2 is an execution tax, not a wall - a real agent that executes JavaScript still passes. No effectiveness number exists for U2 and none is claimed.1806 tests: 1804 passed, none failed, 2 skipped.
The decoy surface learns to reference itself, to speak GraphQL, to change shape per identity, and to sign the images it serves. Every feature is opt-in and OFF by default, server-side only, and runtime dependencies remain zero. A host that enables nothing gets byte-identical behavior to 3.3.0 on real surfaces.
buildChainRouteMap / chainRoutes + surface chain serving): decoy records arranged as a chain of individually routed records - a level-1 record carries the next level's record id, and the next record lives at its own route - so extraction walks one metered fetch per record instead of one page per dataset. Measured (trial v4, arm FAN): real yield 150 -> 100 (-33.3%) under the harness's all-or-nothing page budget; under partial-page accounting the same arm yields 131 (-12.7%, below the registered -15% threshold), so the effect is quoted only with that framing. Decoy retention 78/78, meter 150 in every arm.buildGraphqlIntrospection): a phantom GraphQL schema layered over the host's declared real types - phantom object types, phantom Query fields, decoy fields on real types - served at the declared path as an introspection document. Measured (trial v4, arm GQL): 10/10 planted identifiers (3 phantom types, 3 phantom queries, 4 decoy fields) entered the capture with 0 flags at meter 150. The measured carrier was the endpoint's introspection response; no GraphQL execution ships.applyIdentityVariants): one decoy endpoint whose record list is reshaped per requesting identity - which skew fields exist, which enum values can appear, what the aliased fields are called. Measured (trial v4, arm S1, 2 classes): 8/10 skew fields appeared under exactly one identity; one identity's enum coverage was 60% of the universe; cross-identity field-name overlap was a 30% Jaccard. Not claimed: the mis-map leg - whether extraction code written against identity A's shape then fails on identity B's - was not measured.1772 tests: 1770 passed, none failed, 2 skipped.
Metering caps how much an extractor takes; this release contaminates what the copies are built from. A host publishes a decoy surface - endpoints, a spec, worked examples - that exists only to be copied, while its real surface stays untouched. Everything is opt-in and OFF by default; a host that enables nothing ships exactly the 3.2.0 behavior.
generateDecoySurface, buildDecoyOpenApiSpec, createDecoySurface): one registry generates the robots disallow block, the sitemap and an OpenAPI spec declaring live decoys plus phantom endpoints that are never served. In the lab trials the machine-read channels carried 8/8 decoys into the extractor's capture with zero real-user footprint, and 4/4 live plus 2/2 phantom endpoints entered its map with 0 flags.planCanaryInterleave, opt-in, no default in code): the host mixes its own synthetic records at a dose it states on every call (documented recommendation 10%); measured dose response is linear (10% planted extracted at exactly 10.0%; 25% at 24.7%), and each canary carries an HMAC tag keyed to the serving identity. Across the agent-loop trial the decoy surface multiplied an LLM extractor's token cost by 2.09x (median 7,101 vs 14,808 tokens per session) while the 150-record meter held in every arm.1725 tests: 1723 passed, none failed, 2 skipped.
The shipped canary trap paths were identical on every deployment - read the SDK once, know every site's traps forever. This release makes each deployment's surface a different, rotating shape. All of it is opt-in and advisory; no default changes.
derivePolymorphCanaryPaths, derivePolymorphSurface): derive natural-looking canary trap paths from a host seed and a weekly epoch (deterministic, SHA-256 only, zero new dependencies) and pass them to the canary machinery you already use. Last epoch's paths come back as retired traps - detectors only, so a hit on one means old or stolen intel. The fake-endpoint paths stay exactly as shipped: they are the fixed scanner liturgy.buildVariantManifest, verifyVariantManifest): SHA-256 manifests over a variant's files. Verification never throws and never blocks; it returns a signal object with per-file mismatch reasons for you to log or alert on.tools/polymorph/): a build-time tool that obfuscates the four surface modules (cursor, canary-echo, fake-endpoints, trap-paths) under your seed, embeds an inert, extractable host-fingerprint watermark for leak tracing (traitor tracing), appends plausible decoy dead code, and writes the surface manifest. javascript-obfuscator is an optional build-time tool for the generator only; the SDK runtime stays zero-dependency.1683 tests: 1681 passed, none failed, 2 skipped.
Earlier releases: see the Changelog.
Server-side quotas and pagination bounds, enforced per account,
API key and IP. Returns HTTP 429 with Retry-After, and logs
structured events for operators.
import { createExpressQuotaMiddleware } from "@dannyphan190/anti-rea";
app.use("/api/", createExpressQuotaMiddleware({
trustedIpHeader: "cf-connecting-ip",
tiers: {
anonymous: { maxRequests: 30, windowMs: 60_000, maxPageSize: 25, maxPage: 5 },
free: { maxRequests: 60, windowMs: 60_000, maxPageSize: 50, maxPage: 20 },
pro: { maxRequests: 300, windowMs: 60_000, maxPageSize: 200, maxPage: 100 },
},
resolveIdentity: req => ({
accountId: req.headers.get("x-verified-account") ?? undefined, // from your server auth
apiKeyId: req.headers.get("x-verified-key-id") ?? undefined,
tier: "free",
}),
onQuotaExceeded: event => {
console.warn("[quota-exceeded]", event);
},
}));
429 semantics and pagination bounds, held to the same
test contract: examples/python-fastapi.createRecordBudget keyed by a host-declared cohort
id, so identity rotation inside a declared cohort stops diluting
the cap. Pattern with runnable verification:
examples/declared-cohort-budget.uncalibrated: true
wherever they are mentioned. See the calibration pilot below.Full list: docs/LIMITATIONS.md.
The repo ships a Playwright harness that runs a synthetic SaaS
(Northstar: dashboard, customer search, lead creation, CSV
export, chart views) in baseline (:4173) and protected (:4174)
modes, across Chromium, Firefox and WebKit.
npm install
npm run build && npm run benchmark:build-sdk
python -m pip install playwright
python -m playwright install chromium firefox webkit
python benchmark/run_all.py --browsers chromium,firefox,webkit --iterations 5
Working on the repo itself: npm run check compiles, runs 1683
automated tests (1681 passing, none failing, 2 skipped) and
performs static checks. Scan a public build before deploying with
node scripts/run-audit.cjs /path/to/dist or
python3 scripts/verify-build.py /path/to/dist.
The one thing this project cannot generate for itself is real
traffic. If you run antiRea (or are evaluating it), run the CUSUM
tripwire in mode: "observe" - crossings are logged, nothing is
restricted - and share the anonymised aggregate snapshots it
emits: cohort sizes, scores, union-record counts.
No raw user data, no record contents, no identifiers. Review and
strip a snapshot before sending; if a field looks identifying,
leave it out and say so. The first real snapshot set is how the
uncalibrated label comes off.
Interested, or want the snapshot format first? Email dannyphan190@gmail.com.
Read CONTRIBUTING.md and SECURITY.md before opening a pull request or a vulnerability report.
Project funding: Support the maintainer (optional; never necessary to use).