Safeguard
Coding Agents•

Safeguard CLI vs Claude Code and Codex: Fewer Approval Prompts

Safeguard CLI, Claude Code and Codex all ask before risky actions. Set a Safeguard policy once so safe work runs unasked and only real risk stops you.

Safeguard Security Team
11 min read

The Safeguard CLI is a coding agent for your terminal that asks for approval only where your policy says it should. You pick one of six permission modes and a policy file once, so reads and routine edits run without a prompt, while risky commands still stop and say why. Claude Code and Codex also offer modes that cut prompts; the difference is how you set the boundary.

Approvals protect you. The pain is not the prompt before git push; it is the twentieth prompt for a one-line edit. Here is how the three tools compare as of 22 November 2026, and how to set Safeguard up once.

Key takeaways

  • All three ask before changes by default, and all three let you relax that.
  • The Safeguard CLI has six separate modes: supervised (the default), edits, plan, guarded, strict and autonomous.
  • In edits and guarded, what your policy file allows runs unasked; everything else asks.
  • Autonomous mode, with no prompts, is refused outside a sandbox unless you pass --dangerously-skip-permissions (alias --yolo).
  • safeguard exec for CI defaults to strict: nothing asks, and anything not pre-approved is denied.

Why do coding agents ask for approval so often?

An agent runs model-written commands on your machine, and a wrong rm or push costs more than a prompt. So every tool asks before changes by default.

The cost comes when the same safe action asks again and again. People then switch prompts off for the whole session, which removes the protection exactly when an unusual command appears. The fix is a boundary set once: routine work allowed, risky work asked. We covered the thinking behind this in scoping agent permissions for DevOps tools and why an approval click alone proves little.

How do Claude Code, Codex CLI and Safeguard CLI permission models compare?

Claude Code is Anthropic's coding agent for the terminal, IDE and desktop. Codex is OpenAI's coding agent for the CLI, IDE and ChatGPT desktop app; its CLI is open source under Apache 2.0. The Safeguard CLI is a coding agent that also scans code, images and SBOMs for vulnerabilities. Facts below are from each vendor's docs, checked 22 November 2026.

Safeguard CLI (11.19.21)Claude CodeCodex CLI
Defaultsupervised: reads run, the rest asks (docs)Manual: prompts before most edits, commands and network requests (docs)Ask for approval: pauses before leaving the workspace (docs)
Fewer promptsedits; guarded (what your policy file allows runs) (docs)acceptEdits; auto (a classifier reviews actions) (docs)Approve for me (automatic review) (docs)
Read onlyplan: changes refused (docs)plan (docs)read-only via /permissions (docs)
Unattendedstrict, the safeguard exec default (docs)dontAsk: denies what would prompt (docs)sandbox and approval policy in config.toml (docs)
No promptsautonomous: needs a sandbox or --dangerously-skip-permissions (docs)bypassPermissions, for isolated containers or VMs (docs)Full access (docs)

Claude Code adds allow, ask and deny rules. Codex pairs an OS-enforced sandbox, network off by default, with an approval policy. Safeguard puts the boundary in a per-workspace policy file with six fixed modes.

How does the Safeguard CLI decide when to ask?

Reads run. Anything that changes something is checked against your mode and policy file: allowed runs, the rest asks, and in strict it is denied without a prompt.

Safeguard CLI approval flow: reads run, changes are checked against the mode and policy file, then run, ask or are deniedTool callRead: runsChange: checkmode + policy fileAllowed: runsElse: asks youstrict: denied
How the Safeguard CLI decides: reads run, changes run only where your mode and policy allow them.

The modes are separate choices, not a ladder, and the current mode always shows in the bar under the input.

Settings layer from ~/.safeguard/settings.json to the repository's .safeguard/settings.json, your settings.local.json, then flags. A repository's settings apply only after you run safeguard trust in it (docs).

When it asks, the prompt names the exact command and offers Yes, "Yes, and don't ask again" for that exact command this session, or No. Approving one go test never approves a later rm. Deny rules run before allow rules, so a denied command never reaches you.

How do I set a policy once so routine work stops prompting?

Write the boundary into the workspace policy file:

# .safeguard/policy.yaml
mode: edits
allow_commands:
  - "go test *"
  - "npm test"
  - "npm install *"
deny_commands:
  - "git push *"
  - "sudo *"

In edits, workspace edits and these commands run unasked; other commands ask. Use /permissions or Shift+Tab to change mode.

You may be able to keep the Claude, ChatGPT or Codex plan you already have alongside Safeguard; see /model, the CLI docs and your provider's terms.

Can I approve from my phone or desktop?

Yes. The desktop app lets you approve or deny destructive actions before they run (docs). The download page also lists desktop apps for Windows, macOS and Linux, iOS and Android apps, IDE extensions, and a cloud sandbox free for seven days.

Try it: install, set a mode, fix a vulnerability

  1. Install on macOS or Linux: curl -fsSL https://registry.safeguard.sh/cli/safeguard/install | bash. On Windows, follow the installation guide.
  2. Open a terminal in your repository and run safeguard, then type /login.
  3. Type /permissions and choose edits.
  4. Ask: "fix the lodash CVE in this repo". It edits the manifest and asks before any command your policy does not allow.
  5. Review the diff and run your tests. In CI, safeguard exec runs strict by default.

More: scan a repo in five minutes, your first CLI scan, the CLI developer workflow, Claude Code security guide and agent blast radius.

FAQ

What are the Safeguard CLI permission modes?

supervised (default), edits, plan, guarded, strict and autonomous. The older names ask, auto and yolo still work as aliases for supervised, guarded and autonomous.

Does the Safeguard CLI have a yolo mode?

Autonomous runs everything without asking. Outside a sandbox it is refused unless you pass --dangerously-skip-permissions, alias --yolo.

Do Claude Code and Codex have modes with fewer prompts?

Yes. Claude Code has acceptEdits, auto and bypassPermissions; Codex has Approve for me and Full access, per their docs.

Which Safeguard mode should I use in CI?

strict, the safeguard exec default: nothing waits on a prompt.

Can a cloned repository change my Safeguard permissions?

Its settings apply only after you run safeguard trust in it.

Does the Safeguard CLI write code?

Yes. It edits files and runs commands with your approval, and scans dependencies for vulnerabilities.

Approval prompts guard what the agent does; the dependencies it installs need their own care. Whichever agent you use, many fixes come from upstream, so close that gap too.

Fix it without waiting for upstream

Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.

1. Autonomous remediation: pull requests, not tickets

When a fixed version exists, Griffin, Safeguard's security model, opens a policy gated pull request that moves the affected dependency to the safe version, and your own CI runs your tests on it before anyone merges. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation categories include dependencies, licenses, security posture and findings, and each one is set separately. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Auto-merge is a separate switch and stays off by default, so your team decides what merges on its own and what still needs a human approval.

2. Gold Open Source: the safe version in seconds, free

gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds.

3. Gold Registry: start from components that are already fixed

Safeguard Gold rebuilds patched versions of open-source packages and images from source, signs each build, attaches an SBOM, SLSA provenance and VEX, and serves them from registry.safeguard.sh to your organization. Every Gold artifact is held continuously to zero exploitable critical or high CVEs and a completed license check, with signed build provenance (signed with Safeguard's key and verifiable with cosign, SLSA Build Level 3 as the design target) and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.

When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened build of a specific package. Ask which packages it covers before you plan around it.

Your situationWhat to use
A fixed version existsAutonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version
You need to know today whether you are affectedGold Open Source lookup and "Am I affected?" checker, free and without login
You want vulnerable versions to stop shippingSafeguard policies and gates in CI
Upstream has no fix yet, or will not ship oneA custom Gold request; fork and patch
You want to start clean on new projectsPull hardened components and images from Gold Registry

One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.

See how Safeguard would help

This demo sets up the CLI runner on your machine, approves it with its device code, then scans from the terminal.

Click through it at your own pace, or open it full screen.

Two more walkthroughs: attach a computer running the CLI, ask for a fix and approve the command before it runs, and find and fix a vulnerability. Get the CLI at safeguard.sh/download and read the CLI docs.

Sources

Last reviewed: 22 November 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

We email you a link to confirm, and only then add you to the list. Unsubscribe in one click. Privacy

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.