codegate scan [target] runs the multi-layer analysis pipeline against a target and reports findings. Layers 1 and 2 are offline-first and deterministic. Layer 3 deep scan is opt-in with --deep.
Layers 1 and 2 never make network calls. The scan target is inspected locally against the static knowledge base. Layer 3 (
--deep) is the only mode that may fetch remote metadata or invoke a local AI agent.Scan targets
The[target] argument accepts:
- Directory — scans all discovered AI tool config files under the directory (default:
.) - File — scans a single config file directly
- URL — clones or fetches the remote resource and scans the result; use
--skillto select a single skill from a multi-skill index repo
Flags
Enable Layer 3 dynamic analysis. Discovers eligible external resources and local instruction files, prompts for per-resource consent, and optionally invokes a local AI meta-agent (Claude Code, Codex CLI, or OpenCode) for deeper inspection. No network calls are made without explicit consent.
Enter remediation mode after the scan completes. Guides you through available fixes interactively. Backups are written to
.codegate-backup/ before any file is modified.Automatically apply fixes for unambiguous critical findings without interactive prompts. Use with
--dry-run to preview what would change.Show proposed remediation changes without writing anything to disk.
Generate patch-style output for proposed fixes, suitable for review workflows.
Disable the TUI dashboard and interactive prompts. Use this flag in CI or when piping output.
Output format. Valid values:
terminal, json, sarif, markdown, html.sarif output is designed for GitHub Code Scanning and other security tooling.Write the report to a file path instead of stdout.
Show extended output in
terminal format. Has no effect on other output formats.Path to a specific global config file. Overrides the default
~/.codegate/config.json location.Skip interactive confirmations, including deep scan consent prompts and remediation consent. In non-interactive or CI environments, deep scan actions are skipped unless
--force is provided.Force-include user/home AI tool config paths for this run. Useful when the config file has
scan_user_scope: false but you want a one-off full scan.Collection scope mode. Valid values:
default, project, user, explicit, all. The flag is repeatable to combine modes.Restrict collection to specific artifact kinds. Valid values:
workflows, actions, dependabot. The flag is repeatable.Treat parse failures in collected inputs as high-severity findings instead of warnings.
Audit sensitivity level. Valid values:
regular, pedantic, auditor.Runtime mode for optional online audits. Valid values:
offline, online, online-no-audits.Enable the CI/CD audit pack for GitHub Actions workflows, actions, and Dependabot inputs. Checks include unpinned action references, high-risk triggers, overly broad permissions, template expression injection, and known vulnerable action references (online mode only).
Select one skill directory when scanning a skills-index repo URL that contains multiple skills.
Clear the persisted scan-state baseline file (
~/.codegate/scan-state.json) and exit immediately. Use this to reset rug-pull detection history.Examples
Exit codes
| Code | Meaning |
|---|---|
0 | No unsuppressed findings |
1 | Findings exist below the configured severity threshold |
2 | Findings at or above the configured severity threshold |
3 | Scanner or runtime error |