Skills / web-security
web-security
Apply web security rules while building or changing a Next.js app (input validation, authorization, secrets, headers, redirects, HTML, rate limits, dependencies) and run secret, header and dependency checks. Use when touching forms, server actions, route handlers, auth, data access, environment variables, next.config or dependencies, or when asked for a security review. Do not use for non-web code or for penetration testing a live site.
- Author
- agentsaisle
- Latest
- v1.0.0
- Aisle
- web, security
- Works with
- Claude Code, Codex, Cursor
- Source
- HazemSalah29/agentsaisle
- Stars
- 2
Install
Install web-security
npx @agentsaisle/cli add web-securityInstalls into your project's skills folder. Add --global to install it for every project.
Runs scriptsThis skill includes scripts
Your agent may run these scripts on your machine. A maintainer has read every one in full, and the CLI lists the files when you install. You can read them on GitHub first.
Read the files on GitHubAudit
- Critical
- 0
- High
- 0
- Medium
- 1
- Low
- 0
6 files · audited 2026-10-29 · rules 1.0.0
MediumAA-P02Can write files and run interpreters without disable-model-invocation
SKILL.md:6
Read Grep Glob Edit Write Bash(node *) Bash(git diff *) Bash(npm audit *) Bash(pnpm audit *)Why The agent may load this skill on its own and then write files and run code in one go.
Fix Set disable-model-invocation: true so the user starts it, or narrow the Bash patterns.
What this skill can use
Tools
- Read
- Grep
- Glob
- Edit
- Write
- Bash(node *)
- Bash(git diff *)
- Bash(npm audit *)
- Bash(pnpm audit *)
Scripts
- scripts/audit-summary.mjs
- scripts/headers-check.mjs
- scripts/secrets-scan.mjs
Domains mentioned
None
Automated checks found the patterns listed here. An audit reduces risk; it is not a guarantee of safety. How audits work · Read the rules
Show this grade in a README
The badge updates when the registry is rebuilt. Paste this Markdown into the README:
[](https://agentsaisle-vercel.vercel.app/skills/web-security)SKILL.md
Rendered from commit 4036c95
Web security
Use when
- You add or change forms, Server Actions, Route Handlers, authentication, data access or file uploads.
- You touch environment variables,
next.config, middleware or dependencies. - The user asks for a security review of web code.
Don't use when
- The code is not part of a web application.
- The request is to attack or probe a site you do not own.
Rules
- Validate every input on the server (zod or similar) and reject unknown fields. Client-side checks are only a convenience.
- Authorize in every Server Action and Route Handler. They are public endpoints. Check who the user is and that they own the thing they are changing, on every call.
- Parameterized queries only. Never build SQL, shell commands or file paths by joining user text. Use the query builder or ORM parameters.
- Keep secrets on the server. Only
NEXT_PUBLIC_variables reach the browser, so never put a key, token or password in one. Mark server-only modules withimport "server-only". - Send security headers: Content-Security-Policy (no
unsafe-eval; avoidunsafe-inlinefor scripts),X-Content-Type-Options: nosniff,Referrer-Policy,Permissions-Policy,Strict-Transport-Security, and frame protection (frame-ancestors). - Redirect only to safe targets. After login or logout, accept relative paths or an allow-list, never a raw URL from the query string.
- Never render user HTML as-is. Avoid
dangerouslySetInnerHTMLwith user content; if unavoidable, sanitize on the server with a vetted library. - Rate-limit sign-in, sign-up, password reset and any expensive or abusable endpoint.
- Keep dependencies honest. Commit the lockfile, add only dependencies you need, and review what a new package does before adding it.
- Fail closed. If a check cannot run or a value is missing, deny the action rather than allow it.
Steps
- List what your change exposes: inputs, endpoints, data, headers, dependencies.
- Apply the rules to each. Fix gaps in the code you are touching; report gaps elsewhere instead of rewriting them.
- Scan your changes for secrets:
node <this skill's folder>/scripts/secrets-scan.mjs. It checks added lines and masks any match. Remove the secret, rotate it if it was ever committed, and load it from the environment. - If you touched
next.configor middleware:node <this skill's folder>/scripts/headers-check.mjs. Add whatever it reports missing. - If dependencies changed:
npm audit --omit=dev --json | node <this skill's folder>/scripts/audit-summary.mjs(usepnpm audit --jsonfor pnpm projects). It prints only high and critical findings. - Fix findings, rerun the same check, and say plainly anything you could not fix.
Budget
- Search first (grep, glob, symbol search). Read line ranges, not whole files.
- Read at most 8 files per step. If you need more, write down what you learned and narrow the question.
- Do not re-read a file you just wrote or edited.
- Prefer the smallest command output that answers the question: head, tail, quiet flags, filtered lists.
- Never print or quote a secret. Refer to it by file and line.
Output
- Changed files and, per rule, what you did when it applied.
- The three check results in one line each (or "not applicable").
- Open risks you did not fix, most serious first.
Done when
secrets-scan.mjsfinds nothing in your added lines.headers-check.mjspasses, or the missing headers are listed with a reason.- No high or critical production vulnerabilities remain, or each is reported with its fix.
- Every new endpoint validates input and checks authorization.
Version history
| Version | Commit | Install |
|---|---|---|
| 1.0.0latest | 4036c95 | add web-security |