CLI reference

Every secfoo command, grouped the way the CLI itself groups them. Options in brackets are optional; ... marks a repeatable flag.

Core

secfoo run

Run one or more security skills against a target using the chosen agent. Multiple --skill flags run concurrently, not one after another.

Each run records the git commit it scanned. On a terminal, if a skill already scanned this exact commit, secfoo asks before scanning it again; pass --rescan to skip the question. Non-interactive runs (CI, --json) always scan.

If --assessment is omitted, a case file is created automatically for you — no separate secfoo assessment create step needed for the common case. On a real terminal, you'll be prompted for a project name and application ID (skip either by passing --project-name/--app-id directly, or leave both unset for a non-interactive run, e.g. in CI). A repeat run against the same target with the same --app-id attaches to that same assessment instead of creating a new one each time, so history accumulates in one case file across rescans.

secfoo run --skill <id>... [--skill-file...] [--skill-sha256...] [--target] [--confluence...] [--agent] [--model] [--depth] [--timeout] [--assessment] [--project-name] [--app-id] [--exclude...] [--fail-on] [--max-cost] [--max-input-tokens] [--json] [--no-memory] [--rescan] [--yes]
--skill, -sSecurity skill to run, built-in or your own. Repeatable. Required unless --skill-file is given.
--skill-fileRun a skill from a Markdown file or an https:// URL without installing it. Repeatable.
--skill-sha256Pin a --skill-file URL to this SHA-256, matched by position. A content change fails before the skill runs.
--target, -tLocal directory, or a GitHub, GitLab or Bitbucket Cloud repository URL (HTTPS or git@host:namespace/repo.git). Defaults to the current directory. Private repos: see repository targets.
--confluence, -cConfluence page URL for extra context. Repeatable.
--agent, -aclaude | agent (Cursor) | agy (Antigravity) | gemini | codex | copilot | opencode | droid | devin | api. Falls back to config, then claude. See the agent setup guide.
--modelModel for this run. Overrides [agents.<agent>].model in config. Ignored, with a warning, by agy and devin.
--depth, -dquick (fast triage) or standard (full checklist). Falls back to config, then quick.
--timeoutPer-skill timeout in seconds.
--assessmentAttach this run to an existing assessment case file. Skips auto-creation and the --project-name/--app-id prompt entirely.
--project-nameFriendly name for the project, shown across the dashboard instead of the raw URL/path. Only used when --assessment is omitted.
--app-idApplication ID recorded on the auto-created (or reused) assessment — e.g. from your CMDB/asset inventory. Only used when --assessment is omitted.
--exclude, -xPath to exclude from the scan. Repeatable, additive on top of config.
--fail-oncritical | high | medium | low. Exit 2 if any run reports a finding at this severity or worse. Falls back to [defaults].fail_on.
--max-costUSD cap on the summed reported AI spend for this invocation. Exit 3 if exceeded. Falls back to [defaults].max_cost_usd.
--max-input-tokensapi agent only. Refuse, before calling the model, a prompt larger than this many input tokens, so nothing is spent on it. Falls back to [agents.api].max_input_tokens. Other agents warn and ignore it.
--jsonPrint one JSON document (per-skill outcomes, severity counts, spend, gate results) to stdout, for CI. Skips the interactive prompts.
--no-memoryDon't give the agent the secfoo-memory pattern tools for this run, even if a key is configured.
--rescanScan even when this exact commit was already scanned for a skill.

Exit codes: 0 success · 1 a run failed or timed out · 2 all runs succeeded but --fail-on tripped · 3 all runs succeeded but --max-cost tripped (wins over 2). See CI gates and SARIF export.

Repository targets

--target accepts a local directory, a GitHub URL, GitLab (including nested groups) and Bitbucket Cloud. GitLab and Bitbucket take HTTPS or git@host:namespace/repo.git SSH URLs, with .git optional. SSH uses your existing SSH authentication. Clones are shallow and removed after the run, including failed runs.

secfoo run --skill sast --target https://gitlab.com/group/subgroup/repo --agent claude
secfoo run --skill sast --target https://bitbucket.org/workspace/repo --agent claude
SECFOO_GITLAB_HOSTHostname of a self-hosted GitLab, optionally with an HTTPS port, e.g. git.example.org:8443. gitlab.com works without it.
SECFOO_GITLAB_TOKENGitLab token with repository read access, for private HTTPS repos.
SECFOO_BITBUCKET_TOKENBitbucket repository, project or workspace access token with repository read permission. User API tokens and app passwords aren't supported.

Tokens reach Git through a temporary askpass helper. They never appear in clone arguments, URLs, reports, Git config or logs, and authenticated clones don't follow redirects to another host. URLs with embedded credentials, plain HTTP and ssh:// forms are rejected for GitLab and Bitbucket.

secfoo list

List past assessment runs.

secfoo list [--project] [--limit] [--status]
--project, -pFilter by project name/URL substring.
--limitMaximum runs to show. Default 50.
--statusFilter by run status.

secfoo show <run-uuid>

Show a single assessment run's report.

secfoo show <run-uuid> [--json]
--jsonPrint the run record as JSON instead of the report.

secfoo serve

Launch the local web dashboard. It also serves the runtime ingest API for sensors.

secfoo serve [--host] [--port] [--replace] [--runtime-recheck-hours] [--allow-insecure-runtime]
--hostDefault 127.0.0.1. On any other host, runtime API keys are refused over plain HTTP: put a TLS proxy in front.
--portDefault 8787.
--replaceIf another secfoo serve already has the port, stop it and take over.
--runtime-recheck-hoursRe-check running package versions against OSV this often. Default 6; 0 disables it.
--allow-insecure-runtimeAccept runtime API keys over plain HTTP on a non-loopback host. Trusted private networks only: the key crosses the network in clear text.

secfoo serve key create / list / revoke

API keys for runtime sensors and the CLI on this server. A new key is shown once and only a SHA-256 of it is stored. Revoking a key rejects its sensors from their next request.

secfoo serve key create --name <label> [--project] [--runtime-only]
secfoo serve key list
secfoo serve key revoke <id>
--nameA label, e.g. payments-prod-sensor. Required.
--projectLimit the key to one project (ID, name or scanned path/URL). Default: every project.
--runtime-onlyOnly allow the runtime endpoints. Recommended for production clusters.

secfoo agents

List known agent adapters and whether their CLI is installed on this machine. No options.

secfoo agents

secfoo cost

Show AI spend (tokens and cost) across past runs. Runs whose agent reports no cost are listed as unpriced, never as $0.

secfoo cost [--by agent|skill|project] [--since] [--project]
--byGroup by agent, skill or project. Default agent.
--sinceOnly count runs started on or after this date, YYYY-MM-DD.
--project, -pOnly count one project (name/URL substring).

findings list · export · check

Structured findings from SAST, SCA and secret-scanning runs, with an open/closed lifecycle across rescans and, for SCA, runtime evidence.

secfoo findings list

Findings with a Runtime column, sorted by severity and then by what production saw: Reached, Executed, Loaded, No runtime data, Not observed. Not-observed findings are never hidden and always show their coverage.

secfoo findings list [--skill...] [--project] [--status] [--no-runtime]
--skill, -ssast | sca-reachability | secret-scanning. Repeatable.
--projectLimit to one local project ID.
--statusopen | closed | all. Default open.
--no-runtimeSkip runtime evidence, with no network call.

secfoo findings show <fingerprint>

One finding in full, with its routes, runtime evidence and a "fix first" hint. The first characters of the fingerprint from findings list are enough.

secfoo findings show <fingerprint> [--no-runtime]

secfoo findings check

CI gate: exit 4 when an open finding at the threshold was reached in production. Off unless you run it; with no runtime data the gate passes. See CI gates.

secfoo findings check --fail-on reached[:<severity>]|executed[:<severity>] [--project]
--fail-onreached:high counts findings reached on a request route; executed:high also counts code that ran outside a request. Required.
--projectLimit to one local project ID.

secfoo findings export

Export findings as JSON Lines (one record per finding, with skill, severity, language, framework and a code-free construct description) or as a SARIF 2.1.0 document for GitHub code scanning and IDEs.

secfoo findings export [--skill...] [--project] [--status] [--format] [--output] [--no-locations] [--no-runtime] [--runtime-priority]
--skill, -ssast | sca-reachability | secret-scanning. Repeatable. Default: all three.
--projectLimit to one local project ID. Use this for SARIF uploads.
--statusopen | closed | all. Default open.
--formatjsonl or sarif. Default jsonl.
--output, -oWrite to this file instead of stdout.
--no-locationsDrop file paths, line numbers, code-region hashes and reachability evidence. Titles and descriptions aren't redacted.
--no-runtimeDon't attach runtime evidence, and don't fetch it from the server.
--runtime-prioritySARIF: raise findings reached in production to level error.

runtime evidence for SCA

Whether a running app actually loaded a vulnerable dependency and called the vulnerable function. Opt-in: see the runtime evidence guide. --project takes a project ID, name, or the path/URL it was scanned as.

secfoo runtime watchlist

Build the list of vulnerable packages and functions the sensor watches, from the project's open SCA findings. Uses the OSV records SCA runs already cached, so no network by default.

secfoo runtime watchlist --project <p> [--output] [--ghsa]
--output, -oWrite the watchlist here instead of stdout.
--ghsaAlso ask GitHub's advisory API for vulnerable functions when OSV has none. Unauthenticated and rate-limited.

secfoo runtime ingest <events>

Store an NDJSON evidence file against the project's SCA findings. Malformed lines are skipped and listed, and the rest is still stored. Ingesting the same file again updates rows instead of double-counting. Exits 1 if any line was skipped.

secfoo runtime ingest events.ndjson --project <p>

secfoo runtime import-coverage <coverage>

Turn coverage from tests or staging into evidence, with no sensor: a coverage.py JSON report (7.5+), or a V8 coverage folder or file from NODE_V8_COVERAGE.

secfoo runtime import-coverage coverage.json --watchlist watchlist.json [--output]

secfoo runtime inventory

What production actually loads, compared with the scan: version drift, unscanned dependencies, packages new in production, and vulnerable packages never loaded.

secfoo runtime inventory --project <p> [--app] [--env] [--format table|json|cyclonedx] [--output] [--baseline-hours]
--app, --envOnly this app or environment (SECFOO_APP / SECFOO_ENV).
--formattable (default), json, or cyclonedx for a CycloneDX 1.5 SBOM of what's running.
--baseline-hoursPackages first seen this long after an app's first session are flagged new. Default 24.

secfoo runtime recheck

Ask OSV about every package version running right now. A new advisory raises a finding without a new scan. secfoo serve does this every 6 hours.

secfoo runtime recheck [--project]

instrument Python sensor

secfoo instrument

Run a Python command with the runtime sensor. It starts in every Python process the command launches, workers included, and records which watched vulnerable functions run. It never records arguments or return values.

secfoo instrument [--watchlist] [--output] [--flush-interval] -- <command>
secfoo instrument --watchlist watchlist.json -o events-{pid}.ndjson -- gunicorn app:app
--watchlistFrom secfoo runtime watchlist.
--output, -oEvents file; {pid} gives each process its own. Ignored when SECFOO_SENSOR_ADDR is set.
--flush-intervalSeconds between flushes. Default 10.

sensor conformance kit

secfoo sensor conformance

Check any runtime sensor against the sensor protocol: inert when off, reports calls, privacy, fail-open, and overhead. The command after -- starts the sample app with the sensor loaded.

secfoo sensor conformance [--symbol] [--ecosystem] [--max-call-overhead-us] [--max-startup-seconds] -- <command>
secfoo sensor conformance -- python -m secfoo.sensor -m secfoo.runtime.conformance.sample_app
--symbol, --ecosystemThe watched function the sample app calls, and its OSV ecosystem. Default: the Python sample.
--max-call-overhead-usAllowed extra microseconds per watched call. Default 50.
--max-startup-secondsAllowed one-time start-up and exit work. Default 5.

skills custom skills

List, create, validate and share skills, including your own. See Writing your own skills.

secfoo skills list

Every skill secfoo can run, built-in and custom, with where each one comes from.

secfoo skills list

secfoo skills new <id>

Scaffold ~/.secfoo/skills/<id>.md from a commented template.

secfoo skills new graphql-review

secfoo skills validate

Check custom skill files: frontmatter, ids and output type. Exits 1 on any problem, for CI on a shared skills repo.

secfoo skills validate [PATH...]

secfoo skills show <id>

Print the full prompt the agent would receive, without running it.

secfoo skills show <id> [--target]

secfoo skills install <git-url>

Install a shared skill pack (a git repo of *.md skills) and pin it in packs.lock.

secfoo skills install <git-url> [--ref] [--name]
secfoo skills install --from-lock   # CI: every pack at its pinned commit

secfoo skills update / remove

Move installed packs to their ref's newest commit, or remove one.

secfoo skills update [NAME]
secfoo skills remove NAME

assessment case files

An assessment is a case-file container — an Application ID / Security Assessment Request, a review status, and one or more attached runs or uploaded files.

secfoo assessment create

Create a new assessment case file that runs and file attachments can attach to.

secfoo assessment create --type <internal|third-party> [--project] [--name] [--status] [--app-id] [--sar] [--reviewer] [--review-date] [--notes]
--project, -pGitHub repo URL or local directory. Defaults to the current directory.
--nameFriendly project name. Defaults to the name derived from --project.
--typeinternal or third-party. Required.
--statusready | in_progress | completed | blocked. Default ready.
--app-idApplication ID.
--sarSecurity Assessment Request number.
--reviewerReviewer name.
--review-dateReview date.
--notesFree-text notes.

secfoo assessment list

List assessment case files.

secfoo assessment list [--type] [--status] [--search]

secfoo assessment show <id>

Show a single assessment's details, attachments, and attached runs.

secfoo assessment show <assessment-id>

secfoo assessment update <id>

Update fields on an existing assessment.

secfoo assessment update <assessment-id> [--status] [--app-id] [--sar] [--reviewer] [--review-date] [--notes]

secfoo assessment upload <id> <file>

Attach a file to an assessment. AI-BOM files (name containing "ai-bom", .json or .csv) are parsed immediately into a model/tool inventory.

secfoo assessment upload <assessment-id> ai-bom.json

secfoo assessment delete <id>

Delete an assessment. Attached runs are detached, not deleted; attachments are removed.

secfoo assessment delete <assessment-id>

exception risk acceptance

A risk acceptance against a project, with an expiry the dashboard tracks in 30/60/90-day buckets.

secfoo exception create

Grant a risk acceptance / waiver against a project.

secfoo exception create --title --justification --granted-by --expires-at [--project] [--control] [--assessment]
--titleShort description of what's being accepted. Required.
--justificationWhy this risk is being accepted. Required.
--granted-byWho approved this exception. Required.
--expires-atExpiry date, YYYY-MM-DD. Required.
--controlCCM domain code or standard clause, e.g. IAM or "SOC 2 CC6.1".
--assessmentOptionally scope to one assessment.

secfoo exception list

List exceptions, soonest-expiring first.

secfoo exception list [--status]

secfoo exception show <id>

Show a single exception's details.

secfoo exception show <exception-id>

secfoo exception update <id>

Update an exception — e.g. revoke it, or extend its expiry.

secfoo exception update <exception-id> [--status] [--expires-at] [--justification]

secfoo exception delete <id>

Delete an exception record.

secfoo exception delete <exception-id>

miss post-build findings

A threat an earlier model missed — recorded by hand, since nothing in a report can know what it missed.

secfoo miss create

Record a threat found after build that an earlier threat model missed.

secfoo miss create --title --discovered-at [--project] [--description] [--discovered-by] [--run]
--titleWhat was found. Required.
--discovered-atWhen it was found, YYYY-MM-DD. Required.
--descriptionFree-text description.
--discovered-byWho/what found it — incident, pen test, …
--runRun UUID of the threat model that should have caught this, if known.

secfoo miss list

List threats found post-build, most recent first.

secfoo miss list

secfoo miss show <id>

Show a single post-build finding's details.

secfoo miss show <finding-id>

secfoo miss delete <id>

Delete a post-build finding record.

secfoo miss delete <finding-id>

accept threat acceptance

The human loop-back for accepting one threat from a Threat Register — a named owner and justification, tracked independently of the model's own Disposition call.

secfoo accept create

Record a human risk acceptance for one threat from a Threat Register.

secfoo accept create --threat-id --title --justification --accepted-by [--project] [--expires-at] [--run]
--threat-idThe Threat Register row ID from the report, e.g. T4. Required.
--titleShort description of the threat being accepted. Required.
--justificationWhy this risk is being accepted. Required.
--accepted-byWho is accepting this risk. Required.
--expires-atOptional review-by date, YYYY-MM-DD.
--runRun UUID this threat came from, if known.

secfoo accept list

List recorded threat acceptances, most recent first.

secfoo accept list [--status]

secfoo accept show <id>

Show a single threat acceptance's details.

secfoo accept show <acceptance-id>

secfoo accept update <id>

Update a threat acceptance — e.g. revoke it, or extend its review date.

secfoo accept update <acceptance-id> [--status] [--expires-at] [--justification]

secfoo accept delete <id>

Delete a threat acceptance record.

secfoo accept delete <acceptance-id>

cloud enterprise portal

Connect this machine to the secfoo enterprise portal. Every future successful secfoo run is pushed automatically — nothing local changes, and secfoo serve keeps working exactly as before.

secfoo cloud login

Connect this machine to the secfoo enterprise portal.

secfoo cloud login --api-key <key> [--portal-url]
--api-keyIngest-scoped key from your enterprise portal admin. Required.
--portal-urlOverride if your org uses a non-default portal.

secfoo cloud logout

Disconnect this machine from the enterprise portal.

secfoo cloud logout

secfoo cloud status

Show portal connection status and how many local runs are unsynced.

secfoo cloud status

secfoo cloud sync

Push any local runs not yet synced to the portal.

secfoo cloud sync

memory Preview

Connects runs to secfoo-memory, a hosted service of generalized vulnerability patterns the agent can check a candidate finding against. It's optional and off until a key is saved. The hosted service isn't generally available yet.

Only what the agent sends to the pattern tools leaves your machine: a language, a framework, an optional CWE and a construct description of at most 200 characters. The service rejects queries that look like source code, file paths or secrets. Turn it off for one run with --no-memory, for a shell or CI job with SECFOO_MEMORY=off, or always with [memory] enabled = false in config.

secfoo memory signup

Get a free key by email verification and save it.

secfoo memory signup [--email] [--code] [--url]

secfoo memory login

Save an existing team or enterprise key after validating it. --url points at a self-hosted memory service.

secfoo memory login --api-key <key> [--url]

secfoo memory status

Show whether pattern lookups are on, and the key's plan and usage.

secfoo memory status

secfoo memory logout

Remove the saved key.

secfoo memory logout

vendor optional assets

secfoo vendor mermaid

Download Mermaid so architecture diagrams render in the dashboard. Not bundled by default — ~3.5MB, fetched once and served locally afterwards.

secfoo vendor mermaid [--url] [--force]
--urlWhere to fetch the bundle from.
--forceRe-download even if already present.

config ~/.secfoo/config.toml

secfoo config init

Write a starter config.toml (defaults + an MCP server example).

secfoo config init [--force]
--forceOverwrite an existing config.toml.

mcp agent integration

secfoo mcp list

Show MCP servers configured in ~/.secfoo/config.toml.

secfoo mcp list

secfoo mcp sync

Register configured MCP servers persistently into gemini's or Cursor's own config. claude doesn't need this — it picks up config.toml automatically on every run. codex reads MCP servers from its own ~/.codex/config.toml, and agy isn't supported yet.

secfoo mcp sync --agent <agent>
--agent, -aWhich agent's MCP config to update. Required.