difesa-attacchi

difesa-attacchi is a skill for Claude Code from ayalaphiscan/web-security-guard. It costs 161 tokens per session (1,534 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 — 15 skills, 4 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 15 skills, 4 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,534 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.01534
Opus 5.5 $0.00064 $0.00614
Sonnet 5.5 $0.00032 $0.00307
Haiku 4.5 $0.00016 $0.00153

Measured 1mo ago against content hash db205336e22c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 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.
  • Il guardian gira dentro l'applicazione: non può fermare una falla dell'interprete (PHP, Node.js) che scatta prima del codice, come PHP2Shell nell'ottobre 2026. Contro quelle serve il runtime aggiornato (skill aggiornamenti-runtime).
  • 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 · 69 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. 1mo ago Changed · +2 lines db205336e22c
  2. 3mo 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 1mo ago), licensed MIT. It adds 161 tokens to every session and 1,534 once invoked, about $0.0006 per session on Opus 5.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

difesa-attacchi compared with skills from other repositories

difesa-attacchi next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
difesa-attacchiayalaphiscan/web-security-guardSkill41mo agoMITA161Claude Code
ponytail-sec-auditandypitcher/ponytail-secSkill62todayMITA73Claude Code
prism-hardentonone-ai/tononeSkill85yesterdayMITA47Claude Code
ponytail-secandypitcher/ponytail-secSkill62todayMITA73Claude Code
ponytail-sec-triageandypitcher/ponytail-secSkill62todayMITA60Claude Code
dockerfileandypitcher/ponytail-secSkill62todayMITA51Claude Code
k8s-securitycontextandypitcher/ponytail-secSkill62todayMITA57Claude Code