Inspiration
Most "AI code review" tools today are thin, single-prompt LLM wrappers. They summarize diffs in vague prose, frequently hallucinate incomplete fixes (// ... rest of file), miss subtle bypass vectors like path-prefix traversal or prototype pollution, and offer zero verification that their suggested patches don't introduce syntax breaks or leave critical sinks behind.
We built AegisPR to solve that trust gap: instead of trusting an unverified LLM suggestion, AegisPR combines deterministic symbolic analysis, parallel specialist agents, a hard deterministic verification gate, and an adversarial critic self-correction loop that actively attempts to break every generated patch before emitting production CI/CD artifacts.
What It Does
AegisPR is an end-to-end autonomous Pull Request security & reliability auditing platform live at aegispr.vercel.app. Engineers can:
- Ingest Real Pull Requests: Paste any public GitHub Pull Request URL (or click verified one-click live PR chips such as
express-rate-limit #721andhono #5695) to fetch live PR metadata and changed source files via GitHub REST API (automatically prioritizing source code over docs/lockfiles/tests), paste custom code, or launch one of 4 curated vulnerable PR scenarios (including a 2-File cross-module Fintech Wallet Payout & Auth Guard PR). - Watch Real-Time Multi-Agent Execution over SSE: Stream live node transitions, parallel agent execution, loop-back self-correction events, and exact per-agent latency/token telemetry across an interactive Mission Control DAG.
- Inspect Concrete Exploit PoCs & Multi-File Verified Patches: Review CWE/OWASP-mapped security vulnerabilities alongside concurrency/reliability flaws, complete with reproducible Exploit PoCs,
git apply-ready Unified Diffs, and round-by-round verification proofs. - Export Drop-In CI/CD Artifacts: Download industry-standard SARIF v2.1.0 (ready for GitHub Code Scanning), Unified
.patchfiles, GitHub PR Review Markdown, and a ready-to-drop GitHub Actions CI/CD workflow YAML.
System Architecture (5-Stage Hybrid Closed-Loop DAG)
AegisPR is architected as a true hybrid symbolic + multi-agent system:
- Stage 1 — Deterministic Ingest & Static Pre-Scanner: Before invoking any LLM, a 13-rule deterministic static taint pre-scanner extracts high-precision CWE/OWASP danger sinks (SQL injection, dynamic
ORDER BY, unverifiedjwt.decode(), hardcoded secrets, non-constant-time secret comparisons, OS command injection, path traversal, SSRF,eval/new Function, XSS, prototype pollution, TOCTOU double-spend races, disabled TLS verification). - Stage 2 — True Parallel Specialist Fan-Out (
Promise.all): Concurrently runs two specialized agents on Google Gemini (gemini-3.5-flash-liteprimary with automatic failover togemini-3.1-flash-lite/gemini-3.5-flash/gemini-3.6-flash): Red-Team Security Agent (Exploit PoCs) and Architecture & Reliability Agent (concurrency, transactional integrity, operational resilience). - Stage 3 — Surgical Multi-File Patch Synthesizer: Synthesizes complete, production-ready remediated source files across all affected PR modules while preserving existing APIs and import paths.
- Stage 4 — Dual-Layer Verification & Autonomous Closed-Loop Self-Correction: Every candidate patch must pass both our 100% symbolic Deterministic Verification Gate (anti-truncation guard, regex-literal-aware structural syntax balance parser, effective diff check, post-patch zero-sink regression scan) and our Adversarial Critic Agent (actively attacking patches with real bypass payloads). If either fails, AegisPR automatically loops back with exact diagnostics until converging to Dual-Verified PASS.
- Stage 5 — CI/CD Artifact Exporter: Compiles SARIF v2.1.0,
git applyunified diffs, PR Review Markdown, and GitHub Actions YAML.
How We Built It & Engineering Depth
- Resilient Structured LLM Engine: Strict Zod schema validation on every agent output with automatic schema-repair retries, Gemini 3.x thinking-part filtering, exponential backoff with jitter on 429/5xx, and multi-model failover.
- Production Guardrails: IP token-bucket rate limiting with automatic expired-bucket eviction for hosted demo keys, zero-persistence BYOK (Bring Your Own Key) via request headers, and 10s
AbortSignal.timeoutguards on GitHub API fetches. - Automated Verification: 11 Vitest unit tests (including Round 1 FAIL -> Round 2 PASS closed-loop convergence) enforced by green GitHub Actions CI.
Challenges We Ran Into
- Eliminating Static Gate False Positives: Live end-to-end testing uncovered real edge cases—allowlisted
ORDER BYtemplate literals, math expression tokenizers checkingtoken === "(", JS regex literals containing quotes/parens (/[&<>"']/g), safe DOM clearing (container.innerHTML = ""), and non-SQL English prose templates. Writing targeted regression tests turned the deterministic gate into a high-precision verifier. - Gemini 3.x Structured Output Reliability: Filtering thinking parts and adding automatic Zod schema-repair retries ensured reliable structured JSON across concurrent agent calls.
- Serverless Streaming on Large GitHub PRs: Prioritizing executable source files over docs/lockfiles/tests cut live GitHub PR token usage by >70% and kept full audits within 11-15s on Vercel.
Accomplishments That We're Proud Of
- 100% Dual-Verified PASS Across All Scenarios: Every curated scenario (including the 2-File Fintech Wallet PR and live autonomous Round 1 -> Round 2 self-correction) and live public GitHub PR ingestion (
express-rate-limit #721) achieved Dual-Verified PASS (8 -> 95 / 100score) in 11-15 seconds on live Vercel production. - Production-Ready Engineering: Clean modular TypeScript, real-time SSE telemetry, 11/11 passing unit tests, and green GitHub Actions CI.
What's Next for AegisPR
- Native GitHub App webhook integration posting inline review comments and co-authored verified patch commits.
- Sandboxed Docker/WebAssembly PoC execution to run exploit payloads and unit tests against ephemeral PR environments.
- Expanded AST-based static taint rules for Python, Go, and Rust microservices.
Third-Party Disclosures (Zyrelyx Hackathon Compliance)
All core application code, multi-agent orchestration logic, deterministic static taint rules, regex-aware syntax verifier, prompts, SARIF/patch exporters, unit tests, and UI components were written originally during the Dec 1 – Dec 7, 2026 sprint window. Third-party packages & APIs used: Next.js 15, React 19, TypeScript 5, Tailwind CSS 3, Lucide React, Zod, diff (jsdiff), Vitest, Google Gemini API (gemini-3.5-flash-lite / gemini-3.1-flash-lite), GitHub REST API, Vercel.
Built With
- github-api
- google-gemini
- next.js
- react
- sarif
- tailwindcss
- typescript
- vercel
- vitest
- zod