CLI Reference¶
Complete reference for the verity command line: options, exit codes, environment variables, output formats, and CI integration.
Command tree¶
verity
├── scan static audit of MCP/LLM configs and source trees
├── test isolated payload tests for CWE-89/639/943/94
├── serve expose the scanner over a transport
├── view local web control center & report explorer
├── init interactive onboarding wizard & project scaffolding
└── fix safe MCP configuration remediation
Global conventions¶
- Long options only. Both
--flag=valueand--flag valueare accepted. --formatacceptsterminal,json,markdown,html,cyclonedx,spdx, orsarifforscan(sarifis[Pro]);testacceptsterminal,json,markdown, orhtml.terminalis the default for bothscanandtest.- Color is enabled only when stderr is a TTY and
NO_COLORis unset. - Reports go to stdout (or
--output); diagnostics and progress go to stderr. - Every command supports
--help, and the root command supports-V/--version(printsverity 0.2.12and exits0). - Repeated scans and tests are deterministic: the same input produces the same fingerprints.
Global options¶
| Option | Type | Default | Description |
|---|---|---|---|
-V, --version |
flag | — | Print verity 0.2.12 and exit 0 |
--help |
flag | — | Print help for the command and exit 0 |
Exit codes¶
| Code | Name | Meaning |
|---|---|---|
0 |
success | Completed; no blocking findings |
1 |
findings | Findings present with --fail-on-findings, --fail-on-non-compliant failed, or verity test reported a vulnerable case |
2 |
usage / Pro gate | Invalid flag, unknown command, inventory drift with --fail-on-drift, or gated [Pro] feature (PRO_FEATURE_REQUIRED) |
3 |
config | Unreadable or invalid config, schema, or dialect file |
4 |
target | Target unreachable, refused, or timed out (--url, --live-probe) |
5 |
internal | Unhandled internal error |
Exit codes are stable across minor releases. Scripts may rely on them.
Environment variables¶
| Variable | Commands | Default | Description |
|---|---|---|---|
VERITY_CONFIG_FILE |
scan | — | Default for --config-file |
VERITY_SCHEMA_FILE |
scan | — | Default for --schema-file |
VERITY_FORMAT |
scan, test | auto | Default for --format |
VERITY_OUTPUT |
scan, test | stdout | Default for --output |
VERITY_OFFLINE |
scan | unset | Set to 1 to enable air-gapped offline mode using bundled snapshots; --offline sets it to 1 for the run |
VERITY_FAIL_ON_FINDINGS |
scan | 0 |
When 1, behaves like --fail-on-findings |
VERITY_BASELINE |
test | — | Default for --baseline |
VERITY_TEST_AUTHORIZATION |
test | — | Authorization header supplied to --url requests |
VERITY_NO_COLOR |
all | — | Any non-empty value disables color |
VERITY_LOG_LEVEL |
all | warn |
Logging verbosity for diagnostics (error, warn, info, debug) |
VERITY_TRANSPORT |
serve | — | Default for --transport |
Precedence, highest first: command-line flag → environment variable → built-in default. NO_COLOR (standard) is honored alongside VERITY_NO_COLOR.
verity scan¶
verity scan [--config-file PATH [PATH ...]] [--schema-file PATH] [--path PATH [PATH ...]]
[--root DIR] [--config PATH] [--ignore-file PATH]
[--client NAME [NAME ...]] [--scan-global]
[--scanners LIST] [--typosquat-threshold {1,2,3}]
[--call-analysis | --no-call-analysis] [--reachable-only] [--manifest PATH]
[--compliance STANDARD] [--fail-on-non-compliant]
[--save-inventory-baseline PATH] [--compare-inventory-baseline PATH] [--fail-on-drift]
[--format terminal|json|markdown|html|cyclonedx|spdx|sarif] [--output PATH]
[--fail-on-findings] [--fail-on-severity LEVEL] [--fail-on LEVEL]
[--fail-on-new] [--save-baseline PATH] [--baseline PATH]
[--show-suppressed] [--strict-policy] [--no-inline-ignores]
[--no-default-ignores] [--offline] [--live-probe]
[--skills] [--toxic-flows] [--visualize-ansi-codes]
[--llm-assist] [--llm-provider {ollama,deepseek,openai,anthropic,gemini}] [--llm-model MODEL] [--fail-on-advisory]
[--explain]
Statically audits discovered MCP/LLM configuration files (across 17 clients with JSONC // and /* */ comment stripping) and Python source trees. Target code is parsed, never executed.
Option table¶
| Option | Type | Default | Description |
|---|---|---|---|
--config-file |
path... | auto-discover | One or more MCP/LLM config JSON/JSONC/YAML files. When omitted alongside --path/--schema-file, workstation configs are auto-discovered. Configured headers expose only redacted header_keys (DiscoveredServerConfig.header_keys) and plaintext auth headers trigger SEC-STATIC-SECRET-IN-CONFIG (${ENV_VAR} placeholders stay clean) |
--schema-file |
path | — | JSON Schema for declared tool arguments. Enables static checks such as VERITY-STATIC-TOOL-POISONING on tool schemas |
--path |
path... | — | One or more Python files, directories, or config files (.json/.yaml/.yml). Directories scan AST sources and discover nested monorepo configs (**/.cursor/mcp.json, **/.vscode/mcp.json, **/.mcp.json, **/mcp.json) filtered by .verityignore |
--root |
dir | auto-discover | Explicit project root for POSIX repo-relative path canonicalization (--root → enclosing .git → target dir/parent → cwd) |
--config |
path | <root>/verity.toml |
Path to a verity.toml policy config ([scan], [[ignore]], [[allowlists]]) |
--ignore-file |
path | <root>/.verityignore |
Path to a .verityignore file |
--client |
name... | all 17 clients | Restrict workstation discovery to specific clients (claude_desktop, claude_code, cursor, windsurf, zed, vscode_cline, vscode_roo, goose, continue, junie, vscode, antigravity, openhands, trae, lmstudio, librechat, workspace; aliases like claude-code, cline, roo-code accepted) |
--scan-global |
flag | off | Also scan globally installed npm / ~/.npm/_npx MCP packages (opt-in) |
--scanners |
list | offline defaults | Comma-separated scanners (all, config, vuln, secret, ast, taint, typosquat, conflict). Defaults to config,vuln,secret,ast,typosquat,conflict (+ taint when --path is set), or inventory-only when --format cyclonedx\|spdx is used without --scanners |
--typosquat-threshold |
int | 2 |
Maximum Damerau-Levenshtein distance (1–3) for offline BK-Tree typosquatting detection |
--call-analysis / --no-call-analysis |
flag | on | Enable or disable AST call-graph reachability analysis for transitive dependency CVEs |
--reachable-only |
flag | off | Filter transitive vulnerability findings to only those REACHABLE from exposed MCP tools |
--manifest |
path | — | Path to a dependency manifest (package.json, requirements.txt, uv.lock, poetry.lock, pyproject.toml) for transitive reachability |
--compliance |
string | — | Evaluate OWASP compliance (owasp-mcp-top-10 or owasp-llm-2025), attach additive owasp_mcp_id / owasp_llm_id / owasp_category fields, and emit a scorecard |
--fail-on-non-compliant |
flag | off | Exit 1 when the --compliance tier is not COMPLIANT |
--save-inventory-baseline |
path | — | Persist a deterministic server inventory snapshot JSON to this path |
--compare-inventory-baseline |
path | — | Diff current discovered server inventory against a saved inventory baseline |
--fail-on-drift |
flag | off | Exit 2 when --compare-inventory-baseline detects added, removed, or modified servers |
--format |
enum | terminal |
terminal, json, markdown, html, cyclonedx (CycloneDX 1.6), spdx (SPDX 2.3), or sarif ([Pro]) |
--output |
path | stdout | Write the report to a file |
--fail-on-findings |
flag | off | Exit 1 when at least one active finding is present (alias for --fail-on-severity INFO) |
--fail-on-severity, --fail-on |
enum | — | Exit 1 when any active finding meets or exceeds CRITICAL, HIGH, MEDIUM, LOW, or INFO (case-insensitive) |
--fail-on-new |
flag | off | Exit 1 when active findings not present in --baseline appear |
--save-baseline |
path | — | Atomically write a canonical .verity-baseline.json (verity-baseline.v1.json) snapshot of active findings |
--baseline |
path | — | Diff active findings against a saved .verity-baseline.json baseline |
--show-suppressed |
flag | off | Include suppressed_findings details in report output |
--strict-policy |
flag | off | Require non-empty reason / description on policy [[ignore]], [[allowlists]], and inline suppressions |
--no-inline-ignores |
flag | off | Disable in-source # verity-ignore and # nosemgrep directives |
--no-default-ignores |
flag | off | Disable built-in default ignored directories (.git, .venv, node_modules, etc.) and auto-loaded .verityignore |
--offline |
flag | off | Enable air-gapped offline mode using bundled snapshots. Sets VERITY_OFFLINE=1 for the run |
--live-probe |
flag | off | Permit outbound probes of endpoints referenced by discovered configs (and run cross-server ToxicFlowAnalyzer) |
--skills |
flag | off | Scan agent skill / instruction files (SKILL.md, .cursorrules, .cursor/rules/*.mdc, CLAUDE.md, AGENTS.md, .github/copilot-instructions.md) via InstructionFileScanner |
--toxic-flows |
flag | off | Analyze tool profiles (--schema-file or --live-probe) for VERITY-TOXIC-FLOW-LETHAL-TRIFECTA and VERITY-TOXIC-FLOW-POISONED-EXFIL |
--visualize-ansi-codes |
flag | off | Escape raw \x1b, \r, BiDi controls, and Unicode Tag characters into visible [ESC], [CR], [U+202E], and [TAG:U+...] tokens in terminal, markdown, and html reports |
--llm-assist |
flag | off | Enable the opt-in LLM semantic alignment analyzer. Without it, verity scan makes zero HTTP/LLM calls and stays 100% deterministic offline |
--llm-provider |
enum | ollama |
ollama, deepseek, openai, anthropic, or gemini for --llm-assist |
--llm-model |
string | provider default | Override the provider's default model identifier for --llm-assist |
--fail-on-advisory |
flag | off | Exit 1 when any ADVISORY_LLM_ASSIST finding is present |
--explain |
flag | off | Explain finding context ([Pro]; requires verity-pro, returns PRO_FEATURE_REQUIRED exit code 2 when absent) |
Constraints¶
--live-probeimplies egress from the host.--offlinesetsVERITY_OFFLINE=1for the run.--save-baselineand--baselineare mutually exclusive (exit 2).- Missing
--config-file,--config,--ignore-file,--baseline, invalid--fail-on-severity,--strict-policyviolations, or baseline schema mismatches exit2. - Scan never imports, executes, or evaluates project code.
Examples¶
# Default posture scan of the current directory
verity scan
# Multi-file mixed-type scan (ideal for pre-commit)
verity scan --path server.py tools.py .mcp.json --fail-on-severity HIGH
# Explicit config and source root
verity scan --config-file .mcp.json --path server
# Machine-readable report to a file
verity scan --path . --format json --output findings.json
# Brownfield baseline capture and CI regression gate
verity scan --path . --offline --save-baseline .verity-baseline.json
verity scan --path . --offline --baseline .verity-baseline.json --fail-on-new --fail-on-severity HIGH
# CI gate (greenfield)
verity scan --path . --offline --fail-on-findings
# Code-scanning upload [Pro]
verity scan --path . --format sarif --output verity.sarif
# Live probing of referenced endpoints
verity scan --path . --config-file .mcp.json --live-probe
# Filter clients and include global npm packages
verity scan --client claude-code cursor --scan-global --offline
# CycloneDX 1.6 (inventory-only vs vuln-enriched) and SPDX 2.3 SBOM
verity scan --offline --format cyclonedx --output bom.cdx.json
verity scan --offline --format cyclonedx --scanners vuln --output bom-vulns.cdx.json
verity scan --offline --format spdx --output bom.spdx.json
# OWASP MCP Top 10 compliance scorecard & gate
verity scan --path . --offline --compliance owasp-mcp-top-10 --fail-on-non-compliant
# Inventory drift baseline & CI gate (exits 2 on drift)
verity scan --offline --save-inventory-baseline .verity-inventory.json
verity scan --offline --compare-inventory-baseline .verity-inventory.json --fail-on-drift
# Escape ANSI / Unicode deception sequences in terminal, Markdown, or HTML reports
verity scan --path . --visualize-ansi-codes
# Opt-in LLM semantic alignment (advisory findings gate CI)
verity scan --path . --llm-assist --llm-provider ollama --fail-on-advisory
Opt-in semantic alignment (--llm-assist & DualPathRouter UCP Path B)¶
--llm-assistis off by default: without it,verity scanperforms zero HTTP/LLM calls and remains fully deterministic and offline.SemanticAssistClientis pure stdlib (urllib.request, no extra AI SDKs) and pre-sanitizes inputs (zero-width stripping, secret redaction, prompt-injection phrase removal).- Findings are emitted as
VERITY-SEMANTIC-ASSIST-ADVISORY(provenance: ADVISORY_LLM_ASSIST, severityINFO) only after exactevidence_spansubstring verification. --llm-provideracceptsollama(default),deepseek,openai,anthropic, orgemini;--llm-modeloverrides the provider default.--fail-on-advisoryreturns exit1when anyADVISORY_LLM_ASSISTfinding is present.ConsolidatedSecurityAuditor.audit_server(..., live_probe=True)routes non-emptylive_cap.toolsthroughDualPathRouter.route_server(...)for UCP Path B classification.
Brownfield baselines (.verity-baseline.json)¶
- Schema (
verity-baseline.v1.json):--save-baselinewritesschema_version: "1.0",generated_by, and deterministicentriessorted by(file_path, rule_id, fingerprint)atomically via a temporary file andos.replace(). Noscan_duration_ms, timestamps, absolute machine paths, or plaintext secrets are stored. - Pre-redaction fingerprints (
verity:v1:<16-hex>_<occ>): Computed before secret scrubbing so AST findings survive line shifts, duplicate findings disambiguate via_0/_1, and rotating a secret invalidates its baseline entry without storing plaintext credentials. - Schema-mismatch guard (
exit 2):verity scan --baselinerejectsverity testrug-pull hash maps ({tool: sha256}) with exit code2, andverity test --baselinerejectsverity-baseline.v1.jsonscan baselines with exit code2.
Ignore rules, policy config & inline suppressions¶
.verityignore(--ignore-file): Supports gitignore-style globs,:include .gitignore(with cycle and root-escape protection), top-to-bottom!patternnegation, and--no-default-ignores. Applied to both AST path walks and nested monorepo config discovery.verity.toml(--config): Parsed with stdlibtomllib.[scan]: defaultfail_on/fail_on_severity(min_severity,baseline,fail_on_new).[[ignore]]: match byid(including OSV/CVEaliases),paths,servers, orfingerprint, withreasonand optionalexpires = "YYYY-MM-DD". Expired rules re-activate findings and emitexpired_ignore_warnings.[[allowlists]]: matchpaths,servers,stopwords, andregexesagainstregex_target(secret,match, orline) withdescription.- Inline suppressions:
# verity-ignore,# verity-ignore: RULE_1, RULE_2 -- <reason>, and# nosemgrep: <rule-id>on the finding line or immediately preceding line tag findings withsuppression: {"kind": "inSource", "source": "inline", ...}unless--no-inline-ignoresis set.--strict-policyrequires a non-emptyreason/description.
Terminal output¶
verity 0.2.12 — scan
root: /Users/ivan/app
mode: offline (no live probes)
SEVERITY COUNT
critical 1
high 2
medium 3
low 0
info 1
total 7
CRITICAL VERITY-STATIC-SHELL-DROPPER .mcp.json:12 shell: true with interpolated env var
HIGH SEC-STATIC-SECRET-IN-CONFIG .mcp.json:8 hard-coded API token
MEDIUM VERITY-AST-CWE-89-SQLI app/db.py:58 f-string used in cursor.execute
duration: 1.2s files: 812 configs: 4
JSON output¶
Envelope fields:
| Field | Type | Description |
|---|---|---|
schema_version |
string | Report schema version, currently 1.0 |
tool.name |
string | Always verity |
tool.version |
string | Scanner version |
scan.path |
string | Resolved scan root |
scan.offline |
boolean | Whether egress was disabled |
scan.live_probe |
boolean | Whether live probing was enabled |
scan.duration_ms |
integer | Wall-clock duration |
summary |
object | Counts per severity, suppressed_counts (baseline, ignore_file, policy, inline, other, total), optional new_findings / baseline_findings / resolved_since_baseline, and expired_ignore_warnings |
findings |
array | Active finding objects (see below) |
suppressed_findings |
array | Suppressed finding objects with suppression metadata (present when --show-suppressed is set) |
Finding object fields:
| Field | Type | Description |
|---|---|---|
id |
string | Rule identifier, e.g. VERITY-STATIC-SHELL-DROPPER or VERITY-STATIC-TOOL-POISONING |
severity |
enum | critical, high, medium, low, info |
title |
string | Short human description |
location |
object | file, line, column |
evidence |
string | Snippet explaining the match |
remediation |
string | Suggested fix |
fingerprint |
string | sha256: hash of rule, location, evidence |
{
"schema_version": "1.0",
"tool": { "name": "verity", "version": "0.2.12" },
"scan": {
"path": "/Users/ivan/app",
"offline": true,
"live_probe": false,
"duration_ms": 1240
},
"summary": { "critical": 1, "high": 2, "medium": 3, "low": 0, "info": 1, "total": 7 },
"findings": [
{
"id": "VERITY-STATIC-SHELL-DROPPER",
"severity": "critical",
"title": "Shell execution with interpolated input",
"location": { "file": ".mcp.json", "line": 12, "column": 5 },
"evidence": "\"command\": \"npx ... --token $TOKEN\"",
"remediation": "Pass arguments as an array and avoid shell interpretation.",
"fingerprint": "sha256:6f1c...e9"
}
]
}
SARIF output ([Pro])¶
SARIF 2.1.0 export (--format sarif) is a [Pro] feature requiring verity-pro. When verity-pro is absent, Free emits the deterministic PRO_FEATURE_REQUIRED JSON payload ("ok": false, "verdict": "PRO_REQUIRED", "error": "PRO_FEATURE_REQUIRED"), exits with code 2, and writes zero partial files even when --output is supplied. When verity-pro is installed, --format sarif and ComplianceReportEngine.generate_bundle() emit one run per invocation, one rule per finding identifier, and one result per finding with exact physicalLocation.region.startLine (falling back to 1 when line info is absent) and artifactLocation.uri, alongside OSV v1.6.0 records storing AIVSS under database_specific.aivss.
| Field | Value |
|---|---|
version |
2.1.0 |
runs[0].tool.driver.name |
verity |
runs[0].tool.driver.version |
scanner version |
runs[0].results[].ruleId |
finding id |
runs[0].results[].level |
critical/high → error, medium → warning, low/info → note |
runs[0].results[].locations[0].physicalLocation.artifactLocation.uri |
finding file_path / uri |
runs[0].results[].locations[0].physicalLocation.region.startLine |
finding line_number / line (fallback 1) |
runs[0].results[].partialFingerprints.verityFingerprint |
finding fingerprint |
{
"version": "2.1.0",
"runs": [{
"tool": { "driver": { "name": "verity", "version": "0.2.12" } },
"results": [{
"ruleId": "VERITY-STATIC-SHELL-DROPPER",
"level": "error",
"message": { "text": "Shell execution with interpolated input" },
"locations": [{
"physicalLocation": {
"artifactLocation": { "uri": ".mcp.json" },
"region": { "startLine": 12, "startColumn": 5 }
}
}],
"partialFingerprints": { "verityFingerprint": "sha256:6f1c...e9" }
}]
}]
}
Scan exit codes¶
| Code | Condition |
|---|---|
0 |
Scan completed; no blocking active findings (or gate threshold not exceeded) |
1 |
Active findings met or exceeded --fail-on-severity/--fail-on/--fail-on-findings, --fail-on-non-compliant failed, or new findings appeared with --baseline --fail-on-new |
2 |
Usage error, missing --config-file/--config/--ignore-file/--baseline, baseline schema mismatch, --strict-policy error, inventory drift (--fail-on-drift), or gated [Pro] feature such as --format sarif (PRO_FEATURE_REQUIRED, zero partial file writes) |
3 |
Invalid config, schema, or output path |
4 |
--live-probe could not reach a referenced target |
5 |
Internal error |
verity test¶
verity test [--demo] [--target NAME]
[--sql QUERY --dialect DIALECT]
[--url URL --target FIELD]
[--header 'Name: Value' ...] [--bearer-token TOKEN]
[--identify-as CLIENT] [--detect-bait-and-switch]
[--command TEMPLATE]
[--format terminal|json|markdown|html] [--output PATH]
[--save-baseline PATH] [--baseline PATH]
[--visualize-ansi-codes]
Runs isolated payload tests for CWE-89 (SQL injection), CWE-639 (insecure direct object reference), CWE-943 (NoSQL injection), and CWE-94 (code injection), as well as authenticated remote probing and client-identity bait-and-switch checks. Payloads are evaluated locally; --url is the only mode that performs network I/O.
Option table¶
| Option | Type | Default | Description |
|---|---|---|---|
--demo |
flag | off | Run one canonical case per CWE. With --target, run only that case |
--target |
string | — | With --demo: sqlite-basic, postgres-basic, mongo-basic, or code-exec-basic |
--sql |
string | — | SQL statement under test |
--dialect |
enum | postgres |
postgres, mysql, sqlite, duckdb, tsql, bigquery, or snowflake |
--url |
URL | — | Live MCP Streamable HTTP / SSE endpoint to probe |
--header |
string (repeatable) | — | Additional HTTP header ('Name: Value') sent on remote --url probes; malformed headers exit 2 and values are scrubbed from all outputs |
--bearer-token |
string | — | Bearer token sent as Authorization: Bearer <token> on remote --url probes (unless Authorization is already supplied via --header); scrubbed from all outputs |
--identify-as |
string | VerityDiscovery |
Override initialize.params.clientInfo.name across both Streamable HTTP/SSE (--url) and stdio (--command) probes |
--detect-bait-and-switch |
flag | off | Probe --url as VerityDiscovery, claude-desktop, and cursor, comparing canonical SHA-256 tools/list digests and emitting BAIT_AND_SWITCH_DETECTED (CRITICAL, exit 1) on mismatch |
--command |
string | — | Stdio MCP command to probe |
--format |
enum | terminal |
terminal, json, markdown, or html |
--output |
path | stdout | Write results to a file |
--save-baseline |
path | — | Write a baseline of current case verdicts |
--baseline |
path | — | Compare verdicts against a saved baseline |
--visualize-ansi-codes |
flag | off | Escape raw \x1b, \r, BiDi controls, and Unicode Tag characters into visible [ESC], [CR], [U+202E], and [TAG:U+...] tokens in terminal, markdown, and html reports |
Constraints¶
--dialectdefaults topostgres.--urlusesVERITY_TEST_AUTHORIZATIONif set, and merges configuredheaders/--header/--bearer-tokenacross Streamable HTTPPOSTand legacy SSEGET/POSTrequests.- Malformed
--headervalues (missing:or empty header name) exit2immediately before any network I/O. - All
--headervalues and--bearer-tokensecrets are scrubbed from terminal, JSON, Markdown, and HTML outputs;DiscoveredServerConfig.to_dict()exposes only redactedheader_keys. --save-baselineand--baselinerequire--commandor--urland are mutually exclusive; each violation is reported as aFAILresult and exits1.- Passing a
verity scan.verity-baseline.json(verity-baseline.v1.json) file toverity test --baselinetriggers the schema-mismatch guard and exits2. - Invalid or missing baseline files exit
1with aFAILresult. --urlconnection failures are reported as aFAILresult and exit1.
Examples¶
# Every demo case
verity test --demo
# A single demo target
verity test --demo --target sqlite-basic
verity test --demo --target postgres-basic
verity test --demo --target mongo-basic
verity test --demo --target code-exec-basic
# SQL injection against a dialect
verity test --sql "SELECT * FROM users WHERE name = '%s'" --dialect postgres
verity test --sql "SELECT * FROM users WHERE name = '%s'" --dialect sqlite
# Probe a live authenticated MCP Streamable HTTP / SSE endpoint
verity test --url http://127.0.0.1:8000/sse --bearer-token "$TOKEN" --header "X-Tenant: acme"
# Override clientInfo.name or run differential bait-and-switch detection
verity test --url http://127.0.0.1:8000/sse --identify-as claude-desktop
verity test --url http://127.0.0.1:8000/sse --detect-bait-and-switch --format json
# Command probe
verity test --command 'python3 server.py'
verity test --command 'python3 server.py' --identify-as cursor
verity test --command 'python3 server.py' --visualize-ansi-codes
# JSON output
verity test --demo --format json --output tests.json
# Baseline MCP tool hashes, then gate on drift
verity test --command 'python3 server.py' --save-baseline .verity-test-baseline.json
verity test --command 'python3 server.py' --baseline .verity-test-baseline.json
Terminal output¶
verity 0.2.12 — test
mode: demo (4 cases)
CWE-89 SQL injection vulnerable payload: ' OR 1=1 -- result: bypass
CWE-639 Insecure direct object vulnerable id=1 -> id=2 result: owner mismatch
CWE-943 NoSQL injection vulnerable {"$ne": null} result: bypass
CWE-94 Code injection vulnerable __import__("os").system(..) result: executed
summary: 4 vulnerable, 0 patched, 0 errors
JSON output¶
| Field | Type | Description |
|---|---|---|
schema_version |
string | 1.0 |
tool |
object | name, version |
suite |
string | demo, sql, idor, command, or nosql |
cases[] |
array | One object per executed case |
cases[].cwe |
string | CWE-89, CWE-639, CWE-943, or CWE-94 |
cases[].status |
enum | vulnerable, patched, skipped, error |
cases[].payload |
string | Payload that was evaluated |
cases[].evidence |
string | Why the verdict was reached |
cases[].duration_ms |
integer | Evaluation time |
summary |
object | Counts by status |
baseline |
object or null | Present when --baseline/--save-baseline used |
{
"schema_version": "1.0",
"tool": { "name": "verity", "version": "0.2.12" },
"suite": "demo",
"cases": [
{
"cwe": "CWE-89",
"status": "vulnerable",
"payload": "' OR 1=1 --",
"evidence": "tautology accepted by evaluator",
"duration_ms": 3
}
],
"summary": { "vulnerable": 1, "patched": 0, "skipped": 0, "error": 0 },
"baseline": null
}
Test exit codes¶
| Code | Condition |
|---|---|
0 |
Completed; no case reported vulnerable or FAIL |
1 |
At least one case reported vulnerable or FAIL, including baseline/rug-pull and probe failures |
2 |
Usage error (unknown flag or unknown subcommand) |
5 |
Internal error |
verity serve¶
Exposes the scanner as a long-running process using a transport suitable for MCP clients and agent frameworks.
Option table¶
| Option | Type | Default | Description |
|---|---|---|---|
--transport |
enum | stdio |
stdio, sse, or http |
--host |
string | 127.0.0.1 |
Bind host for network transports |
--port |
integer | 8765 |
Bind port for network transports |
--unified-only |
flag | off | Expose only the 4 unified UNIFIED_TOOL_DEFINITIONS tools on tools/list and /health |
Transport behavior¶
| Transport | Endpoint | Notes |
|---|---|---|
stdio |
stdin/stdout (JSON-RPC 2.0) | Logs go to stderr; stdout carries protocol frames only |
sse |
127.0.0.1:8765 |
HTTP/SSE JSON-RPC; loopback only; no authentication |
http |
127.0.0.1:8765 |
HTTP JSON-RPC; loopback only; no authentication |
Examples¶
verity serve --transport stdio
verity serve --transport stdio --unified-only
verity serve --transport sse
verity serve --transport http --host 127.0.0.1 --port 8765
VERITY_TRANSPORT=stdio verity serve
Unified MCP tool behavior¶
verity_security_scanwithaction="full_audit"runsDualPathRouter.classify_server(...)and returnsrouting_classificationplusReadOnlySafetyGuard-safenext_recommended_actions(UnknownCapabilityProfilerplans on Path B).verity_database_oracle's unified schema exposesverify_physical_database([Pro]; returnsPRO_FEATURE_REQUIREDwithoutverity-pro).verity_remediation_ops's unified schema exposesgenerate_safe_parameterized_queryhonoringoptions["dialect"](default"postgres",[Pro]; returnsPRO_FEATURE_REQUIREDwithoutverity-pro).verity_remediation_opsalso exposessynthesize_verified_patchandexplain_finding_context(options["finding"]andoptions["snippet"]), delegating toset_autofix_provider/set_explain_providerwhen registered and returningPRO_FEATURE_REQUIREDwhenverity-prois absent.
Exit codes¶
| Code | Condition |
|---|---|
0 |
Shut down cleanly |
2 |
Missing or unknown --transport |
5 |
Internal error |
The server is unauthenticated. Bind it to loopback only; do not proxy it to untrusted networks.
verity view¶
verity view [PATHS ...] [--host HOST] [--port PORT] [--strict-port]
[--watch | --no-watch] [--read-only] [--strict-auth]
[--no-open] [--allow-live-scan]
Starts the loopback web control center and report explorer (default 127.0.0.1:8766).
Non-loopback --host exits 2. verity scan --view and verity test --view open results
in the same viewer. See Local Web Control Center for the full guide.
verity init¶
verity init [--all-clients] [--workspace] [--non-interactive] [-y | --yes]
[--register-mcp] [--auto-approve]
Runs the 5-step onboarding wizard in the current directory, scaffolding
verity.toml, .verityignore, and .agents/policies.yaml idempotently.
Option table¶
| Option | Type | Default | Description |
|---|---|---|---|
--all-clients |
flag | off | Register the verity MCP server in every discovered MCP client |
--workspace |
flag | off | Only write project-local scaffold files |
--non-interactive |
flag | off | Run without prompts (CI mode) |
-y, --yes |
flag | off | Assume yes to confirmation prompts |
--register-mcp |
flag | off | Register the verity MCP server in .vscode/settings.json via the lossless JsoncPatcher |
--auto-approve |
flag | off | Automatically approve non-interactive registration |
Behavior¶
JsoncPatcherinjects theverityentry losslessly, preserving//and/* */comments and key order.AtomicBackupManagerperforms aStdioDiscoveryTransportpre-flight handshake and rolls.vscode/settings.jsonback byte-for-byte if the probe fails.- Re-running
verity initis idempotent and never duplicates keys.
Examples¶
verity init
verity init --all-clients --workspace --non-interactive -y --register-mcp --auto-approve
verity fix¶
verity fix --config-file PATH [--strategy STRATEGY ...] [--path PATH]
[--write] [--output PATH] [--autofix]
Remediates an MCP configuration file. Dry-run by default: no files are modified and
plaintext secrets are masked in the preview. Pass --write to mutate disk.
Option table¶
| Option | Type | Default | Description |
|---|---|---|---|
--config-file |
path | — | MCP configuration file to remediate (required) |
--strategy |
string (repeatable) | all Free strategies | pin-versions, externalize-secrets, harden-config, ast-sql, ast-guard, or remediate-pr |
--path |
path | — | Source path for [Pro] AST strategies |
--write |
flag | off | Write changes to disk (default is dry-run) |
--output |
path | stdout | Write the remediation report to this path |
--autofix |
flag | off | Synthesize verified autofix patches ([Pro]; requires verity-pro, returns PRO_FEATURE_REQUIRED exit code 2 when absent) |
Free strategies¶
pin-versions— pins unpinnednpx/uvxpackage arguments to an explicit version.externalize-secrets— rewrites plaintext secrets to${KEY}references and writes them to a0o600.env.verityfile.harden-config— rewrites insecurehttp://endpoint URLs tohttps://.
Constraints¶
--config-fileis required; a missing or unreadable file exits2.--strategy ast-sql,--strategy ast-guard,--strategy remediate-pr,--path, or--autofixrequireverity-pro; without it Free fails closed withPRO_FEATURE_REQUIRED(exit code2).- Plaintext secrets are masked in all dry-run previews.
Examples¶
verity fix --config-file .mcp.json
verity fix --config-file .mcp.json --strategy pin-versions --strategy externalize-secrets --strategy harden-config --write
verity fix --config-file .mcp.json --strategy ast-sql
verity fix --config-file .mcp.json --autofix
Exit codes¶
| Code | Condition |
|---|---|
0 |
Dry-run preview or --write completed |
2 |
Usage error, missing --config-file, or gated [Pro] strategy (PRO_FEATURE_REQUIRED) |
Terminal output conventions¶
| Stream | Content |
|---|---|
| stdout | The report in terminal, json, markdown, html, or sarif |
| stderr | Progress, warnings, live-probe notices, and errors |
- Progress is suppressed when
--formatisjson/sarif, when--outputis set, or when stdout is not a TTY. - Color is disabled when
NO_COLORorVERITY_NO_COLORis set, or when stderr is not a TTY. - Long evidence strings are truncated to 120 columns in
tablemode;jsonandsarifare never truncated. - The footer always reports
duration,files, andconfigsinscan, and asummaryline intest.
JSON output¶
schema_versionfollows semver. Additive fields do not bump the major version; removals and type changes do.- Field order is not significant; consumers must key by name.
fingerprintis stable across runs for identical rule, location, and evidence; it changes when any of those change.- Times are milliseconds since the run started; timestamps, when present, are RFC 3339 UTC.
- Errors reported in JSON also set a non-zero exit code; the envelope is still emitted when
--outputis set.
SARIF output ([Pro])¶
- Requires
verity-pro; in Free,--format sarifemits"ok": false,"verdict": "PRO_REQUIRED","error": "PRO_FEATURE_REQUIRED", exits with code2, and writes no partial file even when--outputis supplied. - When
verity-prois installed, emitted as OASIS SARIF 2.1.0 with exactphysicalLocation.region.startLine(falling back to1when line info is absent) andartifactLocation.uri, suitable for GitHub code scanning, Azure DevOps, and DefectDojo. ComplianceReportEngine.generate_bundle()additionally pairs SARIF 2.1.0 with OSV v1.6.0 records that storeAIVSSunderdatabase_specific.aivss.tool.driver.rulesis populated once per distinct finding identifier.results[].partialFingerprints.verityFingerprintenables deduplication across runs.- Severity mapping is fixed:
critical/high→error,medium→warning,low/info→note.
GitHub Actions upload:
CI/CD pipelines¶
GitHub Actions¶
Dedicated CI/CD & GitHub Action Guide
For the complete 13-input & 8-output reference tables, Mermaid pipeline architecture, 6 copy-paste workflow recipes (diff-pr, .verity-baseline.json, air-gapped offline, downstream step outputs, [Pro] SARIF v2.1.0 Code Scanning upload), and companion pre-commit hooks, see GitHub Action & Pre-Commit Hooks.
Use the official composite action JMartynov/verity-scan-action@v1 for cached uv execution, single-pass JSON/summary generation, and ${{ runner.temp }}/verity/ artifact isolation:
name: verity
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: JMartynov/verity-scan-action@v1
with:
fail-on-severity: HIGH
Enable brownfield PR-diff mode (diff-pr: "true" with fetch-depth: 0) or air-gapped scanning (offline: "true"):
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: JMartynov/verity-scan-action@v1
with:
diff-pr: "true"
offline: "true"
fail-on-severity: HIGH
- Inputs & Outputs: Supports 13 inputs (
path,config-file,schema-file,fail-on-severity,offline,live-probe,upload-sarif,sarif-category,diff-pr,version,python-version,cache,extra-packages) and emits 8 step outputs (findings-count,critical-count,high-count,has-critical-or-high,sarif-file,json-file,sarif-generated,exit-code). See the complete inputs and outputs tables. [Pro]SARIF v2.1.0 upload: Supplyverity-proviaextra-packagesto emit SARIF v2.1.0 (sarif-generated=true) and triggergithub/codeql-action/upload-sarif@v3. In Free,--format sarif[Pro]returnsPRO_FEATURE_REQUIRED(exit code2) with zero partial files, leavingsarif-generated=false.
Direct CLI alternative (actions/checkout@v5 + astral-sh/setup-uv@v6):
name: verity-cli
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
- run: uv tool install verity-redteam-core
- name: Scan (JSON)
run: |
verity scan --path . --offline \
--format json --output verity.json \
--fail-on-findings
- name: Payload tests
run: verity test --demo --format json --output tests.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: verity-reports
path: |
verity.json
tests.json
Install verity-pro in the job to enable --format sarif [Pro]. Without it, --format sarif [Pro] returns PRO_FEATURE_REQUIRED (exit code 2) and writes no file, so use --format json and upload the JSON report.
GitLab CI¶
verity:
image: python:3.12
before_script:
- pip install verity-redteam-core
script:
- verity scan --path . --offline --format json --output scan.json
- verity test --demo --format json --output tests.json
artifacts:
when: always
paths:
- scan.json
- tests.json
allow_failure: false
Emit scan.sarif with [Pro] (verity-pro installed) when GitLab's SAST report ingestion is required.
pre-commit¶
Use the official .pre-commit-hooks.yaml repository in .pre-commit-config.yaml (all hooks default to --offline for <1s local commits; see the Pre-Commit Hooks Guide for hook comparison and daily commands):
repos:
- repo: https://github.com/JMartynov/verityredteam-free
rev: v0.2.12
hooks:
- id: verity-scan
# Optional:
# - id: verity-scan-configs
# - id: verity-scan-uvx
verity-scan— scans staged.py,.json, and.yamlfiles withverity scan --offline --fail-on-findings --path(language: python).verity-scan-configs— audits staged MCP client/workspace configs (.cursor/mcp.json,.vscode/mcp.json,.mcp.json,claude.json,claude_desktop_config.json,mcp.json,librechat.yaml) via--config-file.verity-scan-uvx— runsuvx verity-redteam-core scan --offline --fail-on-findings --path .(language: system) with zero pre-commit virtualenv build overhead.
Local hook alternative (if verity is already on PATH):
repos:
- repo: local
hooks:
- id: verity-scan
name: verity scan
entry: verity scan --offline --fail-on-findings --format terminal
language: system
pass_filenames: false
- id: verity-test
name: verity test --demo
entry: verity test --demo
language: system
pass_filenames: false
Jenkins¶
stage('verity') {
steps {
sh 'pipx install verity-redteam-core'
sh 'verity scan --path . --offline --format json --output scan.json --fail-on-findings'
sh 'verity test --demo --format json --output tests.json'
archiveArtifacts artifacts: 'scan.json, tests.json', allowEmptyArchive: true
}
}
Gating guidance¶
- Use
--baseline .verity-baseline.json --fail-on-newon long-lived brownfield branches to block only regressions, paired with--fail-on-severity HIGHwhen prioritizing high-impact issues. - Use
--fail-on-findingswithout a baseline only on greenfield repositories. - Always pair
--outputwith an artifact upload; exit codes alone discard evidence. - Keep
--offlinein CI unless the job is explicitly authorized to probe live endpoints.
Troubleshooting¶
| Symptom | Exit | Cause | Fix |
|---|---|---|---|
no findings, nothing scanned |
0 |
--path points at a directory with no configs or Python files |
Pass --config-file explicitly or correct --path |
target refused connection |
1 |
--url endpoint down or unreachable |
Start the service or fix the URL |
cannot bind transport |
4 |
Address or port already in use | Stop the other process or choose another --port |
verity: command not found in GUI IDE |
— | GUI app does not inherit shell PATH |
Use /opt/homebrew/bin/verity (Apple Silicon), /usr/local/bin/verity (Intel macOS), /home/linuxbrew/.linuxbrew/bin/verity (Linux), or which verity |
| Outdated formula after PyPI release | — | Local Homebrew tap metadata is stale | Run brew update && brew upgrade verity |