Updated November 18, 2026
Glossary ToolsBest models

radare2 · plugin

r2ai, the radare2 AI plugin, with an abliterated model

r2ai is radare2's AI plugin. It decompiles with an LLM, calls r2 commands, and takes an OpenAI-compatible base URL.

By AI for Reverse EngineeringUpdated November 18, 2026
On this page

What it does

The repo holds r2ai, a native plugin, and decai, an r2js plugin.

Install

terminalshell
r2pm -Uci r2ai
r2pm -Uci decai

Connect

The README says baseurl should end in /v1. Put the key in OPENAI_API_KEY, or in ~/.config/r2ai/apikeys.txt.

terminalshell
export OPENAI_API_KEY="$SILK_API_KEY"
r2 ./target
[0x00001100]> r2ai -e api=openai
[0x00001100]> r2ai -e baseurl=https://api.silkcompute.com/v1
[0x00001100]> r2ai -e model=kimi-k3.1-pro-uncensored
[0x00001100]> r2ai -e max_tokens=64000

Run r2ai -E so these load with the plugin.

radareorg/r2ai README, read November 18, 2026.

Commands

CommandWhat it does
r2ai -dDecompile the current function with the model
r2ai -drDecompile it plus one level of callees
r2ai -q autonameSuggest a better name for the function
r2ai -q varnamesBetter variable names
r2ai -q vulnsFind vulnerabilities or bugs in the function
r2ai -q explainExplain the function
r2ai -rChat in a REPL

Run aa, then s main and r2ai -d. Set r2ai -e lang=C for the output language.

Auto mode

r2ai -a lets the model call r2 commands and asks first. The README calls r2ai.auto.yolo, which skips that approval, dangerous, and says to leave it false.

A study

A 2025 study of Linux and IoT malware analyzed with r2ai found quality "overall equal or better than without AI assistance", with a gain in speed even after catching mistakes. It also found that "the AI cannot operate alone and must constantly be guided by an experienced analyst." The study used Claude 3.5 and 3.7 Sonnet.

MCP

The README points to r2mcp, the official radare2 MCP and to r2copilot for CTFs. Model settings are on the MCP setup page.