trusted-publishing

trusted-publishing is a skill for Claude Code from sbom-tool/gh-guard. It costs 18 tokens per session (1,280 once invoked), scanned A, original, MIT.

A way for GitHub Actions, GitHub's automated build and release service, to publish Rust packages to crates.io without storing a permanent API token. It uses OIDC, a temporary identity check between services.

In plain words
What is it for?
Use it to configure trusted publishing for an existing crates.io package, including the required GitHub environment and publishing settings.
Why use it?
It reduces the risk of a publishing credential being copied from logs, secrets, or a compromised workflow. Temporary, narrowly scoped access also removes the need to rotate a long-lived token.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

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

Good fit Use it to configure trusted publishing for an existing crates.io package, including the required GitHub environment and publishing settings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sbom-tool/gh-guard/trusted-publishing
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 sbom-tool/gh-guard --skill trusted-publishing
Clone the repo
git clone --depth 1 https://github.com/sbom-tool/gh-guard

Made for: Claude Code.

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 trusted-publishing

README.md
[![agentmods](https://agentmods.dev/badge/skills/sbom-tool/gh-guard/trusted-publishing.svg)](https://agentmods.dev/skills/sbom-tool/gh-guard/trusted-publishing)
Your own site
<a href="https://agentmods.dev/skills/sbom-tool/gh-guard/trusted-publishing"><img src="https://agentmods.dev/badge/skills/sbom-tool/gh-guard/trusted-publishing.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,280 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.00018 $0.01280
Opus 5 $0.00009 $0.00640
Sonnet 5 $0.00004 $0.00256
Haiku 4.5 $0.00002 $0.00128

Measured 8d ago against content hash 6ca9d4d48e10, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

trusted-publishing 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 8d 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.

skills/trusted-publishing/SKILL.md · 141 lines

How it starts

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

Trusted Publishing for crates.io

Trusted Publishing uses OIDC (OpenID Connect) to authenticate GitHub Actions workflows to crates.io without long-lived API tokens. This eliminates the risk of token theft and credential leaks.

Threat Model

Attack Vector API Token Trusted Publishing
Token leaked in logs Vulnerable N/A (no token)
Token stolen from secrets Vulnerable N/A (no token)
Compromised maintainer account Token can be exfiltrated OIDC scoped to repo + workflow
Supply chain attack on CI Token available in env Token scoped to specific environment
Token rotation burden Manual rotation needed Automatic, ephemeral tokens

Prerequisites

  1. Crate already published — You must have done at least one cargo publish with a traditional token. Trusted Publishing cannot be used for the initial publish.
  2. GitHub environment created — Create a crates-io environment in repo Settings > Environments.
  3. Owner access on crates.io — You must be an owner of the crate to configure publishing settings.

Step-by-Step Setup

Step 1: Create GitHub Environment

  1. Go to repo Settings > Environments > New environment
  2. Name it crates-io (must match the environment: in your workflow)
  3. Optionally add protection rules (required reviewers, deployment branches)
  4. No secrets needed — OIDC provides the token automatically

Step 2: Configure at crates.io

GOTCHA: This is configured at crates.io, not in your repository.

  1. Go to https://crates.io/crates/YOUR_CRATE/settings
  2. Under "Trusted Publishing", click "Add"
  3. Fill in:
    • Repository owner: Your GitHub org or username
    • Repository name: Your repo name
    • Workflow filename: publish.yml (or whatever you named your publish workflow)
    • Environment: crates-io
  4. Click "Add"

Step 3: Update Your Publish Workflow

The workflow needs two key pieces:

  1. id-token: write permission on the publish job:
permissions:
  contents: read
  id-token: write

Read the full file on GitHub · 141 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. 8d ago First seen · 141 lines · 18 tokens per session scan A 6ca9d4d48e10

Subscribe to this mod's changes

trusted-publishing is a skill published in the GitHub repository sbom-tool/gh-guard (15 stars, last pushed 5mo ago), licensed MIT. It adds 18 tokens to every session and 1,280 once invoked, about $0.0001 per session on Opus 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-08-30.

Related

Other skills, from other repositories

implementing-supply-chain-security-with-in-toto

Implement software supply chain integrity verification for container builds using the in-toto framework to create cryptographically signed attestations across CI/CD pipeline steps.

xalgorix/xalgorix · 39 tokens

fortify-cicd-integration

Integrate Fortify application security (SAST, SCA, DAST) with GitHub Actions, GitLab Pipelines, Azure DevOps, Jenkins & other CICD/DevSecOps pipelines.

fortify/skills · 49 tokens

security-engineer

Security Engineer role bundle for building security into products and infrastructure. Orchestrates code review, pipeline hardening, vulnerability response, and infrastructure review workflows. Auto-invoked when the user needs help with secure development practices, CI/CD security, vulnerability management, or…

UnitOneAI/SecuritySkills · 72 tokens

cicd-posture

Assesses CI/CD and software supply-chain security across an Endor namespace, GitHub organization, selected repositories, or the current repository. It combines existing Endor SCPM, CI/CD, GitHub Actions, and supply-chain findings with read-only repository configuration evidence and optional local CI inspection to…

endorlabs/ai-plugins · 99 tokens

hunting-cicd-workflow-injection

Hunt a CI/CD pipeline for attacker-controlled repository data that reaches a privileged execution context, after the trigger and the token scope are resolved. Covers an untrusted event field (an issue or pull-request title, a branch name, a commit message) interpolated directly into a run-step shell command, a…

UnboundCompute/security-agent-skills · 205 tokens

auditing-cicd-oidc-trust

Audit continuous-integration pipelines for the trust they extend to untrusted input: workflows that run on incoming change requests from forks while holding repository secrets, steps that let attacker-controlled content reach a privileged command, and cloud role trust conditions that accept a pipeline's short-lived…

UnboundCompute/security-agent-skills · 137 tokens