Skip to content

CLI Reference

The codered binary drives the whole pipeline. Run codered --help or codered <cmd> --help for the authoritative flag list.

codered <command> [options]

Commands

Command What it does
carto Run the cartographer pure-fact phase — tree-sitter facts, symbols, routes, dataflow_edges, code-chunk index. Prints the new engagement_id.
specifier Pin and sign the engagement's threat model (sources, sinks, scope) with the per-engagement Ed25519 key.
hunt Run the hunt: scanners → taint → pattern_scout → chain_builder → poc_forge → devils_advocate → reflector.
advocate Re-run only the devils_advocate stage against an existing engagement.
report Generate the engagement report — SARIF, Markdown, and the Ed25519-signed engagement-seed.json.
export-grc Push a signed engagement seed to a GRC platform (gapps / comp) as mapped risks.
audit Run an audit (Plan A stub).
tools ToolClad manifest utilities.
db status / db upgrade Inspect schema versions or explicitly upgrade an existing evidence/portal database after making a verified backup.
status Inspect the latest engagement run and its stage attempts without model calls.
models install Explicitly install the optional local embedding model (requires the indexing feature).

Typical run

codered carto /path/to/target/repo --index none  # capture <eid> from stdout
codered specifier --engagement <eid> --target /path/to/target/repo
codered hunt --engagement <eid>
codered report --engagement <eid>

Useful flags

hunt

--resume reuses completed scanner and taint stages with matching input fingerprints and intact file/database artifacts. Changed inputs, missing artifacts, or --retry-stage <stage> invalidate that stage and downstream stages. Supported stage names are scanners, taint, scout, chains, poc, advocate, and reflector. The first rollout always reruns the LLM stages, retaining prior attempts as history. --mechanical-only stops after taint and invokes no model.

codered status --engagement <eid> --db <path> shows the latest run ID, stage states, attempt numbers, errors, and reuse references. A renewable engagement lease excludes a second worker. Database connections used by stages also check lease ownership on writes, so an expired worker cannot write into its replacement's run. After a crash, retry is refused while a previous remote operation may still be active; the error gives its cleanup deadline. Success records and artifact hashes are committed together, and a durable outbox retries journal delivery without duplicating stage events.

The hunt has an overall --deadline-seconds budget (default 7200). Operation limits are --scanner-timeout-seconds (300), --scope-timeout-seconds (120), and --refresh-timeout-seconds (60). Each uses the smaller remaining engagement budget. Ctrl-C cancels the active run. Subprocess groups receive termination followed by forced kill and reaping; remote supervisors retain their deadlines after a Docker disconnect. Model-stage cancellation allows a five-second cleanup grace period; remote process cleanup itself is bounded to three seconds. Mechanical workers finish their cooperative cleanup before releasing the lease. If the daemon is unreachable, the recorded remote deadline controls safe retry.

Rebuild scanner and sandbox images to pick up the updated runner capture code. The CLI injects the remote deadline supervisor on each invocation.

Complete subprocess stdout/stderr and outcome metadata are retained under <evidence-dir>/processes/. Scanner sidecars also retain execution files under /tmp/codered-executions/<id>/; container recreation clears these temporary copies. Reproducer runner responses retain their existing display limits; complete raw reproducer streams are carried in the supervisor output file referenced by the PoC execution metadata. Keep host artifacts while they are needed for resumption or evidence retention.

The independent devil's-advocate flags break the confirmation-bias loop by pointing the rebuttal at a non-mirroring model:

codered hunt --engagement <eid> \
  --advocate-provider openrouter \
  --advocate-model google/gemini-3.8-flash \
  --advocate-fallback minimax/minimax-m2

A startup warning fires if the advocate ends up mirroring the generation tier.

The PHP sandbox container is selectable with --php-sandbox-container (default symbi-codered-sandbox-php).

specifier

specifier --target pins the canonical absolute target. hunt and advocate verify the model signature and hash before reading source or invoking scanners. Their optional --target must resolve to the same directory. Use a new engagement for a different target or changed scope that conflicts with existing findings.

If the signing keys are outside .symbiont/keys, pass the same --keys-dir to specifier, hunt, advocate, and report. Legacy threat models with relative target paths must be repinned.

A scope TOML passed to specifier --scope can set repository-relative in_scope_paths and exclude_paths globs and in_scope_languages. Exclusions win; an empty inclusion list includes all paths allowed by the normal repository walker. Source symlinks are omitted. Scanner inputs and model source-reading tools use a private snapshot containing only selected files, and sidecars check their contents against the host snapshot. The existing sandbox container mounts and isolation policy are unchanged. out_of_scope_endpoints must be empty because source scanners cannot reliably enforce endpoint exclusions; express the boundary as file paths instead.

Scan outcomes

Scanner outcomes are persisted as pending, running, succeeded, partial, failed, timed out, cancelled, or skipped. Missing sidecars and invalid output are failures. Valid findings from a partial scan remain available, but the report marks coverage incomplete. A failed or partial scanner stage stops the hunt before model calls and exits nonzero; codered report --engagement <eid> still produces deliverables with coverage details.

All three report formats include scanner coverage and the recorded pipeline run/stages. For recorded runs, SARIF sets executionSuccessful only when scanner coverage is complete and the pipeline succeeded. The signed seed includes both scan_coverage and pipeline. Older engagements without run records show unknown pipeline state. Reports and source-reading tools use the current run's observations; historical findings and stage outputs remain in the database. Unchanged findings retain existing adjudication, while changed source creates a new finding identity.

Database upgrades

codered db status --db <path> [--kind evidence|portal] is read-only. codered db upgrade requires an existing database, validates its known layout and migration checksums, makes an online SQLite backup (including committed WAL pages), checks backup integrity, and applies migrations in one transaction. It prints the backup path. An unrecognized legacy layout, modified migration, newer schema, or failed foreign-key check is an error. Existing schema-1 databases from the pre-migration release are the supported legacy baseline; unrecognized older schemas require a supported export. Fresh databases initialize automatically. Read-only commands refuse incompatible schemas instead of silently upgrading them.

Before upgrading, stop processes using older binaries. For recovery, stop writers and restore the printed, verified backup together with the older binary; discard stale WAL/SHM files only after every connection is closed. Automatic destructive downgrades are not provided. Evidence and portal migrations are separate histories.

Indexing and model installation

carto --index none persists facts, routes, symbols, and dataflow without a model or vector store. --index local requires the indexing Cargo feature and an installed model. Full builds retain local indexing as the default; minimal builds reject it before creating an engagement.

Run codered models install [--directory <path>] explicitly to download and validate BGE small. The default is data/models/bge-small-en-v1.5, overridable with CODERED_EMBEDDING_MODEL_DIR. Existing installations are never overwritten. Loading verifies local model/tokenizer hashes and performs no downloads. Index metadata binds model identity, digest, dimension, and chunker version; an old index without compatible metadata must be rebuilt in a new directory.

Build the minimal CLI with cargo build --locked -p symbi-codered-cli --no-default-features. Add --features portal for the web/portal commands, or --features indexing for semantic indexing. Core features are local-embeddings and vector-store; the tools and CLI indexing feature propagates both.


A read-only web viewer (serve) ships only in the enterprise build and is not part of the Apache-2.0 core.