security-and-hardening

security-and-hardening is a skill for Claude Code from peterblazejewicz/claude-plugins. It costs 99 tokens per session (10,360 once invoked), scanned B, original, MIT.

A security workflow for .NET and C# applications. It covers protecting inputs, accounts, secrets, stored data, external connections, uploads, and web callbacks.

In plain words
What is it for?
Use it when adding user input, login or access rules, sensitive data, external APIs, file uploads, webhooks, payments, or regulated-data handling.
Why use it?
It helps prevent common security failures by treating outside data as untrusted and requiring authorization and secret protection where they matter.

Skill for Claude Code

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

Part of the dotnet-skills plugin — 24 skills, 9 commands, 4 agents shipped together

Good fit Use it when adding user input, login or access rules, sensitive data, external APIs, file uploads, webhooks, payments, or regulated-data handling.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/peterblazejewicz/claude-plugins/security-and-hardening
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 peterblazejewicz/claude-plugins --skill security-and-hardening
Clone the repo
git clone --depth 1 https://github.com/peterblazejewicz/claude-plugins

Made for: Claude Code.

Or install dotnet-skills, the plugin that ships this one along with the rest of its 24 skills, 9 commands, 4 agents.

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 security-and-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/peterblazejewicz/claude-plugins/security-and-hardening/github.svg)](https://agentmods.dev/skills/peterblazejewicz/claude-plugins/security-and-hardening)
Your own site
<a href="https://agentmods.dev/skills/peterblazejewicz/claude-plugins/security-and-hardening"><img src="https://agentmods.dev/badge/skills/peterblazejewicz/claude-plugins/security-and-hardening/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 security-and-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/peterblazejewicz/claude-plugins/security-and-hardening"><img src="https://agentmods.dev/badge/skills/peterblazejewicz/claude-plugins/security-and-hardening.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,360 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00099 $0.10360
Opus 5 $0.00049 $0.05180
Sonnet 5 $0.00020 $0.02072
Haiku 4.5 $0.00010 $0.01036

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

Security

Grade B, and why

security-and-hardening scanned grade B with 2 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 11d 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.

Cloud metadata endpointmediumServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

Any time the server fetches a URL the user influenced — webhooks, "import from URL", image proxies, link previews — an attacker can aim it at internal services (cloud metadata, `localhost`, private IPs). The #1 target is

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

Makes network callslowCapability

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

- [ ] Security headers present in response (check with browser DevTools or `curl -I`)
plugins/dotnet-skills/skills/security-and-hardening/SKILL.md · 720 lines

How it starts

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

Security and Hardening

Overview

Security-first development practices for .NET applications — ASP.NET Core web apps, Blazor, Avalonia, MAUI, and library code. Treat every external input as hostile, every secret as sacred, and every authorization check as mandatory. Security isn't a phase — it's a constraint on every line of code that touches user data, authentication, or external systems.

When to Use

  • Building anything that accepts user input (HTTP endpoints, message consumers, file watchers, UI text fields)
  • Implementing authentication or authorization (ASP.NET Core Identity, cookie auth, JWT bearer, OAuth, policy-based authz)
  • Storing or transmitting sensitive data (PII, payment info, API tokens, connection strings)
  • Integrating with external APIs or services (HttpClient, gRPC, Service Bus)
  • Adding file uploads, webhooks, or callbacks
  • Handling payment or regulated data (GDPR, HIPAA, PCI DSS)

Process: Threat Model First

Controls bolted on without a threat model are guesses. Before hardening, spend five minutes thinking like an attacker:

  1. Map the trust boundaries. Where does untrusted data cross into your system? HTTP requests (body, route, query, headers), form fields, IFormFile uploads, webhooks, third-party API responses, Service Bus / queue messages, and LLM output. Every boundary is attack surface.
  2. Name the assets. What's worth stealing or breaking? Credentials, PII, payment data, admin actions, money movement.
  3. Run STRIDE over each boundary — a quick lens, not a ceremony:
Threat Ask Typical .NET mitigation
Spoofing Can someone impersonate a user/service? ASP.NET Core Identity / JWT bearer auth, HMAC signature verification on webhooks
Tampering Can data be altered in transit or at rest? HTTPS + HSTS, parameterized EF Core queries, Data Protection integrity
Repudiation Can an action be denied later? Audit logging of security events (structured ILogger)
Information disclosure Can data leak? DTO field allowlists, ProblemDetails generic errors, encryption at rest
Denial of service Can it be overwhelmed? AddRateLimiter, RequestSizeLimit / FormOptions, CancellationToken + timeouts
Elevation of privilege Can a user gain rights they shouldn't? Policy-based [Authorize], per-resource IAuthorizationService checks, least privilege

Read the full file on GitHub · 720 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. 11d ago First seen · 720 lines · 99 tokens per session scan B af45fd11b8dc

Subscribe to this mod's changes

security-and-hardening is a skill published in the GitHub repository peterblazejewicz/claude-plugins (7 stars, last pushed 2mo ago), licensed MIT. It adds 99 tokens to every session and 10,360 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 2 findings (cloud metadata endpoint, makes network calls). 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

build-and-test

How to build and test .NET projects in the Agent Framework repository. Use this when verifying or testing changes.

microsoft/agent-framework · 26 tokens

verify-dotnet-samples

How to build, run and verify the .NET sample projects in the Agent Framework repository. Use this when a user wants to verify that the samples still function as expected.

microsoft/agent-framework · 40 tokens

agents-sdk-dotnet-activityhandler-migration

Use when migrating a Microsoft 365 Agents SDK agent that uses ActivityHandler or TeamsActivityHandler to AgentApplication. This is ONLY for DotNet projects that uses Microsoft.Agents. packages. Triggered by Agents SDK bots that subclass ActivityHandler or TeamsActivityHandler that need to be modernized to…

microsoft/Agents · 76 tokens

agents-sdk-dotnet

Use when any code imports Microsoft.Agents.Hosting.AspNetCore, Microsoft.Agents.Builder, or related Agents SDK packages, or when the user is building, configuring, or asking questions about a Microsoft 365 Agents SDK agent in C# / .NET. Trigger on questions about appsettings.json, connection configuration…

microsoft/Agents · 112 tokens

agents-sdk-dotnet-otel

Use when adding, configuring, validating, or troubleshooting OpenTelemetry observability for a Microsoft 365 Agents SDK application in C# / .NET. Trigger when the user mentions OpenTelemetry, OTel, telemetry, traces, metrics, logs, OTLP, Aspire Dashboard, Application Insights, Azure Monitor, distributed tracing…

microsoft/Agents · 86 tokens

bf-to-agents-sdk-dotnet-migration

Use when migrating a Bot Framework .NET SDK bot to Microsoft 365 Agents SDK. Triggered by projects that depend on packages: Microsoft.Bot.Builder or Microsoft.Bot.Builder.Integration.AspNet.Core that want to migrate to Agents SDK.

microsoft/Agents · 56 tokens