cfgaudit
Security auditor for AI-agent configuration files.
cfgaudit scans the configuration of AI coding assistants — starting with Claude Code — and flags settings that violate the principle of least privilege or leave sensitive files exposed to the agent's context.
Every finding maps to an OWASP GenAI LLM Top 10 2026 risk (the primary mapping). Two secondary lenses are also provided: the OWASP MCP Top 10 for the MCP-server rules, and the OWASP AISVS 1.01 mapping for teams who verify against the AI Security Verification Standard. A behavioral crosswalk to AVE (Agentic Vulnerability Enumeration) maps the rules to AVE's behavioral classes. The primary OWASP LLM id and the mapped AVE id ride in the JSON and SARIF output (OWASP/AVEID in JSON; properties.owasp_llm/properties.ave_id in SARIF, alongside the CFG ruleId). The rule→AVE mapping lives in a single file (cmd/cfgaudit/avemap.go) with the crosswalk doc as its human-readable companion.
Install
Homebrew (macOS / Linux):
brew install cfgaudit/tap/cfgaudit
With aqua:
aqua g -i cfgaudit/cfgaudit && aqua i
cfgaudit is in the aqua standard registry from v4.585.0 on. aqua checks each download against checksums.txt and the attestation of cfgaudit's release workflow (Verifying a release).
With Python tooling (the wheel carries the prebuilt binary, no Python code):
pipx install cfgaudit # or: uv tool install cfgaudit
uvx cfgaudit . # run once without installing
Pin it next to your other linters with cfgaudit==X.Y.Z in a requirements file.
With Node.js (the package runs the prebuilt binary for your platform, no install script):
npx [email protected] . # run once without installing
npm install --save-dev --save-exact [email protected] # pin it in a JavaScript project
Keep the version pinned: cfgaudit reports an unpinned npx package in an MCP server (CFG010) for the same reason.
With the Go toolchain:
go install github.com/cfgaudit/cfgaudit/cmd/cfgaudit@latest
Or download a pre-built binary (Linux / macOS / Windows, amd64 / arm64) from the releases page.
Container image:
docker run --rm -v "$PWD:/work" -w /work ghcr.io/cfgaudit/cfgaudit:latest .
The image includes ShellCheck, so --shellcheck (CFG045) works there and in the GitHub Action and GitLab components, which run the same image.
The image runs unprivileged as uid 65532, so the files you mount must be readable by that uid (normal 644/755 permissions are fine). cfgaudit only reads them — write the report with a shell redirection on the host (> report.sarif) rather than into the mount.
Usage
cfgaudit . # audit the current directory
cfgaudit --format sarif . > cfgaudit.sarif # for GitHub Code Scanning
cfgaudit explain CFG001 # a rule's documentation in the terminal
cfgaudit list --agent cursor # the rules for one agent
cfgaudit init # a hardened .claude/settings.json for a new project