- Home
- Skills
- APIs & Backend
- NestJS Safety Check
More screenshots
Works with the AI Agents you already use
NestJS Safety Check
One handleRequest override that returns the user without throwing lets every request through your JwtAuthGuard, token or not.
$5
NestJS Safety Check
Example session with this skill installed
Check this project with nestjs-safety-check.
- Read your context and instructions
- Compiled the nestjs safety check
$ python3 scripts/check_nestjs.py examples/risky
BLOCK src/app.module.ts:17 NS02 HARDCODED_SECRET
password: '<redacted>',
Why: A secret is written in the code: the JWT secret of JwtModule.register, jwtService.sign or a Passport strategy's secretOrKey (even a placeholder such as the docs' 'DO NOT USE THIS VALUE' text), a jwtConstants object, a database password or connection URL with a password, or a literal fallback such as process.env.JWT_SECRET || '...' or config.get('JWT_SECRET', '...'). Anyone with the code or the git history can sign their own tokens as any user or admin, or log in to the database.
Safer: Read secrets at run time with ConfigService (config.getOrThrow('JWT_SECRET')) in JwtModule.registerAsync or TypeOrmModule.forRootAsync, keep them out of git (.env in .gitignore, a secrets manager in production), fail at start when one is missing instead of falling back to a literal, and rotate every secret that was committed.
BLOCK src/app.module.ts:20 NS01 ORM_SCHEMA_SYNC_ON
BLOCK src/auth/constants.ts:2 NS02 HARDCODED_SECRET
BLOCK src/orders/orders.service.ts:15 NS03 RAW_SQL_FROM_VALUES
REVIEW src/app.module.ts:22 NS16 AUTH_ROUTE_NOT_RATE_LIMITED
REVIEW src/auth/auth.controller.ts:12 NS16 AUTH_ROUTE_NOT_RATE_LIMITED
REVIEW src/auth/jwt-auth.guard.ts:24 NS17 GUARD_LETS_REQUESTS_THROUGH
REVIEW src/auth/jwt.strategy.ts:11 NS17 GUARD_LETS_REQUESTS_THROUGH
REVIEW src/main.ts:7 NS14 NO_HELMET
REVIEW src/main.ts:8 NS13 CORS_ANY_ORIGIN_WITH_CREDENTIALS
REVIEW src/main.ts:10 NS11 VALIDATION_PIPE_MISSING_OR_OPEN
REVIEW src/main.ts:16 NS15 API_EXPLORER_IN_PRODUCTION
REVIEW src/orders/orders.service.ts:22 NS20 SORT_COLUMN_FROM_VALUE
REVIEW src/users/user.entity.ts:12 NS19 PASSWORD_FIELD_RETURNED
REVIEW src/users/users.controller.ts:21 NS12 BODY_NOT_VALIDATED
REVIEW src/users/users.controller.ts:25 NS18 PUBLIC_ROUTE_CHANGES_DATA
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 13 files, 12 with NestJS content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
One synchronize: true left in TypeOrmModule.forRoot, as in the docs example, lets TypeORM drop a column and its data the first time someone renames an entity property in production. One handleRequest override that returns the user without throwing lets every request through your JwtAuthGuard, token or not. This skill finds those and eleven other NestJS mistakes before you deploy, and tells you how to fix each one.
Your agent runs a scanner on your NestJS source: main.ts, modules, controllers, guards, Passport strategies, TypeORM entities and data sources, services and ormconfig.json. It knows the NestJS patterns (useGlobalPipes and APP_PIPE, APP_GUARD with ThrottlerGuard, the docs' @Public() decorator with a global JwtAuthGuard, JwtModule.register, ClassSerializerInterceptor with @Exclude), follows SQL text through the variables that build it, judges each app of a monorepo on its own, skips comments and test files, and accepts the usual fixes (query parameters, ParseIntPipe, config.getOrThrow, an environment check around Swagger). The safe example project, written the way the NestJS docs recommend, passes clean. It never runs Nest or your app. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed, even on lines another rule reports.
What it checks
BLOCK
- NS01: TypeORM synchronize or dropSchema set to true, or Sequelize sync with force or alter, in app config
- NS02: hard-coded secrets (JWT secret or secretOrKey, jwtConstants, database passwords and connection URLs in code or ormconfig.json, literal fallbacks such as process.env.JWT_SECRET || '...')
- NS03: SQL built from changing values (query(), $queryRawUnsafe, QueryBuilder where or having with ${...} or +)
REVIEW
- NS11: no global ValidationPipe, or one without whitelist: true
- NS12: @Body() or @Query() typed any, as an interface or generic, or as an array without ParseArrayPipe
- NS13: CORS that allows credentials from any origin (origin: true or '*' with credentials: true)
- NS14: no helmet in an HTTP app
- NS15: Swagger UI with no environment check, or GraphiQL or introspection forced on
- NS16: login and other auth routes without rate limiting (no ThrottlerGuard bound, or @SkipThrottle)
- NS17: guards that let requests through (handleRequest that never throws, canActivate that only returns true, ignoreExpiration: true)
- NS18: @Public() on routes or controllers that create, change or delete data
- NS19: password columns that can end up in responses (no select: false, or @Exclude without ClassSerializerInterceptor)
- NS20: sort columns taken from request values (orderBy(dto.sort), orderBy(
p.${sort})) with no allow-list check
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example NestJS project (main.ts, app module, auth module, JWT strategy and guard, controllers, a TypeORM entity and a service), and the real report the scanner produces on the risky one
Limits It reads each file on its own, plus a few app-wide facts (helmet, a global pipe, a bound throttler guard, a serializer) when you check a folder. Values passed between files, DTO classes defined elsewhere, guards built by factories and options built at run time are not followed. Authorization inside handlers, CSRF, Mongoose queries, WebSocket gateways and dependency vulnerabilities are not checked. NOT FLAGGED is not a guarantee.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Static check of NestJS source text. Values passed between files, factory-built guards and options, authorization inside handlers and dependency vulnerabilities are not checked. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The secrets in the risky example are fake and marked EXAMPLE. Nothing is run.