Model or dataset
radareorg/r2ai avatar
radareorg/r2ai

r2ai ships two plugins, three config files and a Makefile nobody documents

LLM-based reversing for radare2

542 stars72 forksCMIT

At a glance

What is it?
The LLM layer for radare2, written in C, with a decompilation-focused sibling plugin and nine canned prompts. The README documents one installation route and points you to three other projects for the cases it does not cover.
Who is it for?
Reach for r2ai if you already live in the radare2 shell and want the model available without leaving it, since the plugin is scriptable over r2pipe and the nine named prompts are a usable starting vocabulary rather than a blank prompt box. Read the configuration section before your first run, because keys, per-scope settings and saved startup commands live in three separate files and the README does not say which one wins.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 9 days ago.
What is it written in?
Mainly C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • radareorg/r2ai542 ★ · +66
Star history
Repository2026-09-112026-11-15
radareorg/r2ai476542

66 Stars in the last 65 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Two plugins share one repository, and one is the namesake

The repository holds two radare2 plugins rather than one. r2ai is the native AI plugin, written in C as the primary language of the project, and it is the one the name refers to. decai is a separate r2js plugin whose stated specialism is decompilation. Both install through the same package manager, so the choice is which one you want rather than how you get it:

console
$ r2pm -Uci r2ai
$ r2pm -Uci decai

The README then spends as much space telling you when not to use this repository as telling you what it does. For radare2 driven by other agents over MCP it points at r2mcp as the official option and at r2copilot for CTF work. For a radare2 focused autonomous agent it points at r2agent. Three adjacent projects are named with links, which is honest scoping, and also an admission that the plugin covers a narrower case than the surrounding market.

Nine named prompts are the actual user interface

The plugin's default vocabulary is a fixed list of short commands, shown by running r2ai -q inside the shell:

console
[0x00000000]> r2ai -q
explain: Explain the current function -
devices: Find and explain devices used -
libs: Group imports by Libraries -
varnames: Better variable names -
autoname: Automatically suggest a better name for this function -
vulns: Find vulnerabilities or bugs in the current function -
signature: Suggest an improved function signature -
dlopen: List libraries loaded with dlopen - Some libraries are loaded
decompile: Augmented decompilation based on LLM -
[0x00000000]>

Most are one-line rephrasings of a reverse engineering task, and two of them, autoname and varnames, are the same idea at different scopes. The header calls these user defined prompts, which is the extension point: roles and prompt text are both configurable, so the list is a starting set rather than a fixed command set.

Configuration is split across three files with no stated precedence

One plugin, three places to configure it. Keys can go into environment variables, and the example shows ANTHROPIC_API_KEY and OPENAI_API_KEY exported in a shell. They can also live in a plaintext keys file at ~/.config/r2ai/apikeys.txt, which you open for editing with r2ai -K. Everything else goes into the operating system's radare2 settings file, ~/.radare2rc on Linux, opened with r2ai -E and then filled with individual setting lines:

console
r2ai -e api=anthropic
r2ai -e model=claude-3-7-sonnet-20250219
r2ai -e max_tokens=64000

That worked example sets a provider, a specific dated model identifier and an output ceiling of 64000 tokens. What the documentation does not say is what happens when the same key or the same setting is present in more than one of the three locations, so treat first-wins or last-wins as unknown until you check it yourself.

The Makefile only forwards, and the README never mentions it

There is a Makefile at the root of a C project and the README does not reference it, autogen.sh, or the VERSION file that sits beside them. What the Makefile contains is a single list of targets and one forwarding recipe:

make
TARGETS=all clean mrproper user-install install user-uninstall uninstall fmt indent

$(TARGETS):
	$(MAKE) -C src $@

Every named target, including install and uninstall in both user and system flavours, does nothing but re-invoke make in the src directory. A separate test target depends on all and then recurses into a test directory of its own. The list also carries fmt and indent, two names for what is presumably one formatting job. None of this is wrong, but it means a from-source build is available and undescribed, while the documented route is the r2pm line and nothing else.

The release numbering skips 1.4.1 and 1.4.3

The published tags are 1.4.0 on June 3, 1.4.2 on August 16 and 1.4.4 on September 6. Neither 1.4.1 nor 1.4.3 appears, so the minor counter advances by two between each of the three most recent releases. That is not unusual on its own, since intermediate tags are often withheld or renamed, but it does mean version numbers cannot be assumed consecutive when you are pinning something against this project. The cadence is also uneven, about two and a half months between the first two and three weeks between the last two. The last push to the default branch, master, is dated September 6, 2026, the same day as the 1.4.4 tag.

Three modes sit behind the same command

Beyond the canned prompts the feature list names three distinct capabilities that change what happens when you invoke the plugin. One is retrieval: markdown, code or text files can be indexed through the project's own vector database, and the output of an r2 command can be embedded so you can ask questions about that data. One is autonomy: an automatic mode described as ReAct solves tasks using function calling rather than waiting for a typed prompt. One is connectivity, since local and remote models are both supported, with ollama named alongside openai, grok and anthropic. Scripting is the fourth thread, with r2pipe exposing the r2ai command for batch work. The practical consequence is that the nine prompt names are the least interesting part of the surface.

An Attic and an openapiproxy directory sit unmentioned at the root

The root listing carries more than the two plugins need. There is an Attic directory, which is the convention for retired code kept for reference, an openapiproxy directory whose name implies a proxy for an OpenAPI-shaped interface, and a dist directory, alongside the expected src, decai, test, doc and prompts trees plus a r2plugin directory. Not one of Attic, openapiproxy, dist or r2plugin appears anywhere in the README. The component section names only two plugins and links to their own README files under src and decai. So the presence of an API proxy in this project is documented by its folder name and nothing else, and if you were looking for an HTTP surface on r2ai you would have to read the directory yourself to find out whether one exists.

Editorial conclusion

Reach for r2ai if you already live in the radare2 shell and want the model available without leaving it, since the plugin is scriptable over r2pipe and the nine named prompts are a usable starting vocabulary rather than a blank prompt box. Read the configuration section before your first run, because keys, per-scope settings and saved startup commands live in three separate files and the README does not say which one wins. Pick decai instead if decompilation output is the thing you actually want improved. And ignore the Makefile unless you are building from source, since installation is documented entirely through r2pm and the C build path in this repository is never described.

Frequently asked questions

How do I install the r2ai plugin for radare2?

Through r2pm, which the README names as the recommended route for both components: r2pm -Uci r2ai for the AI plugin and r2pm -Uci decai for the decompilation-focused one. The repository also ships a Makefile and autogen.sh, but neither appears in the README.

What is decai and how does it differ from r2ai?

Both are radare2 plugins in this repository and both install with r2pm. r2ai is the native AI plugin written in C, while decai is an r2js plugin whose stated special focus is decompilation.

Where do I put my API key for r2ai?

In environment variables such as ANTHROPIC_API_KEY or OPENAI_API_KEY, or in the plaintext keys file at ~/.config/r2ai/apikeys.txt, which you open for editing with r2ai -K. Provider and model settings instead go into the radare2 settings file through r2ai -E.

Which prompts does r2ai ship with?

Nine, listed by r2ai -q: explain, devices, libs, varnames, autoname, vulns, signature, dlopen and decompile. They are described as user defined prompts, so the text of each one is configurable rather than fixed.

What should I use instead of r2ai to drive radare2 over MCP?

The README names r2mcp as the official radare2 MCP, and r2copilot for CTF work. For a radare2 focused autonomous agent rather than an MCP server, it points at a separate project called r2agent.

Official sources

  1. License: MIT
  2. Project website
  3. radareorg/r2ai on GitHub
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/radareorg-r2ai.svg)](https://hysenlabs.com/projects/radareorg-r2ai)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/radareorg-r2ai.svg)](https://hysenlabs.com/projects/radareorg-r2ai)

Was this useful?