Skip to main content

vulkro guard

Scan each file as an AI coding agent writes it and feed findings back so the agent fixes them.

vulkro guard install --agent claude-code --scope project
vulkro guard status

guard install adds a hook so vulkro guard check runs on every file write. vulkro mcp serve offers the scanner as a tool the agent may call; guard makes the scan happen every time.

It runs offline with no token cost, but it is not instant: each check scans the whole project and then narrows to the one file, because a sink in that file may only be provable from a source elsewhere. On a large repository a check can take minutes. Time it on your repo before you install the hook.

guard check [FILE]​

Returns one of three verdicts. It never calls a file clean or safe.

VerdictWhen
BlockA proven finding at any severity, or any finding at High or Critical. The agent should regenerate.
ReviewSomething was found but nothing blocks (including Not checked findings), or the file was skipped.
SilentThe file was read and nothing was found.

--hook-format sets the protocol:

ValueBehaviour
generic (default)JSON on stdout. Exit 0 silent, 2 block or review.
claude-codeAlways exit 0. {"decision":"block",...} on a block. Reads the file from the hook's stdin when no path is given.
cursorAlways exit 0. {"permission":"deny",...} on a block. Reads the file from stdin when no path is given.

Without a licence, check does not scan or block: it returns a notice with the license_required marker.

guard install, uninstall, status​

FlagDescription
--agent <AGENT>claude-code (default), cursor, windsurf (best effort) or all.
--scope <SCOPE>user (default, every project) or project (this repo, can be committed).

install merges into the existing config and is safe to re-run. uninstall removes only the Vulkro entry. status shows which agents are wired.

Exit codes​

check uses the hook protocol above, and exits 2 on an operational error. install, uninstall and status: 0 success, 2 error.

See also: AI code audit.

Command reference​

Generated from vulkro guard --help (vulkro 0.41.0). Run scripts/gen-docs.sh in the product repository to refresh it; do not edit this section by hand.

Watch files as an AI coding agent writes them and feed findings back.

vulkro guard [OPTIONS] <COMMAND>
CommandWhat it does
checkScan a single file FAST and emit a verdict the agent loop can consume. Reuses the standard scanner (same result as vulkro scan), filtered to the one file, with no network call.
installIdempotently wire vulkro guard check into an agent's hook config so it runs on every file write / edit. Merges into the existing config without clobbering unrelated keys; re-running does not duplicate. Prints the file it changed and how to undo.
uninstallRemove the guard hook that install added, idempotently. Removes only the vulkro-managed entry; the user's own hooks and unrelated keys are preserved. Re-running after removal is a no-op.
statusShow which agents are wired to run vulkro guard check, the config file each uses, and whether the integration is solid or best-effort. Read-only.
read-outlineClaude Code Read hook: hand an agent a large file's outline before it reads the whole file.

Options​

FlagDescription
--offlineHard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set.
-q, --quietPrint only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged.
--no-colorTurn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb.
-h, --helpPrint help (see a summary with '-h')

vulkro guard check​

Scan a single file FAST and emit a verdict the agent loop can consume. Reuses the standard scanner (same result as vulkro scan), filtered to the one file, with no network call.

vulkro guard check [OPTIONS] [FILE]

Arguments​

ArgumentDescription
[FILE]Path to the file to scan. Omit it only when piping agent hook JSON on stdin together with --hook-format

Options​

FlagDescription
--hook-format <HOOK_FORMAT>Output / exit protocol to emit. Defaults to generic Default: generic.
--offlineHard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set.
--fullScan the whole project, then narrow to the file (the pre-0.37 check), and refresh the project map later checks read.
-q, --quietPrint only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged.
--min-confidence <MIN_CONFIDENCE>Lowest confidence that counts toward the verdict. Medium by default, the same floor vulkro scan, the editor and mcp serve apply. Default: medium. Possible values: high, medium, low.
--no-colorTurn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb.
-h, --helpPrint help (see a summary with '-h')

vulkro guard install​

Idempotently wire vulkro guard check into an agent's hook config so it runs on every file write / edit. Merges into the existing config without clobbering unrelated keys; re-running does not duplicate. Prints the file it changed and how to undo.

vulkro guard install [OPTIONS]

Options​

FlagDescription
--agent <AGENT>Which agent to wire. Defaults to claude-code (the most solid integration). all wires every supported agent. Default: claude-code.
--offlineHard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set.
-q, --quietPrint only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged.
--scope <SCOPE>Config scope: user (all projects, the default) or project (this repo only, checked into version control) Default: user.
--no-colorTurn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb.
-h, --helpPrint help (see a summary with '-h')

vulkro guard uninstall​

Remove the guard hook that install added, idempotently. Removes only the vulkro-managed entry; the user's own hooks and unrelated keys are preserved. Re-running after removal is a no-op.

vulkro guard uninstall [OPTIONS]

Options​

FlagDescription
--agent <AGENT>Which agent to unwire. Defaults to claude-code. all unwires every supported agent. Default: claude-code.
--offlineHard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set.
-q, --quietPrint only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged.
--scope <SCOPE>Config scope to unwire. Defaults to user Default: user.
--no-colorTurn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb.
-h, --helpPrint help (see a summary with '-h')

vulkro guard status​

Show which agents are wired to run vulkro guard check, the config file each uses, and whether the integration is solid or best-effort. Read-only.

vulkro guard status [OPTIONS]

Options​

FlagDescription
--offlineHard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set.
--scope <SCOPE>Config scope to report. Defaults to user Default: user.
-q, --quietPrint only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged.
--no-colorTurn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb.
-h, --helpPrint help (see a summary with '-h')

vulkro guard read-outline​

Claude Code Read hook: hand an agent a large file's outline before it reads the whole file.

vulkro guard read-outline [OPTIONS]

Options​

FlagDescription
--min-lines <MIN_LINES>Files with fewer lines than this are always read whole. Default: 400.
--offlineHard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set.
-q, --quietPrint only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged.
--no-colorTurn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb.
-h, --helpPrint help (see a summary with '-h')
Full vulkro guard --help
Watch files as an AI coding agent writes them and feed findings back.

In-loop security guard for AI coding agents: scan files as the agent writes them and feed findings back, blocking and asking for a regenerate on a finding vulkro can prove or one at the HIGH / CRITICAL floor, and surfacing the rest for review. It never reports a file as clean: a static scan of code that has not been run cannot establish that a file is safe.

Where `vulkro mcp serve` exposes the scanner as an MCP TOOL the agent may choose to call (discovery), `vulkro guard` wires the scanner into the agent's HOOK system so a scan runs on every file write / edit whether the agent asks for it or not (enforcement). The two compose: run `mcp serve` for on-demand scans and `guard install` to make scanning mandatory in the write loop.

Fully offline: no network call and no token cost. It is NOT low latency. Each check walks up to the project root and scans the WHOLE project before narrowing the verdict to the one file, because a sink in the edited file can only be proven from a source in another one, so the cost tracks repository size rather than file size: under a second on a two-file fixture, and 231.3 s wall / 343 s CPU for one file on the vulkro repository itself (debug build). Measure it against your own repo before installing the hook.

Sub-actions: * `check <FILE>` scan one file, emit a verdict the agent consumes. * `install` wire the hook into an agent's config. * `uninstall` remove the hook the guard installed. * `status` show which agents are wired. * `read-outline` Claude Code Read hook: an outline first.

"Hook" words: `install-hook` installs git hooks; `guard` is everything that hooks into an AI coding agent.

Exit codes: see each sub-action's `--help`. `check` uses a hook exit/stdout protocol that differs from vulkro's usual 0/1/2 contract (a hook needs a non-zero "block" signal on findings); `install` / `uninstall` / `status` use 0 = success, 2 = error.

Usage: vulkro guard [OPTIONS] <COMMAND>

Commands:
check Scan a single file FAST and emit a verdict the agent loop can consume. Reuses the standard scanner (same result as `vulkro scan`), filtered to the one file, with no network call
install Idempotently wire `vulkro guard check` into an agent's hook config so it runs on every file write / edit. Merges into the existing config without clobbering unrelated keys; re-running does not duplicate. Prints the file it changed and how to undo
uninstall Remove the guard hook that `install` added, idempotently. Removes only the vulkro-managed entry; the user's own hooks and unrelated keys are preserved. Re-running after removal is a no-op
status Show which agents are wired to run `vulkro guard check`, the config file each uses, and whether the integration is solid or best-effort. Read-only
read-outline Claude Code Read hook: hand an agent a large file's outline before it reads the whole file
help Print this message or the help of the given subcommand(s)

Options:
--offline
Hard-disable every outbound network call for this run (sets VULKRO_OFFLINE=1). Blocks the CVE feed, the license heartbeat, the update check, webhooks, and any cloud AI endpoint; a loopback model (http://127.0.0.1, http://localhost) is still allowed. Equivalent to exporting VULKRO_OFFLINE=1, and the flag wins when both are set

-q, --quiet
Print only warnings and errors on stderr: no progress, tips or next-step hints. Results on stdout and exit codes are unchanged

--no-color
Turn off coloured output. Colour is also off when NO_COLOR is set to a non-empty value or TERM=dumb

-h, --help
Print help (see a summary with '-h')