difesa-attacchi

difesa-attacchi is a skill for Claude Code from ayalaphiscan/web-security-guard. It costs 161 tokens per session (1,427 once invoked), scanned A, original, MIT.

A security layer that detects and blocks harmful web requests, such as attempts to inject database commands, run scripts, explore files, or guess passwords.

In plain words
What is it for?
Use it to add request limits, temporary IP blocking, attack logs, lockdown mode, optional backups, and alerts to a website or app.
Why use it?
It helps limit common attacks and can temporarily close writing operations while preserving existing data during a serious attack.

Skill for Claude Code

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

Part of the web-security-guard plugin — 6 skills, 2 commands shipped together

Good fit Use it to add request limits, temporary IP blocking, attack logs, lockdown mode, optional backups, and alerts to a website or app.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ayalaphiscan/web-security-guard/difesa-attacchi
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 ayalaphiscan/web-security-guard --skill difesa-attacchi
Clone the repo
git clone --depth 1 https://github.com/ayalaphiscan/web-security-guard

Made for: Claude Code.

Or install web-security-guard, the plugin that ships this one along with the rest of its 6 skills, 2 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 difesa-attacchi

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayalaphiscan/web-security-guard/difesa-attacchi/github.svg)](https://agentmods.dev/skills/ayalaphiscan/web-security-guard/difesa-attacchi)
Your own site
<a href="https://agentmods.dev/skills/ayalaphiscan/web-security-guard/difesa-attacchi"><img src="https://agentmods.dev/badge/skills/ayalaphiscan/web-security-guard/difesa-attacchi/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 difesa-attacchi

Your own site · 80×15
<a href="https://agentmods.dev/skills/ayalaphiscan/web-security-guard/difesa-attacchi"><img src="https://agentmods.dev/badge/skills/ayalaphiscan/web-security-guard/difesa-attacchi.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 161 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,427 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.00161 $0.01427
Opus 5 $0.00081 $0.00714
Sonnet 5 $0.00032 $0.00285
Haiku 4.5 $0.00016 $0.00143

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

Security

Grade A, and why

difesa-attacchi 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 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/guardian-express.js), 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.

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/difesa-attacchi/SKILL.md · 67 lines

How it starts

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

Difesa Attacchi (agente guardian) · Attack Defense

🇮🇹 Versione italiana qui sotto · 🇬🇧 English version below

Quando l'utente vuole protezione attiva dagli attacchi, integrare nel progetto il middleware "guardian". Il codice pronto è in references/guardian-express.js (Node/Express); per altri stack (Flask/Django, PHP) adattare la stessa logica.

Cosa fa il guardian

  1. Rilevamento pattern malevoli su URL, query, body e header: SQL injection, XSS, path traversal, command injection, scanner noti.
  2. Rate limiting per IP (generale + più severo su login/pagamenti).
  3. Blocklist automatica: un IP che supera la soglia di richieste malevole viene bloccato temporaneamente, con escalation se recidivo.
  4. Modalità lockdown: se gli eventi malevoli superano la soglia globale, il sito entra in stato di chiusura controllata — risponde 503 con pagina di manutenzione, blocca ogni scrittura, mantiene i dati intatti e (se configurato) esegue un backup e invia un alert.
  5. Logging strutturato di ogni evento in security-events.log per analisi successiva.

Come integrarlo (Express)

const { guardian } = require('./security/guardian');
app.use(guardian({
  rateLimit: { windowMs: 60000, max: 120 },
  strictPaths: ['/login', '/api/auth', '/api/pay'],   // limite 10/min
  lockdown: { threshold: 50, windowMs: 300000, unlockAfterMs: 900000 },
  onAlert: async (evento) => { /* email/webhook all'amministratore */ },
  onLockdown: async () => { /* backup DB, notifica */ }
}));

Montarlo PRIMA delle route. Copiare references/guardian-express.js in security/guardian.js nel progetto e adattare le soglie.

Regole di implementazione

  • Il guardian è una difesa in profondità, NON sostituisce query parametrizzate, validazione e hardening (skill hardening-siti): applicare comunque quelle regole.
  • Dietro proxy/CDN ricavare l'IP reale da X-Forwarded-For solo se il proxy è fidato (app.set('trust proxy', 1)).
  • Il lockdown NON deve mai cancellare dati: solo bloccare l'accesso in scrittura e servire la pagina di manutenzione. Lo sblocco è automatico dopo il timeout o manuale (file flag LOCKDOWN rimovibile / variabile env).
  • Escludere dai controlli i webhook di pagamento verificati con firma (altrimenti payload legittimi possono sembrare sospetti) — la sicurezza lì è la firma (skill privacy-pagamenti).
  • Consigliare SEMPRE anche una protezione a livello di piattaforma (Cloudflare/WAF dell'hosting): il middleware difende l'applicazione, non assorbe DDoS volumetrici.

Read the full file on GitHub · 67 lines

Files

What ships with it

1 file 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. 11d ago First seen · 67 lines · 161 tokens per session scan A 184764b48fb6

Subscribe to this mod's changes

difesa-attacchi is a skill published in the GitHub repository ayalaphiscan/web-security-guard (4 stars, last pushed 3mo ago), licensed MIT. It adds 161 tokens to every session and 1,427 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

ponytail-sec-audit

Full project security audit. Scans the entire codebase across three passes: code that shouldn't exist, all dependencies assessed, all hardening findings. Produces a comprehensive numbered report with blast-radius narrative. Persists findings to .ponytail-sec/ for cross-scan tracking. For per-diff review use…

andypitcher/ponytail-sec · 74 tokens

ponytail-sec

Security companion for active development. Scopes to the current diff or changed files. Three passes: YAGNI code review, new-dep assessment, and up to 3 material hardening findings. Lean by design — surfaces the one thing to fix before merging, not a backlog. Use ponytail-sec-audit for a full project scan.

andypitcher/ponytail-sec · 74 tokens

dockerfile

Binary Dockerfile image-build hardening check. Use when reviewing Dockerfiles, container image builds, multi-stage builds, runtime users, pinned bases, or reproducible dependency installs. Minimal output only: OK or NOTOK: RULE, RULE.

andypitcher/ponytail-sec · 51 tokens

k8s-securitycontext

Binary Kubernetes securityContext hardening check. Use when reviewing Pods, Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, Helm templates, or Kubernetes manifests that define containers. Minimal output only: OK or NOTOK: RULE, RULE.

andypitcher/ponytail-sec · 57 tokens

prowler-commit

Creates professional git commits following conventional-commits format. Trigger: When creating commits, after completing code changes, when user asks to commit.

prowler-cloud/prowler · 33 tokens

create-site

Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…

microsoft/power-platform-skills · 73 tokens