nestjs-security-validator

nestjs-security-validator is a skill for Claude Code from smicolon/ai-kit. It costs 39 tokens per session (608 once invoked), scanned A, original, MIT.

A security guide for NestJS web backends. NestJS is a framework for building server-side TypeScript applications, and the guide covers checking incoming data, limiting repeated requests, protecting routes, security headers, and cross-origin access.

In plain words
What is it for?
Use it when configuring validation, rate limits, login guards, Helmet headers, or CORS in a NestJS API.
Why use it?
It helps reduce common risks such as unwanted input, brute-force attempts, unsafe browser access, and missing authentication checks.

Skill for Claude Code

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

Part of the nestjs plugin — 3 skills shipped together

Good fit Use it when configuring validation, rate limits, login guards, Helmet headers, or CORS in a NestJS API.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/smicolon/ai-kit/nestjs-security-validator
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 smicolon/ai-kit --skill nestjs-security-validator
Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

Or install nestjs, the plugin that ships this one along with the rest of its 3 skills.

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 nestjs-security-validator

README.md
[![agentmods](https://agentmods.dev/badge/skills/smicolon/ai-kit/nestjs-security-validator/github.svg)](https://agentmods.dev/skills/smicolon/ai-kit/nestjs-security-validator)
Your own site
<a href="https://agentmods.dev/skills/smicolon/ai-kit/nestjs-security-validator"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/nestjs-security-validator/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 nestjs-security-validator

Your own site · 80×15
<a href="https://agentmods.dev/skills/smicolon/ai-kit/nestjs-security-validator"><img src="https://agentmods.dev/badge/skills/smicolon/ai-kit/nestjs-security-validator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 608 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.00039 $0.00608
Opus 5.5 $0.00016 $0.00243
Sonnet 5.5 $0.00008 $0.00122
Haiku 4.5 $0.00004 $0.00061

Measured 1mo ago against content hash af950e02e371, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nestjs-security-validator 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.

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.

packs/nestjs/skills/nestjs-security-validator/SKILL.md · 112 lines

How it starts

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

NestJS Security Validator

Enforces security defaults and defensive programming across NestJS applications.

1. Global Input Validation (ValidationPipe)

In main.ts, always configure ValidationPipe with stripping and rejection of unwhitelisted properties to prevent parameter injection:

// main.ts
import { ValidationPipe } from '@nestjs/common'

async function bootstrap() {
  const app = await NestFactory.create(AppModule)

  app.useGlobalPipes(
    new ValidationPipe({
      whitelist: true,               // Strips properties without decorators in DTO
      forbidNonWhitelisted: true,    // Throws error if unknown property is sent
      transform: true,               // Auto-transforms payloads to DTO instance types
      transformOptions: {
        enableImplicitConversion: false, // Explicit types only
      },
    }),
  )
}

2. Rate Limiting (@nestjs/throttler v5+)

Prevent brute-force and DoS attacks:

// app.module.ts
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler'
import { APP_GUARD } from '@nestjs/core'

@Module({
  imports: [
    ThrottlerModule.forRoot([
      {
        name: 'short',
        ttl: 1000,
        limit: 10, // 10 requests per second
      },
      {
        name: 'medium',
        ttl: 60000,
        limit: 100, // 100 requests per minute
      },
    ]),
  ],
  providers: [
    {
      provide: APP_GUARD,
      useClass: ThrottlerGuard,
    },
  ],
})
export class AppModule {}

3. Helmet & CORS Protection

import helmet from 'helmet'

async function bootstrap() {
  const app = await NestFactory.create(AppModule)

  // Security HTTP headers
  app.use(helmet())

  // Explicit CORS
  app.enableCors({
    origin: process.env.ALLOWED_ORIGINS?.split(',') ?? ['http://localhost:3000'],
    methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
    credentials: true,
  })
}

4. DTO Validation Decorators

Every field in DTOs must have explicit class-validator decorators:

Read the full file on GitHub · 112 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. 1mo ago First seen · 112 lines · 39 tokens per session scan A af950e02e371

Subscribe to this mod's changes

nestjs-security-validator is a skill published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 608 once invoked, about $0.0002 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-09-04.