Safeguard Docs

Local Runner

The runner built into the Safeguard CLI, which executes the platform's scan jobs and assistant turns on your own machine.

Local Runner

The runner is not a separate product. It is part of the safeguard CLI: open the interactive terminal, sign in, and the machine starts polling the platform for work assigned to it. It runs each scan job locally and uploads only the resulting SBOM and findings, never your source code.

When to use it

  • Your repository is private and you can't (or won't) give a cloud service OAuth access.
  • You're working in a restricted network, where only outbound HTTPS is allowed.
  • You want the assistant to fix vulnerabilities in code you haven't pushed yet.

Install

The runner ships with the CLI. Use the one-line installer:

# macOS and Linux
curl -fsSL https://registry.safeguard.sh/cli/safeguard/install | bash
# Windows
irm https://registry.safeguard.sh/cli/safeguard/install.ps1 | iex

See CLI installation for version pinning and checksums.

First run

safeguard

Type /login. Your browser opens, you approve the session, and the runner starts. The first run also downloads the scanner tools and the vulnerability database. safeguard runner opens the same terminal.

How it works

  1. The runner sends a heartbeat and polls the platform for jobs assigned to this machine. All traffic is outbound HTTPS that the runner opens; nothing connects to it.
  2. It executes a claimed job with its own local scan server.
  3. It uploads the result files (SBOM and findings) and reports the job status. Source code stays on the machine.

Scan credentials from the vault

A runner can read a shared Credentials Vault entry by its handle (sgvault://<handle>) when a scan starts, so the secret is never typed into the scan target. Reading credentials straight from your own PAM through the runner is rolling out.

Headless

# Start without the terminal UI and serve assistant turns for this workspace
safeguard runner start --workspace ./path/to/repo

# Is it running, and what is it doing
safeguard runner status

# Drain in-flight work and stop
safeguard runner stop

runner start long-polls by default. On a network that forbids held connections, pass --poll-wait 0 to poll at a fixed interval (SAFEGUARD_POLL_INTERVAL seconds, default 10). --permission-mode sets what the assistant may do without asking. The six modes are separate choices, not a scale:

  • supervised (default): only reads run without asking.
  • edits: plus edits in the workspace and allow-listed commands.
  • plan: reads only; anything that changes things is refused.
  • guarded: what the workspace policy allows runs; the rest asks.
  • strict: only pre-approved actions run; everything else is denied (for CI).
  • autonomous: everything runs; refused outside a sandbox unless --dangerously-skip-permissions is passed.

The earlier names ask, auto and yolo still work and map to supervised, guarded and autonomous.

Sign in without a browser

Sign-in uses the OAuth device flow, so the machine that runs the runner does not need a browser. On a server or VM:

safeguard login --no-browser

The CLI prints a verification URL and a code. Open the URL on any device that has a browser, enter the code, and approve. The CLI picks the session up and saves it. If the machine is already signed in, login says so and stops; safeguard login --force signs in as someone else. Then start the runner headless with safeguard runner scan-jobs (platform scan jobs) or safeguard runner start (assistant turns).

# Take the platform's repository, image, directory and SBOM scans, headless
safeguard runner scan-jobs

Repository and directory scans include source analysis in builds that carry the engine. Quoted source lines are removed from those findings before upload; set SAFEGUARD_UPLOAD_CODE_SNIPPETS=true to send them.

Run it as a login service

safeguard runner install --workspace ./path/to/repo
safeguard runner uninstall

install registers safeguard runner start as a per-user service that starts at login: a systemd user unit on Linux, a LaunchAgent on macOS and a logon scheduled task on Windows. Sign in first. uninstall stops the service and removes it. safeguard runner status --json reports whether it is running and whether the service is installed.

Network requirements

The runner only opens outbound HTTPS on port 443. Nothing listens on a port. Allow these hostnames:

HostnameUsed for
app.safeguard.shThe platform web app
api.safeguard.shSign-in, heartbeat, job polling and result upload
registry.safeguard.shCLI installer, release feed and safeguard self-update
get.safeguard.shCLI update feed (allowed host)
*.oraclecloud.comRelease downloads, which the feed redirects to

Scanner tool and vulnerability database downloads on first run use additional hosts. This page does not list them: if your firewall blocks the first-run download, allow the host the CLI reports in its error.

Proxy

The runner reads the standard HTTPS_PROXY, HTTP_PROXY and NO_PROXY environment variables. Set them in the environment of the process, or of the service you installed. There is no Safeguard-specific proxy flag or setting.

Custom CA bundle

The runner verifies certificates against the operating system trust store, and on Linux also honours SSL_CERT_FILE and SSL_CERT_DIR. If a TLS-inspecting proxy re-signs traffic, add its root certificate to the system store or point SSL_CERT_FILE at a bundle that contains it. There is no Safeguard-specific CA flag, and certificate checking cannot be turned off.

Checkpoints

When the assistant changes files, it snapshots them first. List a session's checkpoints and put the files back as they were:

safeguard checkpoints list --session <id>
safeguard checkpoints restore <checkpoint> --session <id> --dry-run
safeguard checkpoints restore <checkpoint> --session <id> --files-only

--dry-run shows what would change as a diff. A restore keeps the state it overwrites as a new checkpoint, so it can be undone. Without --files-only the session transcript is rolled back to the same point, as /rewind does. safeguard sessions lists session ids.

Assistant

# Interactive, in this workspace
safeguard agent "fix the critical CVEs in this repository"

# One turn, no prompts, for scripts and CI
safeguard exec "summarise the critical findings"

safeguard exec defaults to strict permissions, where nothing is asked and anything the policy file has not pre-approved is denied.

Updates

safeguard self-update

safeguard update is different: it refreshes the vulnerability databases, not the binary.

On this page