Repository avatar
AI Tools
v0.1.0
active

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 asWhat you getInstall
CLIScan a folder or a shipped artefact and get text, JSON, Markdown or SARIFnpx clonewall scan .
CI stepFail the build on high findings and show them in GitHub code scanningCI
MCP serverTools scan_project, list_checks and hardening_guide for any agentMCP server only
Agent skillA full audit: the scan, plus the checks a scan cannot do, written up as a reportnpx clonewall setup
Claude Code pluginThe skill and MCP server together, from this repositoryClaude Code plugin
Libraryimport { scan } from 'clonewall' returns the findings as an objectnpm 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:

  1. 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.
  2. 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.
  3. 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.

IDPlatformSeverityEvidenceCloning step it cutsCheck
CW-WEB-001webhighseen3. recover sourceSource maps are shipped or enabled for production
CW-WEB-002webhighinferred7. pull data and reuse the backendA secret-looking variable is exposed to the browser bundle
CW-WEB-003webmediuminferred4. map the APIA catch-all API proxy may forward any path to the backend
CW-WEB-004webmediumseen7. pull data and reuse the backendCORS allows any origin
CW-WEB-005webmediuminferred3. recover sourceAnswer keys or grading data ship to the client
CW-WEB-006webhighseen3. recover sourceError-tracker upload keeps source maps in the deploy
CW-WEB-007webmediuminferred7. pull data and reuse the backendA Server Action writes data with no auth check inside it
CW-WEB-008webinfoinferred3. recover sourceServer-only modules are not guarded against client import
CW-WEB-009webhighseen3. recover sourceAn AI provider is called, or its prompt shipped, from the client
CW-SEC-001anyhighseen7. pull data and reuse the backendA credential is hard-coded in the project
CW-SEC-002anylowinferred7. pull data and reuse the backendA Google API key ships to the client
CW-SEC-003anymediumseen6. capture and replay trafficRecorded network traffic is committed or shipped
CW-SEC-004anyhighseen7. pull data and reuse the backendA Dockerfile bakes a secret into the image
CW-API-001backendmediumunknown7. pull data and reuse the backendNo per-user rate limiting found in the app
CW-API-002backendlowunknown8. verify the clone against youNo bot challenge found on sign-up or login
CW-API-003backendhighseen4. map the APIGraphQL introspection is on in production
CW-API-004backendlowseen4. map the APIGraphQL leaks schema hints or has no query depth limit
CW-API-005backendhighseen7. pull data and reuse the backendA Supabase table has no row-level security
CW-API-006backendhighseen7. pull data and reuse the backendFirebase security rules let anyone read or write
CW-API-007backendmediuminferred8. verify the clone against youA bot challenge is shown but never verified on the server
CW-API-008backendlowinferred7. pull data and reuse the backendPage size comes from the request with no maximum
CW-API-009backendmediumseen4. map the APIAPI documentation or schema is served publicly
CW-API-010backendlowinferred7. pull data and reuse the backendRate limiting keys on IP address only
CW-DEP-001anymediumseen7. pull data and reuse the backendDocker build context can copy local env files into the image
CW-DEP-002anyhighseen7. pull data and reuse the backendA local env file is not ignored by git
CW-DEP-003anyhighseen2. unpack itA .git folder or env file sits in served output
CW-DEP-004anylowseen1. acquire the appWeb server lists directory contents
CW-DEP-005webinfoseen4. map the APIrobots.txt advertises internal paths
CW-AND-001androidmediumseen3. recover sourceRelease build is not minified or obfuscated
CW-AND-002androidhighseen5. attach at runtimeApp is marked debuggable
CW-AND-003androidlowseen2. unpack itApp data can be extracted with adb backup
CW-AND-004androidmediumseen6. capture and replay trafficCleartext HTTP traffic is allowed
CW-AND-005androidlowunknown8. verify the clone against youNo app attestation (Play Integrity / App Check) found
CW-AND-006androidlowunknown6. capture and replay trafficNo certificate pinning found
CW-AND-007androidlowseen3. recover sourceR8 full mode is switched off
CW-AND-008androidmediumseen3. recover sourceApp keep rules turn obfuscation off
CW-AND-009androidlowinferred3. recover sourceA keep rule exempts the whole app from R8
CW-AND-010androidhighseen6. capture and replay trafficRelease builds trust user-installed CA certificates
CW-AND-011androidlowseen6. capture and replay trafficCertificate pins are overridable, expired or have no backup
CW-AND-012androidmediumseen5. attach at runtimeWebView debugging is enabled in release
CW-AND-013androidlowinferred5. attach at runtimeAn exported component has no permission
CW-AND-014androidmediuminferred6. capture and replay trafficPlay Integrity token is not bound to the request
CW-AND-015androidhighseen3. recover sourceR8 mapping files are shipped or committed
CW-IOS-001iosmediumseen6. capture and replay trafficApp Transport Security is disabled
CW-IOS-002ioslowseen5. attach at runtimeAn entitlements file allows debugger attachment
CW-IOS-003ioslowunknown8. verify the clone against youNo App Attest / DeviceCheck found
CW-IOS-004iosmediumseen5. attach at runtimeA WebView or JSContext is inspectable in release
CW-IOS-005iosmediuminferred7. pull data and reuse the backendA secret is set in Info.plist or an xcconfig
CW-IOS-006ioslowinferred2. unpack itAn auth token is stored in UserDefaults
CW-ATT-001anylowunknown8. verify the clone against youAttestation tokens are requested but never verified on a server
CW-ATT-002anyhighseen8. verify the clone against youFirebase App Check debug provider can ship in release
CW-RN-001mobilelowseen3. recover sourceReact Native ships a plain JavaScript bundle (Hermes off)
CW-FL-001mobilemediumseen3. recover sourceFlutter release build is not obfuscated
CW-FL-002mobilehighseen3. recover sourceFlutter debug symbols are shipped or committed
CW-FL-003mobilehighinferred7. pull data and reuse the backendA secret is compiled into a Flutter build with --dart-define
CW-CAP-001mobilemediumseen5. attach at runtimeCapacitor config weakens the release app
CW-UNI-001mobilemediumseen3. recover sourceUnity game code ships as readable .NET or plain IL2CPP metadata
CW-ELE-001desktopmediumseen2. unpack itElectron app is packaged without asar
CW-ELE-002desktophighseen5. attach at runtimeRenderer has Node access or no context isolation
CW-ELE-003desktopmediumseen5. attach at runtimeElectron fuses leave runtime entry points open
CW-ELE-004desktoplowinferred5. attach at runtimeDevTools may open in packaged builds
CW-ELE-005desktopmediumseen5. attach at runtimeA window turns off the sandbox or web security
CW-ELE-006desktopmediumseen5. attach at runtimeThe app opens a remote debugging port
CW-ELE-007desktopmediumseen5. attach at runtimeA shipped Electron binary has unsafe fuses
CW-TAU-001desktopmediumseen5. attach at runtimeTauri app has no Content Security Policy
CW-TAU-002desktoplowinferred5. attach at runtimeTauri devtools feature is enabled for every build
CW-PKG-001desktopmediumseen2. unpack itPyInstaller bytecode "encryption" is relied on
CW-PKG-002desktophighseen7. pull data and reuse the backenddeno compile bakes an env file into the binary
CW-PKG-003anymediumseen3. recover sourceNative debug symbols ship with the release or are committed
CW-PKG-004desktoplowinferred3. recover source.NET app ships as decompilable IL
CW-PKG-005anyinfoseen3. recover sourceGo release build keeps local file paths
CW-PKG-006desktopinfoseen2. unpack itA single-executable bundle embeds readable JavaScript
CW-PKG-007desktopinfoseen3. recover sourceA Rust release build embeds its full dependency graph
CW-PKG-008desktoplowseen3. recover sourceA Windows binary embeds a PDB path in its CodeView record
CW-ML-001anymediumseen1. acquire the appA machine-learning model ships to the client
CW-WASM-001weblowseen3. recover sourceA 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:

ProjectFiles scannedTimePeak memory
clonewall itself530.12 s64 MB
Mobile app (React Native)5010.19 s75 MB
API (Node backend)1,2540.45 s98 MB
Web app (Next.js)3,0050.64 s122 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

NPM
clonewall
Install Command
npm install clonewall
Runtime: npx