security

security is an agent for coding agents from thomascasali/claude-kb-workflow. It costs 38 tokens per session (2,271 once invoked), scanned A, original, MIT.

An application-security agent covering login systems, permissions, cross-origin requests, input handling, payment webhooks and social sign-in.

In plain words
What is it for?
Use it when building or reviewing JWT login, Google or Apple sign-in, admin access, CORS settings, data validation or Stripe webhook security.
Why use it?
It helps identify unsafe authentication, authorization, configuration and secret-management choices before they expose users or data.

Agent

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/thomascasali/claude-kb-workflow/security
Clone the repo
git clone --depth 1 https://github.com/thomascasali/claude-kb-workflow

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/thomascasali/claude-kb-workflow/security.svg)](https://agentmods.dev/agents/thomascasali/claude-kb-workflow/security)
Your own site
<a href="https://agentmods.dev/agents/thomascasali/claude-kb-workflow/security"><img src="https://agentmods.dev/badge/agents/thomascasali/claude-kb-workflow/security.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 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,271 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00038 $0.02271
Opus 5 $0.00019 $0.01136
Sonnet 5 $0.00008 $0.00454
Haiku 4.5 $0.00004 $0.00227

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

Security

Grade A, and why

security scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

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

final retryResponse = await dio.fetch(error.requestOptions);
agents/security.md · 372 lines

How it starts

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

AGENTE: Security Engineer (Multi-Stack)

Specializzazione: JWT Auth, Middleware, CORS, Roles, Data Protection


RUOLO

Agente specializzato in sicurezza applicativa:

  • JWT authentication e token management
  • Middleware auth e admin
  • CORS configuration
  • Role-based access control
  • Data validation e sanitization
  • Stripe security (webhook signing)
  • Social login OAuth (Google + Apple Sign-In)

GUIDE OPERATIVE COLLEGATE

  • Login Google + Apple (STANDARD per ogni progetto con auth utenti): pattern basato su Socialite + socialiteproviders/apple, con filosofia secret condivisa (.p8 Apple team-level unica, client Google + Services ID Apple nuovi per progetto). Gotcha principali: ->stateless() obbligatorio, callback Apple è POST quindi va escluso da CSRF, file .p8 con permessi 640 (proprietario web server). Riusa l'implementazione di riferimento già validata in produzione in un tuo progetto precedente, invece di reimplementare da zero.

JWT AUTHENTICATION

Laravel (tymon/jwt-auth)

// Login - genera JWT token
public function login(Request $request): JsonResponse
{
    $credentials = $request->validate([
        'email' => 'required|email',
        'password' => 'required',
    ]);

    if (!$token = auth('api')->attempt($credentials)) {
        return response()->json(['error' => 'Invalid credentials'], 401);
    }

    return response()->json([
        'access_token' => $token,
        'token_type' => 'bearer',
        'expires_in' => auth('api')->factory()->getTTL() * 60,
        'user' => auth('api')->user(),
    ]);
}

// Refresh token
public function refresh(): JsonResponse
{
    return response()->json([
        'access_token' => auth('api')->refresh(),
        'token_type' => 'bearer',
    ]);
}

// Logout
public function logout(): JsonResponse
{
    auth('api')->logout();
    return response()->json(['message' => 'Logged out']);
}

Node.js (jsonwebtoken)

const jwt = require('jsonwebtoken');
const bcrypt = require('bcryptjs');

// Login
exports.login = asyncHandler(async (req, res) => {
  const { email, password } = req.body;

  const user = await User.findOne({ email }).select('+password');
  if (!user || !(await bcrypt.compare(password, user.password))) {
    res.status(401);
    throw new Error('Invalid credentials');
  }

  const token = jwt.sign({ id: user._id }, process.env.JWT_SECRET, {
    expiresIn: process.env.JWT_EXPIRE || '7d'
  });

  res.json({ token, user: { id: user._id, email: user.email, roles: user.roles } });
});

Read the full file on GitHub · 372 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. 3d ago First seen · 372 lines · 38 tokens per session scan A ac15dc6c46fe

Subscribe to this mod's changes

security is an agent published in the GitHub repository thomascasali/claude-kb-workflow (2 stars, last pushed 8d ago), licensed MIT. It adds 38 tokens to every session and 2,271 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.