Supply chain security for pnpm repositories and GitHub Actions.
Guard helps teams answer one question before a dependency or CI change lands:
Can we trust this change?
It combines:
- repository posture checks,
- dependency and lockfile review,
- workflow hardening,
- policy validation and exceptions,
- machine-readable output for CI and automation.
Links:
| Target | Install |
|---|---|
| Claude Code | claude plugins marketplace add MauroProto/guard && claude plugins install guard@guard |
| Guard CLI (Go) | go install github.com/MauroProto/guard/cmd/guard@latest |
| Guard CLI (shell) | curl -fsSL https://raw.githubusercontent.com/MauroProto/guard/main/install.sh | sh |
| From source | git clone https://github.com/MauroProto/guard.git && cd guard && make install |
go install is the preferred CLI install path. The shell installer uses
pre-built release binaries only when Go is unavailable, and it requires a
matching SHA-256 checksum unless GUARD_INSTALL_INSECURE=1 is set explicitly
for local testing.
If the Claude Code plugin cannot find the guard binary in PATH, set:
export GUARD_BIN=/absolute/path/to/guardGuard is a hybrid product:
- Guard CLI stays first-class for CI, SARIF, JSON, headless scans,
review-pr,baseline, andpolicy lint. - Claude Code plugin adds focused, contextual Guard runs inside edit sessions without replacing the CLI.
The plugin is distributed from this repository through .claude-plugin/marketplace.json, and the Claude Code plugin itself lives at:
plugins/claude-code/guard-security
guard init
guard scan
guard fix
guard baseline recordFor a PR or branch review:
guard review-pr
guard review-pr --base origin/main --head HEAD --format markdown
guard explain review.diff.install_script.addedFor focused scans:
guard scan --scope workflows --format json
guard scan --scope deps --files package.json,pnpm-lock.yaml --format json
guard scan --scope policy --files .guard/policy.yaml --format json
guard scan --changed-files --format jsonThe plugin is designed to be useful, not noisy.
When enabled, it reacts to the right moments:
SessionStart- verifies Guard availability,
- detects repo root and key files,
- initializes light session state.
FileChanged- marks
deps,workflows,workspace, orpolicyas pending review.
- marks
PostToolUseonWrite|Edit- runs focused Guard scans in JSON mode for affected surfaces.
PreToolUseonBash- watches dependency mutation commands such as
pnpm add,pnpm up,pnpm install,npm install, andcorepack use. - also intercepts high-risk agent install commands such as plugin, skill, and MCP installs, plus clear remote bootstrap patterns like
curl ... | sh.
- watches dependency mutation commands such as
Stop- summarizes pending or blocking Guard scopes.
V1 behavior is intentionally balanced:
- no full scans on every event,
- no auto-fix from hooks,
- no blanket Bash blocking,
- no generic MCP or skill killing just because a command looks unfamiliar,
- no dependence on paths outside the installed plugin bundle.
claude --plugin-dir /absolute/path/to/guard/plugins/claude-code/guard-security| Command | Alias | Description |
|---|---|---|
guard scan |
guard s |
Scan the repository for security issues |
guard fix |
guard f |
Apply safe local remediations |
guard init |
guard i |
Create or patch a secure baseline |
guard ci |
guard c |
Strict scan mode for CI pipelines |
guard diff |
guard d |
Compare two package versions for risk signals |
guard review-pr |
guard review |
Review dependency and workflow changes between git refs |
guard approve |
guard ab |
Approve a package that needs build scripts |
guard baseline record |
- | Record the current finding set as baseline debt |
guard explain |
- | Explain a rule ID or a finding fingerprint |
guard policy lint |
- | Validate policy/config semantics and deprecated fields |
guard agent audit |
- | Audit installed MCPs, skills, plugins, and hooks |
- missing
pnpm-lock.yaml - missing
packageManagerinpackage.json - missing
engines.node
minimumReleaseAgemissing or too lowblockExoticSubdepsdisabledstrictDepBuildsdisabledtrustPolicynot set tono-downgrade- unapproved build scripts in
allowBuilds
- actions not pinned to full commit SHA
- missing or overly broad
permissions - missing
CODEOWNERS - risky
pull_request_targetpatterns - privileged publish workflows without attestations
- new install scripts
- suspicious remote fetch or command execution patterns
- new binary files
- obfuscation signals
- sensitive path access like
.env,.ssh,.npmrc - new OSV advisories
- trust regressions surfaced by
review-pr
- MCPs registered through Claude settings or
.mcp.json - unpinned
npx,uvx, orbunxMCP package runners - broad filesystem MCP scopes such as root or home directory access
- inline secret-looking MCP environment values
- remote bootstrap patterns in MCP commands,
SKILL.mdfiles, and plugin hooks
guard scan --format terminal
guard scan --format json
guard scan --format sarif
guard scan --format markdown
guard agent audit --format jsonAll machine-readable outputs are schema-versioned and suitable for plugin or CI consumption.
name: Guard
on: [pull_request]
permissions:
contents: read
jobs:
guard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<SHA>
- uses: actions/setup-go@<SHA>
with:
go-version: "1.23"
- run: go install github.com/MauroProto/guard/cmd/guard@latest
- run: guard ci --format sarif --output guard.sarif
- uses: github/codeql-action/upload-sarif@<SHA>
if: always()
with:
sarif_file: guard.sarifgit clone https://github.com/MauroProto/guard.git
cd guard
make build
make test
make vet
make install-check
make plugin-check
make plugin-smokeValidate the Claude Code plugin and marketplace locally:
claude plugins validate .
claude plugins marketplace add .
claude plugins install guard@guardGuard is intentionally focused today:
pnpmworkspaces- GitHub Actions
- Claude Code integration
- deterministic CLI and CI usage
Likely next steps:
- deeper
review-lockfileworkflows, - richer provenance and trusted publishing signals,
- private registries and
.npmrcawareness, - optional MCP integration,
- broader multi-agent packaging.
MIT