Lint your AI features for governance guardrails.
Point aiglare at any JS/TS repo. It finds every place an LLM output reaches a user or triggers a side-effect — payment, booking, email, DB write — then flags which have no confidence handling, no fallback, no validation, and no human-in-the-loop. Map findings to SOC 2, EU AI Act, NIST AI RMF, and OWASP LLM Top 10 with one flag.
scanned 38 files · 3 AI surfaces · 1 blocking
error human-in-loop required soc2/CC9.1
error output validation missing eu-ai-act/Art.9
error excessive agency owasp/LLM08
warn fallback path missing nist/MANAGE-1.3
✓ all guardrails present — no violations
3 errors 1 warning · 1 file
Most AI incidents aren't model failures.
They're governance failures — the output
flowed straight to a user or an irreversible action with nothing in between.
aiglare makes those paths visible, and lets you block the dangerous ones in CI before they ship.
How it works
Scan, classify, score, gate
A static pass over your code — no runtime, no keys, no data leaving the repo. Run it locally or wire it into CI.
Scan
Finds every AI/LLM call site with a provider-agnostic registry — no config, no annotations. Raw fetch/axios to inference hosts count too.
Classify by sink
Traces where each output goes: returned to a user, feeding a side-effect, or internal-only. The sink decides how much the risk matters.
Score guardrails
Checks five governance dimensions per surface and rolls them into a red / amber / green severity you can read at a glance.
Gate in CI
--ci fails the build only on red side-effectful surfaces — the irreversible-action case — so you adopt it without warning fatigue.
Sinks
Where the output goes decides the risk
Every AI surface is classified by sink. A model writing a log line is not the same as a model issuing a refund.
user-facing
Returned from a route or controller, or rendered in a component. The model is talking directly to a person.
side-effectful
Feeds a payment, booking, email, database/file write, or shell. The model can trigger something irreversible.
internal
Logged or cached only. Lowest blast radius — flagged for awareness, never blocks your build.
Guardrails
Five dimensions, scored per surface
Each surface is checked on five governance signals. Full coverage is green; a side-effect with none is red.
-
01
Confidence handling
Does the code read and act on a confidence / probability signal before trusting the output?
-
02
Fallback path
Is there an uncertain-or-failed branch — a default, a retry, a safe no-op — when the model is unsure?
-
03
Output validation
Is the output schema-checked, parsed, or constrained before it's used downstream?
-
04
Human-in-the-loop
For side-effects: does a person confirm before the irreversible action fires?
-
05
Error isolation
Is the call wrapped so a model failure can't take down the surrounding request?
A severity you can adopt
The CI gate fails only on red side-effectful surfaces — the "AI auto-triggers an irreversible action with no confirmation" case. Safe to turn on today without drowning a team in warnings.
$ npx @nugehs/aiglare ./src --ci scanning… 3 surfaces, 1 blocking ✗ red routes/checkout.ts:42 side-effectful ──────────────────────────────────── exit 1 · build blocked
Provider-agnostic
It already knows your stack
Detection is driven by a provider registry — SDKs and raw inference calls alike. Adding a provider is a one-line PR.
Compliance reports
One scan, four frameworks
Pass --compliance all and every surface gets
annotated with the specific controls it violates. Pick your output format
to match your workflow — ESLint lint, Markdown evidence doc, or an
auditor-ready HTML report.
SOC 2
CC7.2 · CC7.4 · CC9.1 · A1.2 · PI1.2 · PI1.3
Trust Services Criteria — change management, monitoring, and processing integrity for AI outputs.
EU AI Act
Art. 9 · Art. 13 · Art. 14 · Art. 17
Risk management, transparency, human oversight, and quality management for high-risk AI systems.
NIST AI RMF
GOVERN-1.2 · MAP-2.3 · MEASURE-2.5/2.6 · MANAGE-1.3/2.2
Govern, Map, Measure, Manage — the four RMF functions, mapped to concrete guardrail gaps.
OWASP LLM Top 10
LLM02 · LLM04 · LLM08 · LLM09
Insecure output handling, model DoS, excessive agency, and overreliance — mapped per surface.
Output formats
-
terminalDefault coloured report, now with a per-framework violation summary footer.
-
lintESLint-style output. Rule IDs like soc2/CC9.1. Works in CI, editors, and code review.
-
markdownEvidence doc with per-framework control tables — hand it to an auditor or attach to a ticket.
-
htmlBranded HTML report with sticky nav, collapsible sections, and guardrail matrix table.
Multi-repo
Pass multiple paths to combine several repos into a single report. Files are prefixed with their repo root for clear attribution.
# ESLint-style lint — works in CI $ aiglare --compliance soc2,eu-ai-act --format lint # Markdown evidence doc for auditors $ aiglare --compliance all --format markdown > AUDIT.md # Branded HTML report $ aiglare --compliance all --format html > report.html # Lint gate — fail CI on compliance errors $ aiglare --compliance all --format lint --ci
MCP server
Let your agents run the audit
aiglare ships a built-in Model Context Protocol server — no SDK dependency. Three tools, wired straight into your agent host.
ai_surface_audit Full audit of a repo → the same structured report as --json. Accepts an optional compliance array; each surface includes violations[] when set.
ai_surface_gate CI-gate verdict: passed + count of blocking red side-effectful surfaces.
list_providers The provider registry the scanner detects.
{
"mcpServers": {
"aiglare": {
"command": "npx",
"args": ["-y", "@nugehs/aiglare", "mcp"]
}
}
} ⚡ Optional: repoctx acceleration
If a
repoctx
index is present, aiglare uses it to sharpen sink classification
with real kind/domain
data. Same tool, two fidelity levels — standalone for everyone,
richer for repoctx users.
Honest limitations
It's a linter, not a verifier.
This is static, advisory analysis. It produces false positives (a
guardrail two call-hops away can be missed) and false negatives (a
confidence variable
that doesn't actually gate anything reads as present). Treat the output
as surfaces to review, not violations.
The repoctx adapter exists precisely to close the call-graph gap.
See your AI surfaces in one command
No install, no config, no keys. Run it on any JS/TS repo right now.