Documentation

Install it, configure it, and run it.

01Quick start

Install

Pick a method. foxguard has no runtime dependencies.

Run your first scan

terminal
# Scan the current directory
foxguard .

# Scan with JSON output
foxguard . --format json

# Scan with SARIF output (for CI/CD)
foxguard . --format sarif -o results.sarif

# Scan only changed files (diff mode)
foxguard diff main

# Post-quantum crypto audit
foxguard pqc .

# Generate a Cryptographic Bill of Materials
foxguard pqc . --format cbom --output cbom.json

# Interactive triage mode
foxguard tui .

What to expect

foxguard scans source for vulnerabilities, hardcoded secrets, and weak or pre-quantum crypto. Findings print to stdout, grouped by severity. Exit 0 means clean and exit 1 means findings, so you can gate CI on it.

02Configuration reference

Drop a .foxguard.yml in your project root to customize behavior. Every field is optional, and foxguard runs with zero config.

.foxguard.yml
scan:
  # Minimum severity: low | medium | high | critical
  severity: medium
  min_confidence: 0.7

  # Optional saved findings: a JSON file, not a branch name.
  # baseline: .foxguard-baseline.json

secrets:
  # Exclusions for the separate "foxguard secrets" command.
  exclude_paths:
    - tests/fixtures

CLI flags override config

Explicit CLI values override corresponding configuration defaults. Output format, --exclude, and --max-file-size are CLI options, not YAML fields. Run foxguard --help for the full list.

03GitHub App setup

foxguard scans every PR automatically, with no CI wiring. Install the app and findings land as PR comments in seconds.

1

Install the app

Go to github.com/apps/foxguard-app and select the repos you want scanned.

2

Open a PR

foxguard scans the PR head ref. Most repos finish in under a second. Results post as a PR comment.

3

Fix and merge

Push fixes and the scan re-runs automatically. A clean scan posts a clean comment. There is nothing to configure.

Self-hosting

For air-gapped or regulated environments, self-host the webhook receiver. Register your own GitHub App, point its webhook URL at your instance, and deploy with Docker:

docker run --rm -p 8080:8080 \
  -e FOXGUARD_WEBHOOK_SECRET=$(openssl rand -hex 32) \
  ghcr.io/0sec-labs/foxguard-github-app:latest

See the GitHub App page for more details.

04VS Code extension

See findings inline as you code. Install from the Visual Studio Marketplace or the command line:

terminal
code --install-extension 0sec-labs.foxguard

Real-time diagnostics

Findings appear as squiggly underlines with severity-colored markers. Hover for details, CWE links, and fix suggestions.

Quick-fix actions

Suppress a finding with an inline comment directly from the lightbulb menu. Supports per-line and per-file suppression.

05CI/CD integration

foxguard exits 1 on findings, so gating merges is trivial. Use SARIF output for GitHub Code Scanning, GitLab SAST, and other platforms.

GitHub Actions

.github/workflows/foxguard.yml
name: foxguard
on: [push, pull_request]

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install foxguard
        run: curl -fsSL https://foxguard.dev/install.sh | sh

      - name: Run scan
        run: foxguard . --format sarif -o results.sarif

      - name: Upload SARIF
        if: always()
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: results.sarif

Alternatively, use the GitHub App, which does this automatically with no workflow file needed.

GitLab CI

.gitlab-ci.yml
foxguard:
  stage: test
  image: rust:latest
  before_script:
    - curl -fsSL https://foxguard.dev/install.sh | sh
  script:
    - foxguard . --format json -o gl-sast-report.json
  artifacts:
    reports:
      sast: gl-sast-report.json
    when: always

Any CI system

terminal
# Install
curl -fsSL https://foxguard.dev/install.sh | sh

# Scan and fail the build if findings exist
foxguard . --severity high
# exit code 1 = findings found, exit code 0 = clean

06Suppression guide

Suppress false positives and pick the scope that fits.

Inline comments

Add a foxguard: ignore[rule/id] comment on the finding line or the line above it. Omit the brackets to suppress all rules on that line. Suppress only after reviewing the finding.

example.py
# foxguard: ignore[py/no-hardcoded-secret] — reviewed test fixture
API_KEY = "sk-test-placeholder"

# foxguard: ignore — suppress all rules on the next line
password = get_config("db_password")

Config-based disable

Disable rules globally in .foxguard.yml when they don't apply to your project.

.foxguard.yml
scan:
  disable_rules:
    - py/no-hardcoded-secret
    - go/no-weak-crypto

Path exclusion

Use repeatable --exclude flags for directory prefixes or glob patterns, or your repository's .gitignore.

terminal
foxguard --exclude "vendor/**" \
  --exclude "testdata/**" \
  --exclude "**/*_test.go" \
  --exclude "legacy/**" .

Saved baselines and Git diff

A saved baseline is a JSON snapshot; Git diff compares against a branch. CLI baseline scans suppress matching findings. Terminal review keeps them available and separates introduced, recurring, and resolved entries.

terminal
# Save the current findings
foxguard baseline --output .foxguard/baseline.json .

# Report findings not in the saved baseline
foxguard --baseline .foxguard/baseline.json .

# Review current findings alongside baseline history
foxguard tui --baseline .foxguard/baseline.json .

# Independently compare against a Git branch
foxguard diff main .

Resolved means not reported under the current scope, rules, and filters—not verified fixed. Compare equivalent scan settings. Baseline identity includes file and source location; moving a finding can appear as introduced plus resolved. Historical entries do not contain current source context.

TUI triage

Choose Scan, Diff, Secrets, or PQC, then review findings without leaving the terminal. Wide screens show a split view; use the detail toggle on smaller screens.

terminal
foxguard tui .
  • v expands detail; PageUp/PageDown scroll source context, dataflow, and fixes. Esc returns to the list.
  • Enter or o opens the selected finding/source/sink using a nonblank VISUAL, then EDITOR, or an installed terminal editor (nvim, vim, nano, vi). Headless terminals do not require xdg-open. For example, set VISUAL="nvim" or EDITOR="code --wait". Missing or invalid editors leave the TUI open with setup guidance.
  • / edits search, Enter applies it, and Ctrl+U clears the draft. Esc cancels edits and restores the prior query; outside editing or expanded detail, Esc clears filters.
  • 0–4 set minimum severity, c cycles confidence, and Shift+C changes sorting.
  • f cycles All, Unreviewed, Todo, Reviewed, and Ignore. The list shows visible/total counts and review progress.
  • i opens single-finding triage. Review marks persist in per-user storage, scoped to the canonical project root and scan mode; baseline and configuration actions change repository files.
  • Space checks a finding; a toggles visible selections. Hidden selections remain selected. x opens a batch preview with exact targets, hidden counts, destination, and rule/file or project-wide effects. Only y applies it; Esc cancels without writing. Successful configuration writes are not rolled back if another target fails.
  • Shift+F manages named search, severity, confidence, review, sort, and baseline filters. In that menu, Enter loads, s saves, and d confirms deletion. Replacement requires confirmation.
  • Storage errors leave changes visibly UNSAVED rather than silently clobbering another terminal. Shift+F provides w to retry, r to confirm reloading, and Shift+R to confirm backing up the on-disk review file and resetting this project/mode. Reload/reset discards unsaved changes; unsaved marks are not included in the backup.
  • With --baseline, b cycles all current, introduced, recurring, and resolved entries. Resolved means absent under the current scan scope—not verified fixed. Historical rows are read-only, support search and expanded detail, and have no saved source, severity, or confidence. Switch to current findings to triage or export.
  • e exports all current scan results—not just filtered rows—to CBOM, JSON, or SARIF in the working directory. Existing reports require y to replace; Esc cancels. Symlinks are rejected.
  • ? opens scrollable help. Ctrl+C quits from any view, including search and confirmation dialogs.
  • The loading card shows indeterminate activity and actual elapsed time. Ctrl+C also exits during scanning.

07Output formats

Terminal (default)

Human-readable output with colors, file paths, line numbers, and fix suggestions.

foxguard .

JSON

Machine-readable findings for scripts, dashboards, or custom integrations.

foxguard . --format json

SARIF

Standard format for GitHub Code Scanning, GitLab SAST, and other security platforms.

foxguard . --format sarif

08Post-quantum crypto audit

Audit your codebase for crypto primitives that quantum computers will break, mapped to NSA CNSA 2.0 timelines. The transition deadlines are close.

What gets flagged

  • RSA: key exchange, signing, encryption (all key sizes)
  • ECDSA / ECDH: elliptic curve operations (P-256, P-384, etc.)
  • DH: classic Diffie-Hellman key exchange
  • DSA: Digital Signature Algorithm
PQC audit
foxguard pqc .
CBOM generation
foxguard pqc . --format cbom --output cbom.json

The CBOM (Cryptographic Bill of Materials) inventories every crypto primitive in your codebase for compliance reporting and for tracking your migration to post-quantum algorithms.

Questions?

Open an issue or check the README for more details.