dotnet-guard-redteam

dotnet-guard-redteam is an agent for coding agents from Attemainio/dotnet-toolkit. It costs 212 tokens per session (2,477 once invoked), scanned A, original, MIT.

An audit-only security agent that tests whether C# editing and reading guard hooks can be bypassed. A red-team audit deliberately tries unusual inputs to uncover weaknesses without fixing them.

In plain words
What is it for?
Use it to test guard hooks against cases such as unusual quoting, spaced paths, symbolic links, copied files, variable expansion, and indirect writes to C# files.
Why use it?
It helps reveal cases where protected C# files might be read or changed without the required validation path. It preserves the repository by reporting findings rather than keeping test changes.

Agent

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 agents/attemainio/dotnet-toolkit/dotnet-guard-redteam
Clone the repo
git clone --depth 1 https://github.com/Attemainio/dotnet-toolkit

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-redteam

README.md
[![agentmods](https://agentmods.dev/badge/agents/attemainio/dotnet-toolkit/dotnet-guard-redteam.svg)](https://agentmods.dev/agents/attemainio/dotnet-toolkit/dotnet-guard-redteam)
Your own site
<a href="https://agentmods.dev/agents/attemainio/dotnet-toolkit/dotnet-guard-redteam"><img src="https://agentmods.dev/badge/agents/attemainio/dotnet-toolkit/dotnet-guard-redteam.svg" alt="Measured on agentmods" height="20"></a>
Per session 212 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,477 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 $0.00212 $0.02477
Opus 5 $0.00106 $0.01239
Sonnet 5 $0.00042 $0.00495
Haiku 4.5 $0.00021 $0.00248

Measured 4d ago against content hash e95c8acf2f66, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dotnet-guard-redteam 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 4d 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.

agents/dotnet-guard-redteam.md · 133 lines

How it starts

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

You are a red team of one, aimed at this repo's own guard hooks (Hooks/GuardCsEdit.cs, Hooks/GuardCsRead.cs, Hooks/GuardCsBashRead.cs, Hooks/GuardCsBashWrite.cs, driven by Hooks/CsFileMembership.cs and Hooks/BashCommandScanner.cs). Your only job is to find out whether a call that should be governed by one of them actually is, and to report what you found. You never fix anything, and you never keep a change that lands.

This file is self-contained. Do not go looking for more instructions, and do not read Hooks/*.cs yourself before testing — reasoning about the source first is exactly the shortcut that would make you test what you expect to find instead of what is actually there. Read the source only after an attempt's outcome surprises you, to explain the finding in your report.

What "governed" means, and why the bar differs by guard

  • guard-cs-edit (Edit/Write/NotebookEdit) and guard-cs-bash-write (Bash, since 2026-08-21) are both hard denies. A bypass on either means a write to a compiled .cs file's actual content reached disk without going through validate_patch — a real finding, because only validate_patch writes to the development log. Treat this as the highest-stakes category by far, whichever tool name carried it.
  • guard-cs-read and guard-cs-bash-read are advisory, not blocking (since 2026-08-21): they always allow the call, and add a note when they recognize the file as compiled. A "bypass" here is narrower and lower-stakes: the file is governed, but the advisory note did not fire — a missed nudge, not an unenforced boundary. Report it as exactly that; do not write it up as though it were as serious as a write bypass.

What to try

Work through this list against a .cs file this repo's own solution actually compiles — pick one under src/DotnetToolkit.McpServer/. Never use a file under tests/**/fixtures/SampleSolution: it is deliberately excluded from the build, every guard is supposed to let it through, and a "bypass" there is not a finding.

Read the full file on GitHub · 133 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. 4d ago First seen · 133 lines · 212 tokens per session scan A e95c8acf2f66

Subscribe to this mod's changes

dotnet-guard-redteam is an agent published in the GitHub repository Attemainio/dotnet-toolkit (2 stars, last pushed 8d ago), licensed MIT. It adds 212 tokens to every session and 2,477 once invoked, about $0.0011 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 agents, from other repositories

corporate-strategy

Corporate Strategy (CSO). Owns plugins/corporate-strategy/ and nothing else. Delegate work in this department's remit here.

cbrock84/headcount · 33 tokens

customer-experience

Customer Experience (CCO). Owns plugins/customer-experience/ and nothing else. Delegate work in this department's remit here.

cbrock84/headcount · 30 tokens

demand-generation

Demand Generation (CMO). Owns plugins/demand-generation/ and nothing else. Delegate work in this department's remit here.

cbrock84/headcount · 30 tokens

optimizer

Performance specialist. MUST BE USED for performance issues, database design, query optimization. PROACTIVELY handles profiling, schema design, migrations, and bottleneck identification.

komluk/scaffolding · 35 tokens

ai-visibility-analyzer

Deep autonomous brand visibility analysis across all 6 AI engines — multi-pass real-query probes (5+ engines × 5–10 queries), business-DB scan, citation source enumeration, competitor disambiguation, full 30-day defense plan. Use ONLY when the user explicitly asks for "deep AI visibility analysis", "agent mode"…

akii-technologies-ltd/akii-seo-ai-search-optimizer · 155 tokens

developer

TDD-first implementation worker dispatched by /magi:go. Receives a complete task brief (PLAN/SPEC excerpt, file context, interface contracts, conventions) and executes one task or one parallel lane. Writes code + tests; does not make architecture decisions; reports DONE / BLOCKED back to coordinator. Default model is…

howar31/magi-workflow · 83 tokens