
clonewall
io.github.aizen-technology/clonewall
Find what an AI reverse-engineering agent can lift from your app, and fix it.
Documentation
clonewall
Find what an AI reverse-engineering agent can lift from your app, and fix what lasts first.
Agent toolkits such as REA (Reverse Engineer Anything) let a coding agent drive Ghidra, JADX, Frida, a browser and network captures, trace one feature of a shipped app, and rebuild it. clonewall is the defensive side: a CLI, an MCP server and an agent skill that audit your own web, Android, iOS and desktop apps for what such an agent would get, and rank the fixes by what actually holds.
npx clonewall scan . # your source
npx clonewall scan app-release.apk # what you ship (.apk, .aab, .ipa, .xapk, .asar, or a build folder)
clonewall is not affiliated with REA. It has no runtime dependencies and only reads files; it never sends your code anywhere.
Ways to use it
One package, four ways in. They all run the same scanner and read the same guides.
flowchart LR
repo["clonewall<br/>(npm package / GitHub repo)"]
repo --> cli["CLI<br/>clonewall scan"]
repo --> mcp["MCP server<br/>clonewall mcp"]
repo --> skill["Agent skill<br/>harden-against-cloning"]
repo --> plugin["Plugin manifests<br/>Claude Code · Codex · Cursor"]
cli --> you["You, in a terminal"]
cli --> ci["CI: SARIF to GitHub code scanning"]
mcp --> agents["Any MCP client:<br/>Claude Code, Codex, Cursor, Gemini CLI"]
skill --> agents
plugin --> agents
| Use it as | What you get | Install |
|---|---|---|
| CLI | Scan a folder or a shipped artefact and get text, JSON, Markdown or SARIF | npx clonewall scan . |
| CI step | Fail the build on high findings and show them in GitHub code scanning | CI |
| MCP server | Tools scan_project, list_checks and hardening_guide for any agent | MCP server only |
| Agent skill | A full audit: the scan, plus the checks a scan cannot do, written up as a report | npx clonewall setup |
| Claude Code plugin | The skill and MCP server together, from this repository | Claude Code plugin |
| Library | import { scan } from 'clonewall' returns the findings as an object | npm i clonewall |
For a full audit, use the skill with the MCP server. The scan finds what is in the files; the skill makes the agent check what the files cannot show:
sequenceDiagram
participant You
participant Agent
participant Skill as harden-against-cloning skill
participant MCP as clonewall MCP server
You->>Agent: "Use harden-against-cloning to audit this project."
Agent->>Skill: load the audit workflow
Agent->>MCP: hardening_guide("audit-workflow")
Agent->>MCP: scan_project(path)
MCP-->>Agent: findings tagged seen / inferred / unknown, with the cloning step each cuts
Agent->>Agent: manual checks: response vs screen, cross-account access, client-side logic, server-side token checks
Agent-->>You: report ranked by lasting / raises the cost / buys time
What it believes
Anything the client can see, the client can copy. Independent testing in 2026 found that agents never broke strong obfuscation; they went around it by running the code instead of reading it (Quarkslab), and layered obfuscation raised their cost only about 2–5x (Elastic). What an agent cannot get around is a server it has to keep asking: REA's own ledger will not call a rebuilt feature verified without replaying it against the real service. So clonewall tags each finding with the step of a clone it cuts, and sorts every fix into three tiers:
- Lasting: logic, prompts, models and secrets on the server, responses that carry only what the screen shows, per-object authorization and row-level security, per-user quotas, cross-account anomaly alerts.
- Raises the cost: attestation verified on the server and bound to the request (Play Integrity, App Attest), bot challenges verified with siteverify, replay-resistant tokens, canary records and watermarks.
- Buys time: no source maps or symbols, minification, targeted obfuscation, anti-tamper that fails silently, Electron fuses, certificate pinning.
Install
Any agent, one command
npx clonewall setup # or: npx clonewall setup --dry-run
Installs the harden-against-cloning skill into ~/.agents/skills (and ~/.claude/skills if you use Claude Code),
then registers the MCP server with every agent it finds: Claude Code, Codex, Cursor and Gemini CLI. Existing config is
kept; running it twice changes nothing.
Claude Code plugin
/plugin marketplace add aizen-technology/clonewall
/plugin install clonewall@clonewall
MCP server only
{
"mcpServers": {
"clonewall": { "command": "npx", "args": ["-y", "clonewall", "mcp"] }
}
}
Tools: scan_project (static scan of a folder), list_checks, hardening_guide (threat model, audit workflow and
per-platform guides).
Use
Ask your agent:
Use harden-against-cloning to audit this project.
The skill runs the static scan, then walks the agent through the checks a scan cannot do: comparing each API response
with what its screen renders, trying one user's session against another's objects, listing logic that runs on the
client, and confirming attestation and bot tokens are verified on the server. It tags every finding seen,
inferred or unknown, and writes a report from a template.
Or run the CLI yourself:
npx clonewall scan . # human-readable
npx clonewall scan .next/static # scan what actually shipped
npx clonewall scan dist/app-release.apk # read an APK, AAB, IPA, XAPK or asar in place
npx clonewall scan "release/win-unpacked" # an installed Electron app: reads app.asar and the binary's fuse wire
npx clonewall scan . --format md -o audit.md
npx clonewall scan . --platform android --min-severity medium
npx clonewall guide threat-model # also: audit-workflow, web, backend, android, ios, desktop, agents, legal
Scan build output as well as source: a shipped bundle, APK, IPA or Electron app is what the attacker starts from. Archives are read in place; nothing is extracted to disk.
CI
- run: npx -y clonewall scan . --fail-on high --format sarif -o clonewall.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: clonewall.sarif
Exit codes: 0 clean (or below --fail-on), 1 a finding at or above --fail-on, 2 a usage error.
Checks
76 checks. Evidence: seen means the problem is in the files; inferred means a pattern suggests it; unknown
means the code does not show the defence, which may still live in a gateway, WAF or another repo. Severity shown is the
default; a finding can be raised (a secret in shipped output is critical) or lowered (an explorer UI is low).
The cloning steps: 1 acquire the app · 2 unpack it · 3 recover source · 4 map the API · 5 attach at runtime · 6 capture and replay traffic · 7 pull data and reuse the backend · 8 verify the clone against you.
| ID | Platform | Severity | Evidence | Cloning step it cuts | Check |
|---|---|---|---|---|---|
| CW-WEB-001 | web | high | seen | 3. recover source | Source maps are shipped or enabled for production |
| CW-WEB-002 | web | high | inferred | 7. pull data and reuse the backend | A secret-looking variable is exposed to the browser bundle |
| CW-WEB-003 | web | medium | inferred | 4. map the API | A catch-all API proxy may forward any path to the backend |
| CW-WEB-004 | web | medium | seen | 7. pull data and reuse the backend | CORS allows any origin |
| CW-WEB-005 | web | medium | inferred | 3. recover source | Answer keys or grading data ship to the client |
| CW-WEB-006 | web | high | seen | 3. recover source | Error-tracker upload keeps source maps in the deploy |
| CW-WEB-007 | web | medium | inferred | 7. pull data and reuse the backend | A Server Action writes data with no auth check inside it |
| CW-WEB-008 | web | info | inferred | 3. recover source | Server-only modules are not guarded against client import |
| CW-WEB-009 | web | high | seen | 3. recover source | An AI provider is called, or its prompt shipped, from the client |
| CW-SEC-001 | any | high | seen | 7. pull data and reuse the backend | A credential is hard-coded in the project |
| CW-SEC-002 | any | low | inferred | 7. pull data and reuse the backend | A Google API key ships to the client |
| CW-SEC-003 | any | medium | seen | 6. capture and replay traffic | Recorded network traffic is committed or shipped |
| CW-SEC-004 | any | high | seen | 7. pull data and reuse the backend | A Dockerfile bakes a secret into the image |
| CW-API-001 | backend | medium | unknown | 7. pull data and reuse the backend | No per-user rate limiting found in the app |
| CW-API-002 | backend | low | unknown | 8. verify the clone against you | No bot challenge found on sign-up or login |
| CW-API-003 | backend | high | seen | 4. map the API | GraphQL introspection is on in production |
| CW-API-004 | backend | low | seen | 4. map the API | GraphQL leaks schema hints or has no query depth limit |
| CW-API-005 | backend | high | seen | 7. pull data and reuse the backend | A Supabase table has no row-level security |
| CW-API-006 | backend | high | seen | 7. pull data and reuse the backend | Firebase security rules let anyone read or write |
| CW-API-007 | backend | medium | inferred | 8. verify the clone against you | A bot challenge is shown but never verified on the server |
| CW-API-008 | backend | low | inferred | 7. pull data and reuse the backend | Page size comes from the request with no maximum |
| CW-API-009 | backend | medium | seen | 4. map the API | API documentation or schema is served publicly |
| CW-API-010 | backend | low | inferred | 7. pull data and reuse the backend | Rate limiting keys on IP address only |
| CW-DEP-001 | any | medium | seen | 7. pull data and reuse the backend | Docker build context can copy local env files into the image |
| CW-DEP-002 | any | high | seen | 7. pull data and reuse the backend | A local env file is not ignored by git |
| CW-DEP-003 | any | high | seen | 2. unpack it | A .git folder or env file sits in served output |
| CW-DEP-004 | any | low | seen | 1. acquire the app | Web server lists directory contents |
| CW-DEP-005 | web | info | seen | 4. map the API | robots.txt advertises internal paths |
| CW-AND-001 | android | medium | seen | 3. recover source | Release build is not minified or obfuscated |
| CW-AND-002 | android | high | seen | 5. attach at runtime | App is marked debuggable |
| CW-AND-003 | android | low | seen | 2. unpack it | App data can be extracted with adb backup |
| CW-AND-004 | android | medium | seen | 6. capture and replay traffic | Cleartext HTTP traffic is allowed |
| CW-AND-005 | android | low | unknown | 8. verify the clone against you | No app attestation (Play Integrity / App Check) found |
| CW-AND-006 | android | low | unknown | 6. capture and replay traffic | No certificate pinning found |
| CW-AND-007 | android | low | seen | 3. recover source | R8 full mode is switched off |
| CW-AND-008 | android | medium | seen | 3. recover source | App keep rules turn obfuscation off |
| CW-AND-009 | android | low | inferred | 3. recover source | A keep rule exempts the whole app from R8 |
| CW-AND-010 | android | high | seen | 6. capture and replay traffic | Release builds trust user-installed CA certificates |
| CW-AND-011 | android | low | seen | 6. capture and replay traffic | Certificate pins are overridable, expired or have no backup |
| CW-AND-012 | android | medium | seen | 5. attach at runtime | WebView debugging is enabled in release |
| CW-AND-013 | android | low | inferred | 5. attach at runtime | An exported component has no permission |
| CW-AND-014 | android | medium | inferred | 6. capture and replay traffic | Play Integrity token is not bound to the request |
| CW-AND-015 | android | high | seen | 3. recover source | R8 mapping files are shipped or committed |
| CW-IOS-001 | ios | medium | seen | 6. capture and replay traffic | App Transport Security is disabled |
| CW-IOS-002 | ios | low | seen | 5. attach at runtime | An entitlements file allows debugger attachment |
| CW-IOS-003 | ios | low | unknown | 8. verify the clone against you | No App Attest / DeviceCheck found |
| CW-IOS-004 | ios | medium | seen | 5. attach at runtime | A WebView or JSContext is inspectable in release |
| CW-IOS-005 | ios | medium | inferred | 7. pull data and reuse the backend | A secret is set in Info.plist or an xcconfig |
| CW-IOS-006 | ios | low | inferred | 2. unpack it | An auth token is stored in UserDefaults |
| CW-ATT-001 | any | low | unknown | 8. verify the clone against you | Attestation tokens are requested but never verified on a server |
| CW-ATT-002 | any | high | seen | 8. verify the clone against you | Firebase App Check debug provider can ship in release |
| CW-RN-001 | mobile | low | seen | 3. recover source | React Native ships a plain JavaScript bundle (Hermes off) |
| CW-FL-001 | mobile | medium | seen | 3. recover source | Flutter release build is not obfuscated |
| CW-FL-002 | mobile | high | seen | 3. recover source | Flutter debug symbols are shipped or committed |
| CW-FL-003 | mobile | high | inferred | 7. pull data and reuse the backend | A secret is compiled into a Flutter build with --dart-define |
| CW-CAP-001 | mobile | medium | seen | 5. attach at runtime | Capacitor config weakens the release app |
| CW-UNI-001 | mobile | medium | seen | 3. recover source | Unity game code ships as readable .NET or plain IL2CPP metadata |
| CW-ELE-001 | desktop | medium | seen | 2. unpack it | Electron app is packaged without asar |
| CW-ELE-002 | desktop | high | seen | 5. attach at runtime | Renderer has Node access or no context isolation |
| CW-ELE-003 | desktop | medium | seen | 5. attach at runtime | Electron fuses leave runtime entry points open |
| CW-ELE-004 | desktop | low | inferred | 5. attach at runtime | DevTools may open in packaged builds |
| CW-ELE-005 | desktop | medium | seen | 5. attach at runtime | A window turns off the sandbox or web security |
| CW-ELE-006 | desktop | medium | seen | 5. attach at runtime | The app opens a remote debugging port |
| CW-ELE-007 | desktop | medium | seen | 5. attach at runtime | A shipped Electron binary has unsafe fuses |
| CW-TAU-001 | desktop | medium | seen | 5. attach at runtime | Tauri app has no Content Security Policy |
| CW-TAU-002 | desktop | low | inferred | 5. attach at runtime | Tauri devtools feature is enabled for every build |
| CW-PKG-001 | desktop | medium | seen | 2. unpack it | PyInstaller bytecode "encryption" is relied on |
| CW-PKG-002 | desktop | high | seen | 7. pull data and reuse the backend | deno compile bakes an env file into the binary |
| CW-PKG-003 | any | medium | seen | 3. recover source | Native debug symbols ship with the release or are committed |
| CW-PKG-004 | desktop | low | inferred | 3. recover source | .NET app ships as decompilable IL |
| CW-PKG-005 | any | info | seen | 3. recover source | Go release build keeps local file paths |
| CW-PKG-006 | desktop | info | seen | 2. unpack it | A single-executable bundle embeds readable JavaScript |
| CW-PKG-007 | desktop | info | seen | 3. recover source | A Rust release build embeds its full dependency graph |
| CW-PKG-008 | desktop | low | seen | 3. recover source | A Windows binary embeds a PDB path in its CodeView record |
| CW-ML-001 | any | medium | seen | 1. acquire the app | A machine-learning model ships to the client |
| CW-WASM-001 | web | low | seen | 3. recover source | A shipped WebAssembly module keeps names or debug info |
Secrets are never printed: findings name the rule (for example aws.access_key_id) and the location only. Dependency folders (node_modules, Pods, vendor…), .env.example files
and test fixtures are skipped.
How a scan works
flowchart LR
input["Path<br/>folder · build output · .apk .aab .ipa .xapk .zip .asar"]
input --> ctx["Read in place<br/>walk the folder, or read the archive's index;<br/>nothing extracted, nothing sent"]
ctx --> checks["76 checks<br/>web · secrets · api · mobile · hybrid · desktop · packaging"]
checks --> find["Findings<br/>severity · evidence · cloning step · fix"]
find --> out["text · json · md · sarif<br/>or MCP JSON"]
Speed
Single-threaded, one pass over the files, no network. Measured on Linux with Node 24:
| Project | Files scanned | Time | Peak memory |
|---|---|---|---|
| clonewall itself | 53 | 0.12 s | 64 MB |
| Mobile app (React Native) | 501 | 0.19 s | 75 MB |
| API (Node backend) | 1,254 | 0.45 s | 98 MB |
| Web app (Next.js) | 3,005 | 0.64 s | 122 MB |
Files over 8 MB are skipped, and a scan stops at 60,000 files. Fast enough to run on every push.
What it cannot tell you
A static scan cannot decide whether API responses return more than each screen needs, whether the server checks ownership of every object, which client logic is worth moving server-side, whether captured traffic can be replayed, or whether canary records exist to prove a copy. Those are the findings that matter most; the skill's audit workflow covers them by hand, along with tactics aimed at the agent itself (what works, and what to reject, such as prompt-injection "context bombs") and legal levers in India, the US and the EU.
Use it on apps you own
clonewall is for auditing and hardening software you own or are authorised to assess. The skill tells agents to decline requests to attack someone else's app.
Development
npm test # node:test, no dependencies
Add a check in src/checks/<platform>.mjs with a test in test/ that builds a throwaway project showing the problem
and one showing the fix.
License
MIT
clonewallnpm install clonewall