Casestudy: Secure AI Codereview Pipeline

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.

Timeframe: 2026
 at Protos

Casestudy: Secure AI Codereview Pipeline

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.

Pipeline overview

Container data flow for the AI code review pipeline

Security Concept

Rules:

Rule enforcement via container isolation:

Container Roles And Access

ContainerResponsibilityCan access
ReviewRuns the review prompt and analyzes the checked-out PR changesLocal repo copy, MCP provider, proxy
MCPProvides limited (whitelisted) infrastructure operations such as reading existing review comments and posting findingsSelected infrastructure endpoints
ProxyControls review containers internet access via explicit whitelistsWhitelisted external hosts