The AI code auditor that signs its own patches.
Scan your TypeScript/JavaScript codebase for security issues, compliance gaps, and tech debt — then fix them with AI and seal your code with a cryptographic provenance stamp.
npx sovereign-guard scan .That's it. No config files, no accounts, no API keys needed for scanning.
| Severity | Rule | What It Catches |
|---|---|---|
| 🔴 CRITICAL | no-hardcoded-secrets |
API keys, tokens, passwords in source |
| 🔴 CRITICAL | hipaa-2026-audit |
Healthcare compliance violations |
| 🔴 CRITICAL | dora-ict-risk |
EU financial resilience gaps (DORA) |
| 🔴 CRITICAL | eu-ai-act |
AI transparency & oversight gaps |
| 🟠 HIGH | no-silent-catch |
Empty catch blocks hiding errors |
| 🟠 HIGH | missing-error-handling |
Async functions without try/catch |
| 🟠 HIGH | no-math-random |
Math.random() in security contexts |
| 🟠 HIGH | no-agent-auth-profile |
Missing auth in AI agent code |
| 🟡 MEDIUM | no-any-type |
: any type escape hatches |
| 🟡 MEDIUM | no-placeholder-logic |
PLACEHOLDER, STUB, MOCK left behind |
| 🟡 MEDIUM | missing-audit-trail |
No logging in critical modules |
| 🟡 MEDIUM | deprecated-api |
substr, __proto__, new Buffer |
| 🟢 LOW | no-console-log |
console.log in production code |
| 🟢 LOW | complexity-spike |
Functions >50 lines, files >200 lines |
| 🟢 LOW | unused-imports |
Imported symbols never used |
| 🟢 LOW | todo-debt |
TODO, FIXME, HACK comments |
# Scan current directory
npx sovereign-guard scan .
# JSON output for CI/CD (exit code 1 on CRITICAL/HIGH)
npx sovereign-guard scan ./src --format json --output report.json
# Markdown report for stakeholders
npx sovereign-guard scan ./src --format md --output AUDIT.md
# Only show critical and high
npx sovereign-guard scan --min-severity HIGHUses Google Gemini to generate fixes for every finding.
export GOOGLE_GENERATIVE_AI_API_KEY=your_key
npx sovereign-guard fix ./src --max-patches 5Get a free API key at aistudio.google.com/apikey
Creates a SHA-256 provenance stamp proving your code was audited at this exact point in time.
npx sovereign-guard sign ./src
# Creates .sovereign-seal.json# .github/workflows/audit.yml
name: Security Audit
on: [push, pull_request]
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npx sovereign-guard scan . --format json --min-severity HIGHExit code 1 if CRITICAL or HIGH findings are detected. Your PRs will fail if someone pushes a hardcoded API key.
Create .guardrc.json in your project root:
{
"include": ["**/*.ts", "**/*.js"],
"exclude": ["node_modules/**", "dist/**"],
"disableRules": ["no-console-log"],
"minSeverity": "MEDIUM",
"maxFiles": 500
}ESLint catches syntax. SonarQube catches code smells. Neither catches an API key sitting in your config, an empty catch block hiding a payment failure, or a healthcare app missing its HIPAA revision date.
Sovereign Guard focuses on the bugs that cost money — the ones that become compliance violations, security incidents, and 3 AM pages.
- TypeScript + Node.js
- Google Gemini for AI patching
- Commander.js for CLI
MIT — use it, fork it, ship it.
Built in 🇧🇦 Bosnia & Herzegovina