harden

harden is a command for coding agents from sbom-tool/gh-guard. It costs 12 tokens per session (1,424 once invoked), scanned B, original, MIT.

An interactive wizard that detects details of a Rust project and generates missing supply-chain security configuration. It offers Minimal, Standard, and Hardened levels with progressively more checks and release safeguards.

In plain words
What is it for?
Use it to generate CI, dependency-policy, Dependabot, security, publishing, CodeQL, Scorecard, release, fuzzing, and provenance configuration for a Rust project.
Why use it?
It replaces manual discovery and configuration of many security files with guided choices based on the project. It also asks for values that cannot be detected automatically.

Command

Part of the gh-guard plugin — 14 skills, 5 commands shipped together

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.

agentmods
npx agentmods add commands/sbom-tool/gh-guard/harden
Clone the repo
git clone --depth 1 https://github.com/sbom-tool/gh-guard

Or install gh-guard, the plugin that ships this one along with the rest of its 14 skills, 5 commands.

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 harden

README.md
[![agentmods](https://agentmods.dev/badge/commands/sbom-tool/gh-guard/harden.svg)](https://agentmods.dev/commands/sbom-tool/gh-guard/harden)
Your own site
<a href="https://agentmods.dev/commands/sbom-tool/gh-guard/harden"><img src="https://agentmods.dev/badge/commands/sbom-tool/gh-guard/harden.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,424 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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.00012 $0.01424
Opus 5 $0.00006 $0.00712
Sonnet 5 $0.00002 $0.00285
Haiku 4.5 $0.00001 $0.00142

Measured 5d ago against content hash e257c148051a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade B, and why

harden scanned grade B with 1 finding 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 5d 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.

Reaches for credential filesmediumPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

git config --global user.signingkey ~/.ssh/id_ed25519.pub

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

commands/harden.md · 137 lines

How it starts

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

/harden — Interactive Supply Chain Hardening Wizard

Guide the user through hardening their Rust project's CI/CD supply chain at their chosen level.

Workflow

Step 1: Detect Project Context

Auto-detect from the project:

  • Crate name: Cargo.tomlname = "..."
  • MSRV: Cargo.tomlrust-version = "..." or rust-toolchain.tomlchannel = "..."
  • Repo owner/name: git remote get-url origin → parse owner/name
  • Contact email: Cargo.tomlauthors = [...]
  • Fuzz targets: fuzz/Cargo.toml[[bin]] entries (if fuzz/ exists)
  • Workspace crates: if [workspace] in root Cargo.toml, detect publishable members via cargo metadata --no-deps filtered by publish != false, ordered by dependency graph. Ask user to confirm the list and order.

If any value can't be detected, ask the user.

Step 2: Ask Hardening Level

Ask the user which level they want:

Level What Gets Generated
Minimal CI workflow, deny.toml, dependabot.yml, SECURITY.md, rust-toolchain.toml
Standard Minimal + publish workflow (Trusted Publishing), CodeQL, Scorecard, release script
Hardened Standard + SLSA provenance (in publish workflow), fuzz workflow, osv-scanner.toml

Step 2a: Detect Current Hardening Level

Use the detection algorithm from the hardening-detection skill (single source of truth for marker definitions and classification rules) to determine the project's current level.

Show the user: "Your project is currently at [Level] (X/Y markers present)"

  • If Custom (partial): show "Your project is at Minimal with partial Standard coverage (2/4 markers). Missing: CodeQL workflow, Scorecard workflow."
  • Recommend completing the current effective level's gaps before upgrading, or offer to fill them as part of the upgrade

Upgrade mode: If the detected level is below the chosen level:

  • Show what will be added (delta only, not the full level)
  • Example: "Upgrading from MinimalStandard: 4 files to generate"
  • Only iterate over the delta files in subsequent steps
  • If the detected level equals or exceeds the chosen level: suggest /audit for a detailed gap analysis instead

Read the full file on GitHub · 137 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. 5d ago First seen · 137 lines · 12 tokens per session scan B e257c148051a

Subscribe to this mod's changes

harden is a command published in the GitHub repository sbom-tool/gh-guard (15 stars, last pushed 5mo ago), licensed MIT. It adds 12 tokens to every session and 1,424 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.