CODE GUARD
More than half of new code is AI-assisted now, and a meaningful share of it carries the classic security bugs: injection, hardcoded secrets, disabled TLS checks, unsafe deserialization. Code Guard is the check a coding agent runs on its own code or diff before committing. A deterministic rule engine, so it can't be talked out of a finding, and it answers in milliseconds.
FreeDeterministic, no LLMJS/TS + Python + generic rulesHTTP + MCP
verdict appears here…
| Endpoint | What it does |
|---|---|
POST /api/scan-code | The guard. Scan a snippet → findings {rule, category, severity, line, remediation} + verdict pass / review / block |
POST /api/scan-diff | Scan only the added lines of a unified diff, with correct new-file line numbers — for commit loops |
GET /api/rules | The full rule catalog: every rule id, category, severity and language, so you can see what it checks and what it doesn't |
{ "mcpServers": { "code-guard": { "command": "npx", "args": ["-y", "@mlawsonking/code-guard-mcp"] } } }
Or call the HTTP endpoints directly — JSON in, JSON out, CORS open. OpenAPI spec.
31 regex rules, matched one line at a time. No parser, no data flow, no taint tracking, so it isn't static
analysis in the sense a SAST vendor means it. It reads text. The hardcoded-* patterns are the
exception: those run over the whole source, so a multi-line private-key block is still caught.
That cuts both ways. db.query("SELECT ... " + id) is caught on one line
and missed the moment you split it across two. The word DES on a line trips weak-cipher, comment or
variable name included.
Languages are JS/TS and Python. 11 rules are JS/TS, 14 are Python, 6 are language-agnostic. There is no Go,
Ruby, PHP, Java or Rust ruleset. An unrecognised language is ignored and the language is sniffed
from the source instead, which returns JS/TS, Python or unknown depending on which tokens the file contains.
Unknown runs all 31 rules against every line.
A fast first pass for the agent's inner loop, not a replacement for a security review. A clean result means none of the 31 rules matched, not that the code is safe. The response says so too.