What this is for
The complete command reference forgw-cli. The subcommands cover the full endpoint workflow: turn on the observe-first agent (enable) or keep the tap always-on (autostart), inventory the machine (discover), record a governance baseline (approve), look at the results (serve, report), score something already on disk (scan), vet something before installing it (vet), wire AI clients and in-harness enforcement (hook, guard, telemetry), route traffic through a gateway (gateway), sync with the console (sync, enroll), act on blocked skills (skills), export an AIBOM (aibom), inspect org policy (policy, aicontrol), keep the inventory fresh (schedule), capture live traffic (mitm, macOS), try the pipeline on a seeded demo (demo), and remove it again safely (uninstall).
For the concepts behind the scores, see Inventory & Risk Scoring. For the dashboard, see Local Dashboard.
Global options
Directory for the encrypted spool + key. Applies to every subcommand. Defaults to
~/.guardway (%USERPROFILE%\.guardway on Windows).Only one
gw-cli process can hold the store at a time. Don’t run discover while serve is running — use the dashboard’s Rescan button instead.discover
Inventory the AI tools, agent projects, skills, MCP servers, and extensions on the machine, then risk-score each artifact and store the result.Deep, machine-wide scan: walk every folder/project (not just known tool directories) for
SKILL.md skills and MCP configs, then score each skill. Without it, discovery only visits known tool locations.After scanning, push the findings to the Guardway console. Requires an enrolled endpoint (a saved API key + console URL); a no-op if unconfigured or air-gapped.
Each
discover run also compares every artifact against its last-stored baseline and flags post-approval drift — a new external host, a dropped version pin, or a risk escalation. See Post-approval drift.discover also checks isolation posture (agent settings.json files with permission prompts bypassed, wildcard shell allowlists, or dangerous auto-run hooks) and, once a baseline exists, flags anything outside it as governance — see OWASP AST coverage.
approve
Record the machine’s current inventory as the approved governance baseline — every skill, command, subagent, and MCP config from the lastdiscover, snapshotted by path + content hash into <data-dir>/approved.json. From then on, discover flags anything that appears or changes outside that baseline with a GOV-UNAPPROVED finding — even if its content scans clean, because nobody approved it. This is the control behind OWASP AST09 (Governance).
Governance is opt-in and local — no baseline file, no
GOV-UNAPPROVED findings, nothing sent anywhere. Run approve only after you have reviewed the inventory; approving artifacts you have not looked at defeats the purpose. Review a flagged item, then re-run approve to fold it in. See Governance.serve
Run the local dashboard (and, on macOS, the runtime tap + redaction). Watches your project folders and rescans within seconds of any change, pruning anything you delete.Base port. The tap listens on
<PORT>; the dashboard is served on <PORT> + 1 — so the default dashboard URL is http://localhost:8789.serve runs, the correlation engine joins what the scanner flagged with what the tap actually observes: when live LLM traffic matches a flagged skill (for example, a request to the same host a flagged skill calls out to), a correlation is recorded to the encrypted local store and surfaces on the dashboard and in gw-cli report. A flagged skill that also appears in live traffic is runtime-confirmed risk, not just a static finding.
scan
Score a single skill file or directory that is already on disk, and print its risk.vet
Vet a skill/repo from a git URL before installing it. Shallow-clones it into an isolated temp dir, scans every skill/script/MCP artifact, prints a verdict, then deletes the clone. Nothing is ever executed. The exit code is non-zero at or above--fail-on, so it can gate an install in a script or CI. Aliased as gw-cli check.
A git/GitHub URL or
owner/repo. Accepts owner/repo, github.com/owner/repo, .../releases/latest, .../tree/<branch>, SSH, and generic .git URLs.Scan with the built-in engine only. The clone still uses the network; the scan stays offline (no SkillSpector / OSV egress).
Condense output to a digest: the verdict plus finding tallies by category, no per-line dump. Combine with
--json for a compact JSON. A thorough engine can emit hundreds of findings — this makes them glanceable (e.g. Memory Poisoning ×114).vet also reports provenance for the cloned source (OWASP supply-chain): the HEAD commit, whether that commit is cryptographically signed, and whether the vetted ref is pinned (an immutable commit SHA or tag) or mutable (a branch or the default branch — a later install may fetch different code). It appears in the human report and, with --json, as a provenance object. Provenance is informational — it never changes the verdict or the exit code.
vet needs git on your PATH and network access to fetch. The scan itself can stay offline with --air-gap.setup
Install NVIDIA SkillSpector — the authoritative scan engine, far more precise than the built-in heuristics — pinned to a reviewed commit. The command discloses what it is and what leaves the machine, and asks before installing. SkillSpector is Apache-2.0 and installed from upstream; it is never bundled.doctor
Report the scanning environment: which engine a scan will actually use, SkillSpector / Python / uv status, and the current air-gap and LLM modes. Run it aftersetup (or any time results look off) to confirm the machine is scoring the way you expect.
accept
Accept (mark reviewed and trusted) findings so they stop counting against OWASP compliance and are dimmed in the dashboard. Per-skill accepts are pinned to the skill’s content hash, so a later change to the skill re-surfaces the finding as changed since approved. Opt-in and reversible — nothing is deleted.Skill (or governable artifact) to accept, matched by name or path substring. With
--rule, accepts just that rule on it; alone, accepts all of its current findings.With
--skill, accept just that rule on the skill. Alone, accept the rule fleet-wide (not hash-bound).report
Print a plain-text summary of the encrypted store — the current inventory and per-artifact risk — to the terminal, or push the stored snapshot to the console.Push the current stored snapshot to the Guardway console instead of printing a summary. Requires an enrolled endpoint; also flushes any queued reports from the offline outbox.
enroll
Enroll this endpoint with the Guardway console sodiscover --report / report --push can send findings. Saves the API key + console URL to <data-dir>/config.toml (mode 0600, never logged).
Reporting is opt-in and fail-safe: nothing is sent unless a key + URL are configured, secrets are redacted at source,
--air-gap disables it, and a failed push is queued to a local outbox and retried, so it never breaks a scan. You can also configure it via the GUARDWAY_CONSOLE_URL and GUARDWAY_API_KEY environment variables instead of enroll. A key the console issues is enrollment-only and cannot send reports itself: use it with enroll --verify, and the machine reports with its own credential.schedule
Auto-refresh: install (or remove) a scheduleddiscover --deep that runs periodically in the background — launchd on macOS, a systemd --user timer on Linux, Task Scheduler on Windows. Each run scans once and exits, so nothing stays resident; the dashboard shows the latest scan whenever you open it.
mitm
Capture all apps’ LLM traffic (including Claude Desktop) via a userspace TLS-inspection proxy. Auto-configures a local CA + the system HTTPS proxy and reverts both on exit. Only LLM hosts are intercepted; everything else passes through untouched. Prompts are shown redacted.Proxy port. The capture dashboard is served on
<PORT> + 1 (default http://localhost:8081).uninstall
Remove the agent safely, or repair a Claude Code installation that stopped working after an agent change. Un-wires Claude Code first, verifies from disk, and only then stops services and deletes anything — so a failed uninstall can never leave Claude Code pointed at a dead tap.Un-wire Claude Code and stop. The agent stays installed and running. This is the command to run
when Claude Code hangs after an agent change.
Keep scan history, logs, and the data directories. The console credential is kept too, so Fleet
does not show the machine as Uninstalled.
Leave org policy controls in the harness settings. Can leave Claude Code restricted to the
sanctioned skill list after the agent is gone; the command says so when it applies.
/usr/local/bin/guardway-uninstall (installed by the .pkg), which
accepts the same flags. Run that script directly if gw-cli is missing or will not start — it is
plain bash and needs no Guardway tooling. On Linux and Windows the same teardown runs inside
gw-cli itself.
From agent 0.2.217, a full uninstall hands the machine’s console credential back before it removes
the data, so Fleet shows the machine as Uninstalled; see
What Fleet shows after a removal.
Exit codes: 0 clean · 1 usage error · 2 verification failed and nothing was removed — the
tap was deliberately left running, so a failed uninstall is never an outage. Fix what it names and
re-run; the script is idempotent.
See Uninstall & Recovery for the full order of operations and
what to do about already-open sessions.
demo
Seed a deliberately-risky demo skill, scan it, and store it — see the full pipeline end-to-end with no setup.enable
Turn on the observe-first agent for your own account only (no sudo). Customer machines use the package, which installs the managed agent;enable is for trying the agent on one account. It tails Claude Code’s own session transcript instead of proxying it, so it never sits in the request path, and runs as a per-user LaunchAgent (macOS) or systemd --user service (Linux) writing to ~/.guardway. For fleets that require egress enforcement, use hook --managed.
autostart
Keep the runtime tap always-on without sudo, so you never rungw-cli serve by hand — a per-user launchd agent (macOS) or systemd --user service (Linux). The packages (MSI, .pkg, .deb and .rpm) set this up themselves; the fleet/enterprise equivalent is hook --managed.
hook
Point AI clients at the tap by editing the clients’ own settings (no per-shell env vars), and, with--managed, install the system-level enforcement daemon.
System-level enforcement (root): managed-settings + an always-on daemon (Mode B). The MDM
.pkg postinstall runs exactly this.Observe-first managed install (root): no proxy, no root daemon — starts the per-user agent (Mode A).
guard
Wire Claude Code’s PreToolUse hook so tool calls are checked against policy before they run — the in-harness gate a userspace proxy structurally can’t provide. Starts in observe: every match is recorded, nothing is ever blocked.telemetry
Wire Claude Code’s native OpenTelemetry export to this agent, so reported USD cost, tokens and sessions flow into the dashboard.gateway
Configure the gateway relay — route this tap’s LLM traffic through a Guardway gateway, swapping the client’s key for an org virtual key. A baregw-cli gateway with no flags reports the current config instead of writing it.
observe (default) forwards to the vendor unchanged; enforce relays and fails closed (502) when the gateway is down.With
enforce: fall back to the vendor with the client’s own key when the gateway doesn’t serve the request, recorded per request as VendorFallback so the gap is never silent.Suspend the console’s relay contributions locally for
--break-glass-minutes <N> (default 60, max 1440); --end-break-glass ends it now.This governs only traffic already pointed at the tap — it is gateway-relay egress control, not in-harness pre-tool enforcement (that’s
guard).sync
Exchange everything with the console now, instead of waiting out the cadence: pull the org’s Detection Policy, AI Control policy and pricing table, push a fresh report, then apply what arrived and rescan. This is what the Glass Bar / tray Sync button runs.Only pull (policies, AI control, pricing). Works with the agent running — a pull writes cache files, never the store.
skills
Skill custody: what the org has blocked, what this machine did about it, and the way back. Read-only by default.Run a custody pass now. Moves files only on a managed, enforcing install with the
skill_custody gate open and no break-glass.Give one quarantined skill back by its quarantine id (audited).
--displace moves aside whatever now occupies its origin path.aibom
Emit a Runtime-Verified AIBOM — a CycloneDX 1.6 Bill of Materials of this machine’s AI surface.policy
Show the effective org Detection Policy on this machine, and any enforcement-posture gap.aicontrol
Inspect the effective AI Control Policy — the harness managed-settings remediation (YOLO lock, MCP catalogs, org login), separate from the Detection Policy (gw-cli policy). Run gw-cli aicontrol --help for its subcommands.
Related
- Overview — what the Guardway CLI is and how to install it.
- Inventory & Risk Scoring — risk levels, engines, verdicts.
- Local Dashboard — the
servedashboard. - Skill Custody — the custody flow behind
skills.