Skip to content
Back to skills

Guardian Scan

ASecurity

Use to scan code with the Apiiro CLI for secrets, leaked credentials, or vulnerable OSS dependencies, set up pre-commit hooks, or diff-scan branches and PRs for CI gates (\"check my code before I push\", \"scan this PR\").

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 11, 2026
securitybashgitapici/cdsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add apiiro/marketplace --skill guardian-scan --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Guardian Scan?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Guardian Scan
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/apiiro-guardian-scan/badge)](https://www.skillsdirectory.com/skills/apiiro-guardian-scan)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: guardian-scan
description: "Use to scan code with the Apiiro CLI for secrets, leaked credentials, or vulnerable OSS dependencies, set up pre-commit hooks, or diff-scan branches and PRs for CI gates (\"check my code before I push\", \"scan this PR\")."
---

# Apiiro Scan

Security scanning via the Apiiro CLI. Two modes:

- **Fast scan** — quick local scan for secrets and OSS vulnerabilities. Requires a git repo with an `origin` remote. Auto-detects changed files when none specified.
- **Diff scan** — compare two git references for security risks. Primary CI/CD integration point.

## Fast Scan

```bash
apiiro fast-scan secrets                          # Scan for secrets
apiiro fast-scan secrets src/config.ts            # Scan specific files
apiiro fast-scan secrets --staged                 # Staged files only (pre-commit)
apiiro fast-scan oss package.json bun.lock        # OSS vulnerabilities
apiiro fast-scan all                              # Both concurrently
apiiro fast-scan config                           # Get scan configuration
```

Options: `--staged`, `--full` (scan entire file, not just git-changed lines), `--timeout <seconds>` (default: 2, max: 5 — higher values are clamped with a warning), `--fail-on <severity>` (`any` (default), `none`, or `informational|low|medium|high|critical`), `-o, --output <json|text>`, `-f, --file <path>`.

Exit codes: 0 = clean, 1 = findings at or above the `--fail-on` threshold (default: any finding) or a block by the organization's prevention workflows. When the scan response carries a server verdict (the organization defines prevention workflows), that verdict decides instead of the default threshold: `Block` fails, `Warn`/`Success` do not. An explicitly passed `--fail-on <severity>` stays a floor under a `Success` verdict; `--fail-on none` always keeps exit 0.

### Git Hooks

```bash
apiiro hooks pre-commit install                   # Install pre-commit (scans all types), post-commit and post-rewrite
apiiro hooks pre-commit install --scan-type secrets --force
apiiro hooks pre-commit install --global          # Opt in to the global core.hooksPath directory instead
apiiro hooks pre-commit status
apiiro hooks pre-commit uninstall
```

The pre-commit hook scans staged files; skip it temporarily with `git commit --no-verify`. The post-commit and post-rewrite hooks link each new, amended, or rebased commit to the coding session that produced it and never block a commit. An existing hook is kept as `<hook>.pre-apiiro` and runs first; `--force` overwrites it instead.

## Diff Scan

```bash
apiiro diff-scan -b main -c feature-branch -r https://github.com/org/repo --wait
apiiro diff-scan -b main -c feature-branch -r https://github.com/org/repo --wait --wait-external
apiiro diff-scan -b abc123 -c def456 -r <repo-url> --baseline-type Commit --candidate-type Commit --wait
apiiro diff-scan -s <scan-id>                     # Check existing scan status
apiiro diff-scan -i                               # Interactive mode
```

Exit codes: 0 = success/warn, 1 = blocked/failed, 2 = scan still pending.

`--wait` polls until results land. `--timeout <seconds>` bounds the wait (default: 300). When the timeout elapses, exit code 2 is returned along with the scan ID so the user can re-check later with `-s <scan-id>`.

## Global Options

`-o, --output <json|text>`, `-f, --file <path>`, `--no-color`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.