Most security scanners take 10–30 seconds. foxguard finishes in under one. Fast enough to run on every save, not just in CI.
src/auth/login.js
14:5 CRITICAL js/no-sql-injection (CWE-89)
SQL query built with template literal interpolation
src/utils/config.py
7:1 HIGH py/no-hardcoded-secret (CWE-798)
Hardcoded secret in 'api_key'
WARNING 2 issues found: 1 critical, 1 high, 0 medium, 0 low
Why
- Sub-second scans — Rust + tree-sitter + rayon. No JVM, no Python runtime, no network calls.
- 118 built-in rules — SQL injection, XSS, SSRF, command injection, hardcoded secrets, weak crypto, deserialization, and framework-specific checks.
- 10 languages — JavaScript, TypeScript, Python, Go, Ruby, Java, PHP, Rust, C#, Swift.
- Secrets scanning — AWS keys, GitHub/GitLab/Slack/Stripe tokens, private keys. Redacted output.
- Semgrep-compatible — Load your existing YAML rules with
--rules. No vendor lock-in. - Pre-commit ready —
foxguard initinstalls a hook. Scans only changed files with--changed. - CI-friendly — Terminal, JSON, SARIF output. GitHub Code Scanning integration.
Install
Built-in coverage
| Language | Rules | Frameworks |
|---|---|---|
| JavaScript/TypeScript | 24 | Express, JWT, cookies, XSS |
| Python | 26 | Flask, Django, CSRF, session |
| Go | 8 | Gin, net/http, TLS |
| Ruby | 10 | Rails, mass assignment, CSRF |
| Java | 10 | Spring, XXE, deserialization |
| PHP | 10 | Laravel, file inclusion, unserialize |
| Rust | 10 | unsafe, transmute, TLS |
| C# | 10 | .NET, LDAP, XXE, CORS |
| Swift | 10 | iOS keychain, transport, WebView |
Usage
CI Integration
GitHub Actions
name: Security
on:
jobs:
foxguard:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: peaktwilight/foxguard/action@v0.2.1
with:
path: .
severity: medium
fail-on-findings: "true"
upload-sarif: "true"
Findings show up in Security → Code Scanning.
Any CI
Badge
[](https://github.com/peaktwilight/foxguard)
Configuration
foxguard auto-discovers .foxguard.yml from the scan path upward.
scan:
baseline: .foxguard/baseline.json
rules: ./semgrep-rules
secrets:
baseline: .foxguard/secrets-baseline.json
exclude_paths:
- fixtures
- testdata
ignore_rules:
- secret/github-token
Semgrep compatibility
Load existing Semgrep/OpenGrep YAML rules with --rules. Supports pattern, pattern-regex, pattern-either, pattern-not, pattern-inside, pattern-not-inside, metavariable-regex, and paths.include/exclude. See COMPATIBILITY.md.
Performance
foxguard built-ins vs Semgrep auto on real repos:
| Repo | foxguard | Semgrep | Speedup |
|---|---|---|---|
| express (141 files) | 0.284s | 17.4s | 61x |
| flask (83 files) | 0.084s | 7.3s | 87x |
| gin (99 files) | 0.516s | 8.0s | 16x |
Run ./benchmarks/run.sh locally to reproduce.
Built by Peak Twilight — also building pwnkit, vibecheck, unfuck, whatdiditdo
License
MIT