ci-agent-hardening

ci-agent-hardening is a skill for Claude Code, Codex from stacklok/toolhive-catalog. It costs 108 tokens per session (1,775 once invoked), scanned A, original, Apache-2.0.

A security audit and hardening guide for GitHub Actions, especially workflows that use AI or process code from pull requests.

In plain words
What is it for?
Use it to inspect workflow files, run the provided audit, and fix risks involving pull_request_target, expression injection, cache use, credentials, and untrusted actions.
Why use it?
It helps find ways attackers could inject instructions, run untrusted fork code with secrets, poison caches, steal credentials, or compromise the software supply chain.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for cline. Also seen: mentions CLAUDE.md; built for cline.

Good fit Use it to inspect workflow files, run the provided audit, and fix risks involving pull_request_target, expression injection, cache use, credentials, and untrusted actions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stacklok/toolhive-catalog/skill
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 stacklok/toolhive-catalog --skill skill
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive-catalog

Made for: Claude Code, Codex.

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 ci-agent-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/stacklok/toolhive-catalog/skill/github.svg)](https://agentmods.dev/skills/stacklok/toolhive-catalog/skill)
Your own site
<a href="https://agentmods.dev/skills/stacklok/toolhive-catalog/skill"><img src="https://agentmods.dev/badge/skills/stacklok/toolhive-catalog/skill/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 ci-agent-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/stacklok/toolhive-catalog/skill"><img src="https://agentmods.dev/badge/skills/stacklok/toolhive-catalog/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00108 $0.01775
Opus 5.5 $0.00043 $0.00710
Sonnet 5.5 $0.00022 $0.00355
Haiku 4.5 $0.00011 $0.00178

Measured 3mo ago against content hash e9dd71e254f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ci-agent-hardening scanned grade A 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 3mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/audit-workflows.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Every attack in the hackerbot-claw campaign depended on `curl` to `hackmoltrepeat.com`. Consider:
registries/toolhive/skills/ci-agent-hardening/skill/SKILL.md · 179 lines

How it starts

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

CI Agent Hardening

Audit and fix security vulnerabilities in GitHub Actions workflows, with emphasis on AI-powered CI/CD. Based on two major 2026 incidents:

  • Clinejection — Prompt injection in AI triage bot led to cache poisoning, credential theft, malicious npm publish (~4,000 developers affected)
  • hackerbot-claw — Autonomous AI bot exploited 7 repos (Microsoft, DataDog, CNCF, Aqua Trivy), achieving full repo compromise on Trivy (25k+ stars) via PAT theft

Prerequisites

  • Repository with .github/workflows/ directory
  • bash available for running the audit script

Instructions

For background and exploit details on any pattern below, see references/ATTACK-PATTERNS.md.

Step 1: Run the Automated Audit

Run from the repository root:

bash <skill-path>/scripts/audit-workflows.sh .github/workflows

Review [CRIT] findings first (exploitable now), then [WARN] (defense gaps).

Step 2: Fix pull_request_target + Fork Checkout (CRITICAL)

This is the #1 attack vector. 4 of 7 hackerbot-claw attacks exploited it. Check every pull_request_target workflow:

# DANGEROUS — runs fork code with your secrets
on: pull_request_target
steps:
  - uses: actions/checkout@v4
    with:
      ref: ${{ github.event.pull_request.head.sha }}  # ATTACKER'S CODE

# SAFE — use pull_request trigger instead (no secret access)
on: pull_request

# SAFE — if pull_request_target needed, checkout base only
on: pull_request_target
steps:
  - uses: actions/checkout@v4  # defaults to base branch

If the workflow needs both secrets AND fork code (e.g., comment on PR), split into two workflows: one that runs untrusted code (no secrets) and one that consumes artifacts (with secrets).

Step 3: Eliminate Expression Injection in run: Blocks

Any ${{ }} expression referencing user-controlled values inside a run: block is a shell injection. Branch names, filenames, PR titles, commit messages are all vectors.

# VULNERABLE — branch name is shell-evaluated
- run: echo "${{ github.event.pull_request.head.ref }}"

# SAFE — environment variable (properly quoted by runner)
- run: echo "$PR_HEAD_REF"
  env:
    PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}

Read the full file on GitHub · 179 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3mo ago First seen · 179 lines · 108 tokens per session scan A e9dd71e254f1

Subscribe to this mod's changes

ci-agent-hardening is a skill published in the GitHub repository stacklok/toolhive-catalog (27 stars, last pushed today), licensed Apache-2.0. It adds 108 tokens to every session and 1,775 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

ci-agent-hardening compared with skills from other repositories

ci-agent-hardening next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ci-agent-hardeningstacklok/toolhive-catalogSkill27todayApache-2.0A108Claude Code, Codex
manufact-cloudmcp-use/mcp-useSkill11ktodayMITA42Claude Code, Codex
securing-container-registry-imagesxalgorix/xalgorixSkill1.5k2d agoApache-2.0C54Claude Code, Codex
fluent-ci-cdserac-labs/seracSkill771mo agoApache-2.0A78Claude Code
gitlab-cistructured-world/gitlab-mcpSkill8todayApache-2.0A51Claude Code, Codex
gitlab-duostructured-world/gitlab-mcpSkill8todayApache-2.0A49Claude Code, Codex
blazemeter-integrationsBlazemeter/bzm-mcpSkill271mo agoApache-2.0A131Claude Code, Codex