doc/labs/2026-10-12-lab00 + R8-A 附录。REA Setup Guide — run your first evidence-backed case
6 steps~30 mindifficulty: beginner-friendly
REA setup step 1: install the agent
REA setup starts with the package: REA ships as the rea-agents npm package. Node 20+ is required. Install it in a scratch directory so nothing pollutes your projects:
bash — lab@realearn verified: ran 2026-10-12
$ npm install rea-agents@latest $ npx rea --version rea@6.4.0 — Reverse engineer anything from your terminal or agent. 35 deps · 0 vulnerabilities · bin: rea / rea-agents
Wondering where this package actually comes from? See what's inside the REA GitHub repo — the directory tour, the release cadence, and why we pin the version we pin.
REA setup step 2: run rea doctor first
Before anything else in REA setup, run the built-in environment diagnosis. It checks Node, your host OS, and every analysis engine. Our lab host (opencloudos) is not on the supported list — and doctor tells you exactly that, with the remediation. This is your first real REA setup lesson in REA's design: it fails loudly and precisely, never silently.
bash — lab@realearn verified: ran 2026-10-12
$ npx rea doctor healthy: false - node: ok (22.22.0) - host: UNSUPPORTED — opencloudos 9.4 remediation: "REA supports macOS 12+, Ubuntu 24.04+, Fedora 41+, Nobara 44+, 64-bit Arch Linux, CachyOS, Omarchy, and the experimental Windows x64 Ghidra P0 boundary." - hopper: missing_analysis_engine (/opt/hopper/bin/Hopper 不存在) - ghidra: missing_analysis_engine (GHIDRA_INSTALL_DIR 未设) - ida-registration: not_configured
A REA setup note: rea capabilities lists 18 operations with declared side effects and limitations — the "evidence contract / fail-closed" design REA is known for, confirmed present in this version.
What rea doctor actually checks
- node: runtime version and compatibility shim status
- host: OS support matrix (macOS 12+, Ubuntu 24.04+, Fedora 41+, Arch-family, experimental Windows)
- engines: Ghidra (GHIDRA_INSTALL_DIR), Hopper (binary path), IDA (registration)
Every failing check comes with a remediation string — treat doctor output as your REA setup checklist.
REA setup step 3: wire REA to your AI agent (MCP)
REA setup step three is MCP: REA speaks the Model Context Protocol. One REA setup command registers the rea MCP server in your agent's config (with an automatic backup) and installs a companion skill:
bash — lab@realearn verified: ran 2026-10-12
$ npx rea setup -y --client hermes appliedActions[2]: configured_hermes, installed_skill - configure_client:hermes → config.yaml (自动备份 .rea.backup) - install_skill:hermes → skills/reverse-engineer-anything
Config written (verified on disk):
config.yaml verified: ran 2026-10-12
mcp_servers:
rea:
command: npx
args: [-y, rea-agents@6.4.0, mcp]
enabled: true
REA_MCP_MAX_RESPONSE_BYTES caps the size of a single MCP bridge response — when a tool result exceeds the ceiling, REA refuses to flood your agent's context with one oversized payload and directs you to the evidence bundle instead. The default is deliberately conservative; raise it only if you routinely inspect large targets and your agent client can handle the payload. It became an explicit, documented variable in the 6.7.x line (#6005), and the bridge request ceiling itself was made configurable in #6376 — both changes land in the run-up to 6.8. [official docs — we have not yet stress-tested the truncation path in our lab; verified numbers will follow the 6.8 evidence rerun.]We confirmed the link end-to-end with a stdio JSON-RPC probe: initialize returned serverInfo {name: "rea", version: "6.4.0"} and tools/list enumerated 170 MCP tools (annotate_native_function, inspect_native_load_image, batch_decompile, analyze_function, inspect_binary_layout…). The agent-to-engine chain is live.
REA setup step 4: light up a zero-cost engine (pwntools-elf)
Deep analysis (analyze/decompile) needs Ghidra, Hopper, or IDA — but REA also ships a pure-Python ELF provider: pwntools-elf. "REA never installs Python or packages"; you point it at a venv that already has the three pinned libraries. This is the free path, and it is fully usable for first lessons:
bash — lab@realearn verified: ran 2026-10-12
$ python3 -m venv lab-env/.rea-python $ .rea-python/bin/pip install pwntools==4.15.0 pyelftools==0.33 unicorn==2.1.2 $ export REA_PWNTOOLS_PYTHON=lab-env/.rea-python/bin/python
REA setup step 5: run your first evidence-backed analysis
Now point it at a target you are allowed to inspect (here: a hello-world ELF we compiled ourselves, see lesson 2):
bash — lab@realearn verified: ran 2026-10-12
$ npx rea inspect-binary-layout lab-env/hello evidence_id: ev_6e479c83fba06374c38ab8f9fa3876e561d28d3515aa68473598e9f94dcb556c subject: hello / sha256 36cdabb6…4207352 / elf / x86_64 provider: pwntools-elf @ pwntools 4.15.0;pyelftools 0.33;unicorn 2.1.2 normalized_result: 31 sections, entry_point 0x400320 (与 lab 01 手工 readelf 结果一致 —— 可交叉验证)
That output is the evidence contract in action: a content-addressed evidence ID, the exact bytes analyzed (sha256), the provider and its three library versions, and a normalized result you can cross-check against manual binutils output — ours matched exactly.
The evidence lifecycle closes through MCP: session-retained evidence exports as a bundle, then exports to canonical form:
mcp — evidence bundle verified: ran 2026-10-12
$ inspect_binary_layout(hello) → ev_6e479c83… (会话保留) get_evidence_bundle(detail:summary) → total_retained_records: 1 export_evidence_bundle → hello-bundle.json (39113 bytes, records:1, unknowns:0) rea evidence-export hello-bundle.json hello-canonical.json → 校验通过 ✓
evidence-export is rejected with evidence_integrity_mismatch — you must export the MCP session bundle first. The error message includes the remediation; read it.REA setup step 6: know the two tiers (honest REA setup boundaries)
What works and what does not with only the free engine — verified by running both:
bash — lab@realearn verified: ran 2026-10-12
$ npx rea analyze ./hello error: Analysis failed · code: provider_unavailable candidate_ids[3]: ghidra,hopper,ida rejections[3]: ghidra(not_configured) / hopper(executable_missing) / ida(not_configured)
- Tier 1 — free (pwntools-elf):
inspect-binary_layoutand the ELF-layout family, plus the full evidence lifecycle. This covers everything in our beginners track and worked on a 4.5MB system library too (30 sections / 11 segments via--format json; the MCP channel reportsresource_constrainton very large results and points you to the evidence bundle instead of truncating). - Tier 2 — decompile/analyze: requires Ghidra, Hopper, or IDA. Forcing the free provider explicitly fails with
capability_unavailable: "The requested analysis provider is unknown. Choose one of: ghidra, hopper, ida."
REA is an orchestration layer, not a decompiler — and it will tell you so, with a per-candidate rejection list, every single time. That honesty is exactly why its output is auditable.
Free tier vs decompile tier at a glance
- Free (pwntools-elf): inspect-binary-layout, ELF family, full evidence lifecycle
- Decompile (Ghidra/Hopper/IDA): analyze, batch-decompile, function-level work
REA setup FAQ — every remaining REA setup question, answered
Beyond analysis: if you record web traffic, AgentEnv turns a capture into a connectable MCP server (inspection chain verified on 6.7.0; serving needs a source checkout today).
How long does REA setup take?
A full REA setup — install, doctor, MCP wiring, first engine, first verified case — takes 30-45 minutes of REA setup on a supported host. On unsupported hosts add the engine workaround from this guide.
What does REA setup require?
Node 20+ and npm. The REA setup itself is one npm install (rea-agents); engines and MCP wiring are the steps that need care, and rea doctor checks all of them.
Is REA setup free?
Yes. The REA setup in this guide uses the zero-cost pwntools-elf engine. No paid license is needed for any step of this REA setup path.
What is rea doctor in REA setup?
rea doctor is the built-in diagnosis step of REA setup: it verifies Node, OS support, and every engine, and fails loudly with remediation hints when something is missing.
How do I wire REA to my agent after REA setup?
After the base REA setup, register REA as an MCP server for your agent. The exact wiring differs per client; this guide shows the lab-verified configuration.
Why does my REA setup reject decompile?
Fail-closed design: if no decompiler engine is available, REA setup leaves decompile refusing with a precise diagnosis instead of guessing. See the boundary lesson.
Can I redo REA setup in a clean directory?
Yes — the recommended REA setup practice is a scratch directory per machine, so the REA setup never pollutes project node_modules.
Where do REA setup evidence files go after REA setup finishes?
Every analysis after REA setup emits a REA setup evidence bundle: evidence IDs, target sha256, provider versions — auditable after the fact.