How can we create a (mostly) safe environment for running LLM-based code review? Amidst the hype around AI, security concerns may easily be forgotten. The aim of this POC project was to build a secure context in which LLMs can be used for code reviews. The goal was to be able to review untrusted but proprietary code. The main concerns were: Prompt injection and data or code exfiltration.
The result was a pull request review orchestrator with a small Express/SQLite control UI. For each review it creates an isolated Docker setup with separate containers for code review, infrastructure access via MCP and limited web access via proxy.
This project focuses on the execution boundary around automated code review. Each pull request is processed inside a short-lived Docker Compose setup with clearly separated responsibilities and restricted network paths.
| Container | Responsibility | Can access |
|---|---|---|
| Review | Runs the review prompt and analyzes the checked-out PR changes | Local repo copy, MCP provider, proxy |
| MCP | Provides limited (whitelisted) infrastructure operations such as reading existing review comments and posting findings | Selected infrastructure endpoints |
| Proxy | Controls review containers internet access via explicit whitelists | Whitelisted external hosts |