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.
What it does
The repo holds r2ai, a native plugin, and decai, an r2js plugin.
Install
r2pm -Uci r2ai
r2pm -Uci decaiConnect
The README says baseurl should end in /v1. Put the key in OPENAI_API_KEY, or in ~/.config/r2ai/apikeys.txt.
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=64000Run r2ai -E so these load with the plugin.
radareorg/r2ai README, read November 18, 2026.
Commands
| Command | What it does |
|---|---|
r2ai -d | Decompile the current function with the model |
r2ai -dr | Decompile it plus one level of callees |
r2ai -q autoname | Suggest a better name for the function |
r2ai -q varnames | Better variable names |
r2ai -q vulns | Find vulnerabilities or bugs in the function |
r2ai -q explain | Explain the function |
r2ai -r | Chat 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.