Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ user opts in with `/plugin enable`; an existing install is never flipped by cata

### Security

- [`guardrails`](plugins/guardrails) — Nine safety guards that block secret/credential writes, hardcoded machine-specific paths, git hook-bypass attempts, irreversible git operations (force-push, reset --hard, worktree-wide checkout/restore discards), Bash file-write workarounds that circumvent Write/Edit hooks, commit subjects and gh pr create titles that violate the repo's tracked team convention (when one is declared in .claude/source-control.md), (advisory) hallucinated CLI flags, (advisory) un-throttled Workflow fan-out that risks burst 529s, and (advisory) direct git commit/gh pr create calls bypassing this marketplace's own commit/pull-request skills — each independently toggleable.
- [`guardrails`](plugins/guardrails) — Twelve safety guards that block secret/credential writes, hardcoded machine-specific paths, git hook-bypass attempts, irreversible git operations (force-push, reset --hard, worktree-wide checkout/restore discards), Bash file-write workarounds that circumvent Write/Edit hooks, commit subjects and gh pr create titles that violate the repo's tracked team convention (when one is declared in .claude/source-control.md), (advisory) hallucinated CLI flags, (advisory) asserted repo paths that do not exist, (advisory) /plugin:skill references that do not resolve, (advisory) un-throttled Workflow fan-out that risks burst 529s, and (advisory) direct git commit/gh pr create calls bypassing this marketplace's own commit/pull-request skills — each independently toggleable.

### Workflow

Expand Down
16 changes: 14 additions & 2 deletions plugins/guardrails/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
"name": "guardrails",
"version": "0.14.2",
"description": "Nine safety guards that block secret/credential writes, hardcoded machine-specific paths, git hook-bypass attempts, irreversible git operations (force-push, reset --hard, worktree-wide checkout/restore discards), Bash file-write workarounds that circumvent Write/Edit hooks, commit subjects and gh pr create titles that violate the repo's tracked team convention (when one is declared in .claude/source-control.md), (advisory) hallucinated CLI flags, (advisory) un-throttled Workflow fan-out that risks burst 529s, and (advisory) direct git commit/gh pr create calls bypassing this marketplace's own commit/pull-request skills — each independently toggleable.",
"version": "0.15.0",
"description": "Twelve safety guards that block secret/credential writes, hardcoded machine-specific paths, git hook-bypass attempts, irreversible git operations (force-push, reset --hard, worktree-wide checkout/restore discards), Bash file-write workarounds that circumvent Write/Edit hooks, commit subjects and gh pr create titles that violate the repo's tracked team convention (when one is declared in .claude/source-control.md), (advisory) hallucinated CLI flags, (advisory) asserted repo paths that do not exist, (advisory) /plugin:skill references that do not resolve, (advisory) un-throttled Workflow fan-out that risks burst 529s, and (advisory) direct git commit/gh pr create calls bypassing this marketplace's own commit/pull-request skills — each independently toggleable.",
"author": {
"name": "Melodic Software",
"email": "info@melodicsoftware.com"
Expand Down Expand Up @@ -68,6 +68,18 @@
"description": "Advise on hallucinated CLI flags written to files (never blocks)",
"default": true
},
"asserted_path_verify_enabled": {
"type": "boolean",
"title": "asserted-path-verify guard",
"description": "Advise when markdown asserts a repo-relative path that does not exist (never blocks)",
"default": true
},
"skill_reference_verify_enabled": {
"type": "boolean",
"title": "skill-reference-verify guard",
"description": "Advise when markdown cites a /plugin:skill reference this repo owns but cannot resolve (never blocks)",
"default": true
},
"workflow_resilience_check_enabled": {
"type": "boolean",
"title": "workflow-resilience-check guard",
Expand Down
28 changes: 28 additions & 0 deletions plugins/guardrails/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
All notable changes to the `guardrails` plugin are documented here. Format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this plugin uses semantic versioning.

## [0.15.0]

### Added

- `asserted-path-verify` (advisory, PostToolUse · Write|Edit): flags a
repo-relative path asserted in markdown — in a code span or a link target —
that does not exist in the working tree. A candidate is only adjudicated when
its leading directory is in the repo, which is what keeps another project's
paths, globs, placeholders, and third-party references quiet. Diff-scope only.
Deterministic oracle, advisory action: a citation can be deliberately
forward-looking and PostToolUse cannot tell.
- `skill-reference-verify` (advisory, PostToolUse · Write|Edit): flags a
`/plugin:skill` reference that does not resolve. Gated twice — it does nothing
outside a marketplace repo, and within one it only adjudicates a plugin that
repo's own manifests own. Resolves through manifest `name` and skill
frontmatter `name`, so a renamed directory still matches. Declared
**detect-then-judge**, not deterministic: globbing a plugins tree is exact only
where the reference is locally owned.
- A README enforceability-tier section stating each guard's oracle class, so the
detect-then-judge guard cannot be read as deterministic.

### Fixed

- README guard counts were stale before this change: the prose said "nine safety
guards" and the table omitted `block-convention-violation` while ten were
wired. Counts are now measured against the manifest's toggle set, and the
missing row is present.

## [0.14.2]

### Fixed
Expand Down
19 changes: 16 additions & 3 deletions plugins/guardrails/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# guardrails

A Claude Code plugin bundling nine **safety guards** that catch risky agent
A Claude Code plugin bundling twelve **safety guards** that catch risky agent
actions the moment they happen — before a write lands or a bash command runs.
Each guard is independently toggleable, so you run exactly the subset you want.

Expand All @@ -16,12 +16,25 @@ Each guard is independently toggleable, so you run exactly the subset you want.
| **cli-flag-verify** | PostToolUse · Write \| Edit | **Advisory** (exit 0) | Hallucinated CLI flags — a `--flag` written as a command that does not exist in the binary's actual `--help` output. Surfaces via `additionalContext`, never blocks. |
| **workflow-resilience-check** | PreToolUse · Workflow | **Advisory** (exit 0) | Un-throttled Workflow fan-out — a script calling `parallel()` / `pipeline()` with no wave-cap throttle (`inWaves` / `inWavesPipeline`) and no retry wrapper (`agentRetry`), which risks a burst 529 under wide Opus fan-out. Surfaces a resilience checklist via `additionalContext`, never blocks. |
| **block-noncanonical-commit** | PreToolUse · Bash | **Blocks** (exit 2) | `git commit` that does not pipe its message via `-F -` / `--file -` — `-m` flattens newlines unpredictably across shells. Exempt: `--amend`, `-C`/`-c`/`--reuse-message`/`--reedit-message`, `--fixup`/`--squash`, `-F <path>`, and any commit taken while a merge/rebase/cherry-pick/revert is in progress. Resolves `bash -lc` wrappers and git aliases (inline `-c` and persisted config alike). |
| **block-convention-violation** | PreToolUse · Bash | **Blocks** (exit 2) | A commit subject or `gh pr create --title` that violates the team-tracked convention pattern declared in `.claude/source-control.md`. No tracked pattern means no enforcement. Same exemptions as `block-noncanonical-commit`. |
| **flag-commit-pr-skill-bypass** | PreToolUse · Bash | **Advisory** (exit 0) | Any `gh pr create`, bypassing this marketplace's own `/pull-request create` skill. Only fires when the consuming project's own `.claude/settings.json` enables the `source-control` plugin — silent otherwise. Surfaces via `additionalContext`, never blocks. |
| **asserted-path-verify** | PostToolUse · Write \| Edit | **Advisory** (exit 0) | A repo-relative path asserted in markdown — in a code span or a link target — that does not exist in the working tree. Only adjudicates a candidate whose leading directory IS in the repo, so another project's paths, globs, and placeholders stay quiet. Surfaces via `additionalContext`, never blocks. |
| **skill-reference-verify** | PostToolUse · Write \| Edit | **Advisory** (exit 0) | A `` `/plugin:skill` `` reference in markdown that does not resolve. Only fires inside a marketplace repo, and only for a plugin that repo's own manifests own — a reference to another marketplace is left alone. Resolves through manifest and frontmatter `name`, so a renamed directory still matches. Surfaces via `additionalContext`, never blocks. |

The six blocking guards feed their stderr message back to Claude as
actionable fix guidance. The three advisory guards surface their findings the same
The seven blocking guards feed their stderr message back to Claude as
actionable fix guidance. The five advisory guards surface their findings the same
way but always allow the operation.

### Enforceability tiers

Eleven guards are **deterministic** — their oracle is a mechanical test with no
judgment step. `skill-reference-verify` is **detect-then-judge**: globbing a
plugins tree is exact only inside a marketplace repo that owns the referenced
plugin, so its finding is a prompt for a human verdict, never a determination and
never an auto-fix. The two hallucination guards that scan written content
(`cli-flag-verify`, `asserted-path-verify`) are deterministic in their oracle but
advisory in their action, because a claim can be deliberately forward-looking.

### Scope notes

- **Hook-manager coverage.** `block-no-verify` recognizes the disable env-var
Expand Down
Loading
Loading