pin-guardrail

pin-guardrail is a skill for Claude Code from craigcossairt/trellis. It costs 94 tokens per session (2,058 once invoked), scanned A, original, MIT.

A testing workflow for shell guardrails such as hooks, scripts, and Git hooks. It writes behavioral tests, deliberately changes the guard to check that the tests detect the change, and connects the suite to continuous integration, which runs checks automatically.

In plain words
What is it for?
Use it to test shell safety checks, verify that their tests are meaningful, and run those tests in CI.
Why use it?
A test that only checks whether a script parses may miss whether it actually blocks unsafe actions. Deliberate mutation provides evidence that the tests can catch broken behavior.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to test shell safety checks, verify that their tests are meaningful, and run those tests in CI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/craigcossairt/trellis/pin-guardrail
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add craigcossairt/trellis --skill pin-guardrail
Clone the repo
git clone --depth 1 https://github.com/craigcossairt/trellis

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pin-guardrail

README.md
[![agentmods](https://agentmods.dev/badge/skills/craigcossairt/trellis/pin-guardrail/github.svg)](https://agentmods.dev/skills/craigcossairt/trellis/pin-guardrail)
Your own site
<a href="https://agentmods.dev/skills/craigcossairt/trellis/pin-guardrail"><img src="https://agentmods.dev/badge/skills/craigcossairt/trellis/pin-guardrail/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pin-guardrail

Your own site · 80×15
<a href="https://agentmods.dev/skills/craigcossairt/trellis/pin-guardrail"><img src="https://agentmods.dev/badge/skills/craigcossairt/trellis/pin-guardrail.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,058 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00094 $0.02058
Opus 5.5 $0.00038 $0.00823
Sonnet 5.5 $0.00019 $0.00412
Haiku 4.5 $0.00009 $0.00206

Measured 7d ago against content hash 02994e2d13ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-30, from the pricing page.

Security

Grade A, and why

pin-guardrail scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/pin-guardrail/SKILL.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pin a guardrail with a suite you can believe

A guardrail with no behavioral test asserts nothing. CI checking that a script parses says nothing about whether it blocks, and a guard that silently stops working is worse than no guard, because somebody is relying on it.

The suite is the deliverable. The mutation run is what makes the suite believable - and most of this file is about the ways a green suite lies to you, because every one of them has actually happened in this repo.

Scope: this is written for shell guardrails - the concrete fixture rules, directory and CI wiring below assume them. The mutation discipline in §3 to §5 is not shell-specific and carries over to anything you can break on purpose.

0. Is it gated? If not, stop

Open the CI workflow and confirm it runs the directory you are about to write into. Do this by reading it, not by assuming - a suite CI never executes is decoration that reads as coverage, which is worse than no suite at all.

At the time of writing that means bin/tests/, with .github/workflows/hooks-ci.yml running each suite as its own named step. Treat that as the answer to check against, not as a reason to skip checking: the layout is exactly the kind of thing that moves. A named step matters either way - read step conclusions rather than the job conclusion, because a job can be green while a step inside it was skipped.

1. Name the behaviours before you write a single case

List what the script promises: each block-or-allow decision, each exit code, each could-not-run path, each normalisation it performs. One case per behaviour, and write the list down first. That list is what you compare the mutation results against in step 4. Without it you will be comparing against a fixture count, which is the wrong number in both directions.

2. Write the suite

Read an existing suite in bin/tests/ and match its shape rather than inventing a harness.

Make it hermetic: temp trees, no network, no installed toolchain. Inject external tools as stubs and build git fixtures directly. Anything a suite needs from the outside world is a reason it will be skipped later, and a skipped suite is an unpinned guardrail.

Read the full file on GitHub · 165 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 165 lines · 94 tokens per session scan A 02994e2d13ab

Subscribe to this mod's changes

pin-guardrail is a skill published in the GitHub repository craigcossairt/trellis (4 stars, last pushed 3d ago), licensed MIT. It adds 94 tokens to every session and 2,058 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-23.