──[ ▮ ]── for ai agents
ShipGuard for AI agents
If you are an AI coding agent — or you are configuring one — this page is the complete integration reference. ShipGuard is a local, deterministic pre-ship gate: run it after every edit, fix what it blocks, ship with confidence.
TL;DR
- Canonical command:
npx @agenticcli/shipguard scan --changed --strict --json exit 0= safe to proceed.exit 1= fix findings whereblocking:true, then re-scan.- 5 check modules — secrets, auth, payments, database, deployment. All run locally.
- Code never leaves your machine. Free tier: zero network calls during a scan.
Install — one command per tool
Run after every edit batch. Add to your CLAUDE.md as a pre-ship gate: "Before declaring any task done, run this command and fix anything with blocking:true."
Or add as a hook in settings.json to run automatically on task completion.
Same command works in Cursor and Codex CLI. Add to your system prompt or agent instructions. The exit code is machine-parseable — no screen-scraping.
Add after your build step. Use fetch-depth: 0 in your checkout action so --changed has git history. Exit code 1 blocks the job automatically.
Requires: actions/checkout@v4 with fetch-depth: 0
Add to .git/hooks/pre-push or use husky. Runs the full working-tree scan on every push. Omit --changed to catch everything, not just the diff.
Copy-paste system-prompt snippet
Drop this into your CLAUDE.md, Cursor rules, or agent system prompt to make the gate automatic:
why --strict matters
Without --strict, exit 1 is never emitted.
--strict, blocking findings appear in the JSON output but the process exits 0 — so your fix loop never fires. Always pass --strict in agentic contexts.Frequently asked questions
How do exit codes work?
What is in the --json output?
How does the agent fix loop work?
Does my code leave my machine?
What does --strict do?
What is the difference between --changed and scanning everything?
When to use / when NOT to use
✓ Use ShipGuard when…
- →You are a coding agent that just edited files and needs a pre-commit gate.
- →You are wiring a CI check to block deploys of AI-generated code.
- →You want a fast, free, local check for hardcoded keys, unguarded routes, or unverified webhooks.
- →You need a machine-parseable verdict (exit code + --json) not a human-readable report.
- →Your stack is Next.js + Supabase/Firebase or any Node.js app. ShipGuard is tuned for it.
✗ Do NOT use as your only tool for…
- →Dependency / SCA scanning — use Snyk, Socket, or npm audit for CVEs in node_modules.
- →SAST at enterprise scale — ShipGuard is a first gate, not a full SAST platform.
- →License compliance — ShipGuard does not check dependency licenses.
- →Runtime security monitoring — ShipGuard is a static pre-ship check only.
Comparison — ShipGuard vs Snyk / npm audit / eslint-security
These are complementary tools, not alternatives. Use ShipGuard as your fast first gate; add Snyk or npm audit for dependency scanning.
| Feature | ShipGuard | Snyk Code | npm audit | eslint-security |
|---|---|---|---|---|
| Runs locally | yes — always | no — cloud | yes | yes |
| Exit codes | 0 / 1 / 2 / 3 | 0 / 1 | 0 / 1 | 0 / 1 |
| --json output | yes (structured findings) | yes | yes | yes (--format json) |
| Secrets (hardcoded keys) | yes — 5+ patterns | partial (Code only) | no | partial (plugins) |
| Auth route guards | yes — Next.js, Express, Fastify | no | no | no |
| Payment webhook sigs | yes — Stripe, Razorpay | no | no | no |
| Dependency / SCA | no — first gate only | yes — primary focus | yes | no |
| Price | free forever (core) | free tier / paid | free (npm) | free |
Real-findings example — finding → fix → re-scan → exit 0
A hardcoded OpenAI key in src/lib/openai.ts — a pattern agents introduce regularly.
1. The finding
2. The --json output (exit code 1)
3. Apply the fix from findings[].fix
4. Re-scan — exit 0
exit 0 → safe to commit and deploy.
Machine-readable contract
Exit codes
| Code | Meaning |
|---|---|
| exit 0 | Safe — no blocking findings (or --strict not passed) |
| exit 1 | Blocked — --strict AND at least one finding with blocking:true |
| exit 2 | Config/degraded — pro rules unavailable, files skipped, scan incomplete |
| exit 3 | Runtime error — the scan itself failed (permissions, git error, etc.) |
Machine-readable surfaces
Updated 2026-06-24
- ›2026-06-24 — page launched. Per-tool install tabs, system-prompt snippet, FAQ, comparison table, real example, JSON-LD schema.
- ›2026-06-24 — exit code contract corrected: exit 1 requires --strict; exit 3 (runtime error) documented.
start free
Gate your next deploy in 30 seconds.