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.
npx skills add latestaiagents/agent-skills --skill csrf-protectiongit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote 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.
[](https://agentmods.dev/skills/latestaiagents/agent-skills/csrf-protection)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/csrf-protection"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/csrf-protection/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.
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/csrf-protection"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/csrf-protection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00061 | $0.02173 |
| Opus 5 | $0.00030 | $0.01086 |
| Sonnet 5 | $0.00012 | $0.00435 |
| Haiku 4.5 | $0.00006 | $0.00217 |
Grade C, and why
csrf-protection scanned grade C with 3 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.
Hidden instructionshighPrompt injection
Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.
<!-- Test 3: Image tag (for GET requests) --> Sends data to an external URLlowData exfiltration
A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.
fetch('http://target.com/api/update', { method: 'POST', 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.
return fetch(url, { How it starts
The opening of the file, as written. The whole thing — 365 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CSRF Protection
Prevent Cross-Site Request Forgery attacks on your web application.
When to Use
- Implementing forms that change state
- Building APIs consumed by browsers
- Setting up session cookies
- Reviewing authentication flows
- Any state-changing POST/PUT/DELETE requests
How CSRF Works
<!-- Attacker's malicious page -->
<html>
<body onload="document.forms[0].submit()">
<form action="https://bank.com/transfer" method="POST">
<input name="to" value="attacker" />
<input name="amount" value="10000" />
</form>
</body>
</html>
<!-- Victim visits this page while logged into bank.com -->
<!-- Their session cookie is sent automatically! -->
Protection Methods
1. SameSite Cookies (Primary Defense)
// Express session with SameSite
app.use(session({
secret: process.env.SESSION_SECRET,
cookie: {
httpOnly: true,
secure: true, // HTTPS only
sameSite: 'strict', // Or 'lax' for better UX
maxAge: 3600000
}
}));
// Set-Cookie header result:
// Set-Cookie: sessionId=abc123; HttpOnly; Secure; SameSite=Strict
SameSite Options:
| Value | Behavior |
|---|---|
Strict |
Cookie never sent cross-site |
Lax |
Sent on top-level navigation (default) |
None |
Always sent (requires Secure) |
2. CSRF Tokens (Defense in Depth)
const csrf = require('csurf');
// Setup CSRF middleware
const csrfProtection = csrf({
cookie: {
httpOnly: true,
secure: process.env.NODE_ENV === 'production',
sameSite: 'strict'
}
});
// Apply to routes
app.get('/form', csrfProtection, (req, res) => {
res.render('form', { csrfToken: req.csrfToken() });
});
app.post('/submit', csrfProtection, (req, res) => {
// Token automatically validated by middleware
// Process form...
});
<!-- In your form template -->
<form method="POST" action="/submit">
<input type="hidden" name="_csrf" value="<%= csrfToken %>">
<!-- Other form fields -->
<button type="submit">Submit</button>
</form>
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.
- 6d ago First seen · 365 lines · 61 tokens per session scan C fc690e009df2
csrf-protection is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 61 tokens to every session and 2,173 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 3 findings (hidden instructions, sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
ai-core-web-vitals
A diagnostic assistant for Core Web Vitals, Google's measures of page loading speed, responsiveness, and visual stability. It is intended for technical, product, marketing, and software work.
ai-design-taste-frontend
A frontend visual-quality reviewer that examines whether an interface looks polished and coherent. It produces visual or creative diagnoses, prompt or storyboard ideas, and publishing checks.
ai-extract-design-system
A visual-quality review assistant for examining a product or software interface and its design patterns.
ai-frontend-design
A visual-quality review assistant for checking whether a design is ready to publish.
mcp-app-scaffolding
Scaffolds MCP App project structure with correct directory layout, dependencies, entry points, and framework-specific templates. Handles React (useApp hook), Vanilla JS, Vue, Svelte, Preact, and Solid.
moai-design-tools
Design tool integration specialist covering Figma MCP, Pencil renderer, and Pencil-to-code export. Use when fetching design context from Figma, rendering Pencil designs, or exporting to React/Tailwind code.