IR-Sentinel: LLVM-IR Security Analysis via MCP
Language models are good at recognizing patterns in code and bad at knowing what the compiler actually did with it. IR-Sentinel is a proof of concept that closes that gap by handing the model the compiler.
It is a Model Context Protocol (MCP) server, built on FastMCP, that exposes a local LLVM toolchain — clang and opt — as tools an AI agent can call. The agent pipeline then:
- Compiles C++ source to LLVM IR,
- Extracts control flow graph metrics from it,
- Iteratively queries Gemini against that structured view to identify use-after-free vulnerability patterns.
The interesting part is that the model reasons over the IR and the CFG rather than over surface syntax, so it sees the program the way the optimizer does.
Built with Python, LLVM, Gemini, and FastMCP.