AegisCode
NewMCP server for Claude Code, Cursor and Codex

Security checks for code your AI wrote.

Coding agents ship fast and repeat the same mistakes: SQL built from strings, request data in shell commands, imports of packages that don't exist. AegisCode traces untrusted input across your files, checks every package against the real registry, and writes fixes it re-verifies before you see them.

Try
Engine v2 · … rulesSwarm …GitHub · anonymous (60 req/h)
100% / 100%
precision / recall on 87 labelled cases
126
rules across 56 CWEs
12
languages
0
API keys needed for the core checks

Benchmark is hand-written; the first run on unseen cases scored 94.1% / 88.9%. Details

Where it runs

Catch it where the code is written, not after it ships.

Inside your coding agent

An MCP server the agent calls on its own changes before committing. It gets back each issue, the data-flow path and a verified fix it can apply.

$ claude mcp add aegiscode -- node ~/aegiscode/bin/aegis.mjs mcp

Before every commit

A pre-commit hook that scans only what's staged and blocks only issues the commit introduces, so years of existing debt never get in the way.

$ node bin/aegis.mjs hook install

In CI and right here

SARIF for GitHub Code Scanning, a --fail-on gate, Markdown for PR descriptions, and this web app for pasting a file or a whole repository.

$ aegis scan . --sarif aegis.sarif --fail-on high
Setup for Claude Code, Cursor, Codex and CI
How it works

Deterministic first. AI second. Evidence always.

Models are good at judgement and bad at bookkeeping. So the bookkeeping (which value came from where, what a fix changes) is done by an analyser, and a model is only asked to weigh in on evidence that can be checked.

  1. 01

    Read the change

    A file, a repo, your staged changes or everything since main. Local modules the change imports are pulled in for context.

  2. 02

    Trace across files

    Taint analysis on the TypeScript compiler AST follows untrusted input through helpers, imports and re-exports, and knows when a check makes it safe.

  3. 03

    Check every package

    Each import is looked up on npm or PyPI: names that don't exist, lookalikes of popular packages, brand-new releases, install scripts.

  4. 04

    Fix and re-verify

    Common issues get a written fix. It only counts as verified if a re-scan shows the issue gone and nothing new.

  5. 05

    Optional AI review

    With a Gemini key, a Critic, Defender and Judge argue over the evidence. Claims that quote code that isn't there are thrown out.

Follows data across files

A route in one file passes request data to a helper in another, which builds SQL. AegisCode reports it at the real sink with every hop, and stays quiet when an allowlist or validation check is in the way.

  1. Sroutes/orders.ts:4
    HTTP request input
    req.query.customer
  2. ↓routes/orders.ts:4
    passed to findOrders()
    findOrders(req.query.customer)
  3. ↓db/orders.ts:3
    concatenated into string
    "… WHERE customer = '" + id + "'"
  4. !db/orders.ts:3
    reaches SQL injection sink
    pool.query(…)

Packages AI made up

Assistants invent plausible package names; attackers register them. Every import is checked against the live npm / PyPI registry.

✕ pdf-invoice-parser-pro · not on npm
✕ lodahs · looks like lodash
✓ express · well known

Fixes that check themselves

String-built SQL becomes a parameterised query, innerHTML becomes textContent, redirects are limited to this site. Each edit is re-scanned before it's offered, and aegis scan --fix applies only the verified ones.

− pool.query("SELECT * FROM users WHERE name = '" + req.query.name + "'")
+ pool.query("SELECT * FROM users WHERE name = $1", [req.query.name])
✓ Re-scanned: issue gone, nothing new introduced

New issues only

Scans of staged changes, a branch or a baseline file report what the change adds and what it fixes, matched by content rather than line numbers. That's what makes it usable as a gate on an agent's work.

aegis 3 changed files · 1 new · 2 fixed · 14 pre-existing

Hallucination firewall

In the optional AI review, every claim must quote code that exists at the cited lines, or it's dropped before the debate starts.

Secrets, redacted

Provider key formats plus entropy scoring. Values are masked inside the analyser, so reports are safe to share.

Measured, not claimed

87 labelled cases (52 vulnerable, 35 safe look-alikes) run in CI. A drop below 95% precision or recall fails the build.

Not another “ask a chatbot to review it”

AI code reviewAegisCode
Works with no API key
Same result every run
Line-accurate data-flow paths across files
Checks imported packages actually exist
Fixes re-verified before they're offered
Blocks only what a change introduces
Callable by coding agents over MCP
Published, reproducible accuracy numbers