Repolode
radareorg

radareorg/r2ai

LLM-powered plugin for radare2 that adds an r2ai command for AI-assisted reverse engineering, with a decai decompilation plugin.

Stars
532
Forks
69
Open issues
4
Last commit
19 hours ago

What is it?

r2ai is a set of radare2 plugins that bring large language models into binary analysis. It adds an r2ai command to the radare2 shell, which can be used interactively in a REPL, in batch mode, or from scripts through r2pipe. Users can run local or remote models from providers such as Ollama, OpenAI, Anthropic and Grok, and customize roles and prompts.

The package also includes decai, an r2js-based plugin focused on LLM-augmented decompilation. Other features include an automatic ReAct mode that uses function calling to work through tasks, retrieval over markdown, code or text files with a built-in vector database, and the ability to embed radare2 command output so the model can answer questions about it. Built-in prompts cover tasks such as explaining functions, suggesting variable names and function signatures, and searching for vulnerabilities.

The project is written in C and distributed under the MIT license. It is installed through r2pm, and API keys can be supplied through environment variables or a configuration file.

Key features

  • 01Adds an r2ai command to the radare2 shell with REPL and batch modes.
  • 02Works with local and remote models from Ollama, OpenAI, Anthropic, Grok and others.
  • 03Includes decai, a plugin for LLM-augmented decompilation.
  • 04Supports an automatic ReAct mode that uses function calling.
  • 05Provides retrieval over local files through a built-in vector database.
  • 06Lets users define custom roles and prompts for common analysis tasks.

Use cases

  • Explaining unknown functions or variables while reversing a binary in radare2.
  • Drafting better names and function signatures for stripped code.
  • Scripting LLM-assisted analysis through r2pipe.
  • Analyzing malware samples with model help during triage.

Quick start

  1. 1

    Install the r2ai plugin with r2pm

    r2pm -Uci r2ai
  2. 2

    Set an API key in your environment (e.g. OpenAI or Anthropic)

    export OPENAI_API_KEY=<your-key>
  3. 3

    Launch radare2 with the r2ai command available

    r2 -qc r2ai

Things to know

  • Requires radare2 and an LLM provider, which may need a paid API key or a local model setup.

In collections

Topics

FAQ

What is r2ai?
LLM-powered plugin for radare2 that adds an r2ai command for AI-assisted reverse engineering, with a decai decompilation plugin. r2ai is a set of radare2 plugins that bring large language models into binary analysis. It adds an r2ai command to the radare2 shell, which can be used interactively in a REPL, in batch mode, or from scripts through r2pipe. Users can run local or remote models from providers such as Ollama, OpenAI, Anthropic and Grok, and customize roles and prompts.
Is r2ai free to use? What license does it have?
r2ai is open source under the MIT license. Check the license terms before using it in commercial products.
Is r2ai still maintained?
Actively maintained. The last commit to r2ai was on Nov 6, 2026.
What can I use r2ai for?
Explaining unknown functions or variables while reversing a binary in radare2. Drafting better names and function signatures for stripped code. Scripting LLM-assisted analysis through r2pipe. Analyzing malware samples with model help during triage.
How do I install r2ai?
Install the r2ai plugin with r2pm: r2pm -Uci r2ai Set an API key in your environment (e.g. OpenAI or Anthropic): export OPENAI_API_KEY=<your-key> Launch radare2 with the r2ai command available: r2 -qc r2ai
Where can I get r2ai?
The source code and installation instructions are on GitHub: https://github.com/radareorg/r2ai

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects