dotnet-guard-audit

dotnet-guard-audit is a skill for Claude Code from Attemainio/dotnet-toolkit. It costs 166 tokens per session (1,323 once invoked), scanned A, original, MIT.

A testing guide for checking whether .NET guard hooks actually stop actions they are meant to control. Guard hooks are automatic checks that can allow or block operations.

In plain words
What is it for?
Use it to red-team the guard-cs-edit, guard-cs-read, guard-bash-read, and guard-bash-write hooks, including attempts through Bash or patch validation.
Why use it?
It helps find cases where a supposedly protected code-reading, editing, or shell operation can bypass the guard.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the dotnet-toolkit plugin — 9 skills, 6 agents, 2 hooks, 1 MCP server 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 skills/attemainio/dotnet-toolkit/dotnet-guard-audit
Any agent
npx skills add Attemainio/dotnet-toolkit --skill dotnet-guard-audit
Clone the repo
git clone --depth 1 https://github.com/Attemainio/dotnet-toolkit

Made for: Claude Code.

Or install dotnet-toolkit, the plugin that ships this one along with the rest of its 9 skills, 6 agents, 2 hooks, 1 MCP server.

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 dotnet-guard-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/attemainio/dotnet-toolkit/dotnet-guard-audit.svg)](https://agentmods.dev/skills/attemainio/dotnet-toolkit/dotnet-guard-audit)
Your own site
<a href="https://agentmods.dev/skills/attemainio/dotnet-toolkit/dotnet-guard-audit"><img src="https://agentmods.dev/badge/skills/attemainio/dotnet-toolkit/dotnet-guard-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 166 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,323 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00166 $0.01323
Opus 5 $0.00083 $0.00661
Sonnet 5 $0.00033 $0.00265
Haiku 4.5 $0.00017 $0.00132

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

Security

Grade A, and why

dotnet-guard-audit 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 6d 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/dotnet-guard-audit/SKILL.md · 79 lines

How it starts

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

Auditing the guard hooks for bypasses

dotnet-performance measures what the plugin costs when the guards are suspended. This skill asks a different question: with the guards left exactly as armed as a real session meets them, does a call that should be governed by one actually get caught? The two must never run in the same window — one needs the guards down, this one needs them up, and a red-team result taken while guards happen to be suspended for an unrelated reason is not a result at all, just an unenforced repo behaving as expected.

Why a dedicated agent, not the main session poking at it

The same reasoning dotnet-performance uses for its probes applies here for a different reason: this session's own context already knows the shape of a real gap (the spaced-path bug this plugin has already found and documented), and testing your own hypothesis is a weaker test than a fresh agent working from the same battery of attempts with no investment in finding — or not finding — anything in particular. dotnet-guard-redteam is deliberately self-contained and briefed with the list of attempts directly, rather than inventing its own, so a run is repeatable and comparable across time.

Step 0 — confirm the guards are actually armed

Call workspace_status. If its hookGuards: SUSPENDED line is present, stop — either wait out the suspension or ask the user whether it is safe to restore now (another session may be relying on it). Launching the red-team agent during a suspension window produces a report where everything "passes" trivially, which is worse than no report: it reads as clean enforcement when nothing was actually being tested.

Also confirm workspace: loaded (not degraded) — an attempt that fails because the workspace itself is unhealthy is not a guard finding.

Step 1 — launch the agent

Agent(subagent_type: "dotnet-guard-redteam", description: "Red-team the .cs guard hooks")

No question matrix to build and no prompt to hand-author: the agent's own file carries its full battery of attempts, the boundaries (never leave a change behind, report don't fix), and the report format. Nothing here should be re-typed into the launch prompt — a copy would drift from the agent's own file.

Read the full file on GitHub · 79 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. 6d ago First seen · 79 lines · 166 tokens per session scan A c5cc478dd5be

Subscribe to this mod's changes

dotnet-guard-audit is a skill published in the GitHub repository Attemainio/dotnet-toolkit (2 stars, last pushed 10d ago), licensed MIT. It adds 166 tokens to every session and 1,323 once invoked, about $0.0008 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-31.

Related

Other skills, from other repositories

completion-verification

Verifies that work is actually complete before it is claimed to be — running the checks, reading the output, and confirming the original request was satisfied rather than approximated. Use this before saying something is done, fixed, or passing; before committing or opening a pull request; and whenever a claim of…

cbrock84/headcount · 73 tokens

specify-incremental

Decompose a single-feature specification into a linear, phase-by-phase implementation plan. Use this for medium-complexity work — single feature, one or two components — where transparent human-in-the-loop phase review is preferred over factory automation.

rsmdt/the-startup · 53 tokens

testing

Writing effective tests and running them successfully. Covers layer-specific mocking rules, test design principles, debugging failures, and flaky test management. Use when writing tests, reviewing test quality, or debugging test failures.

rsmdt/the-startup · 42 tokens

bootstrap-solution

Bootstrap or guide a reproducible .NET solution with explicit F# or C# language choice, SDK selection, project layout, test project setup, and initial validation commands.

gaelic-ghost/socket · 38 tokens

testing-lint-workflow

Plan, run, filter, and triage Android tests and lint, including local unit tests, instrumentation and Compose UI test handoffs, Gradle variant tasks, lint configuration, lint baselines, failure explanations, emulator-aware validation routing, and readable next checks.

gaelic-ghost/socket · 58 tokens

build-csharp-project

Build or modify idiomatic C# .NET projects using nullable-aware APIs, records/classes, async/task behavior, analyzer conventions, tests, and repo-local validation.

gaelic-ghost/socket · 37 tokens