Security best-practice review

Checks Python, JavaScript/TypeScript and Go code against bundled security specs for ten frameworks, writes a report by severity with line numbers and fixes one finding at a time. Use when you explicitly ask for a security best-practice review.

SecurityPack: OpenAI skills86 linessecurity-best-practices
Author
Source
openai/skills/skills/.curated/security-best-practices @ 49f948f
License
Apache-2.0

About this skill

What it does

The skill checks code against security specs for the stack it finds. The agent first identifies every language and framework in scope, front end and back end, then loads the matching files from references/. There are ten: Express, Next.js, Django, FastAPI, Flask and general Go on the server; React, Vue, jQuery and a general web front end in the browser. Each is a long spec of MUST and SHOULD rules with IDs such as EXPRESS-CSRF-001, with audit patterns and fixes for input, redirects, headers, sessions, CSRF, CORS, injection, SSRF, uploads, error leaks and DoS limits.

It works in three modes: writing secure-by-default code, flagging only major issues in passing during other work, and, on request, a full report in security_best_practices_report.md with an executive summary, severity sections, numbered findings with line numbers and a one-sentence impact for each critical one. Fixes start only after you have read the report, one finding and one commit at a time, careful not to break code that depends on the insecure behaviour. A project rule that overrides a practice wins. On TLS it is deliberately cautious: missing TLS is not reported, HSTS is not recommended, and Secure cookies are set only where the app really runs over TLS.

When to use it, and when not

Its description limits it to explicit requests: a security review or report, best-practice guidance, help writing secure-by-default code. The specs cover Python, JavaScript/TypeScript and Go only; for another stack the agent falls back on general knowledge and says concrete guidance is missing. It is not meant for ordinary code review or debugging.

How to run it

The install command below puts SKILL.md, the ten specs, agents/openai.yaml and the licence in place. Since the description keeps it out of most tasks, call it yourself:

  • Claude Code: /security-best-practices, or ask for the skill by name.
  • Codex: $security-best-practices.
  • Cursor: type / in the Agent chat and pick security-best-practices.

Example: /security-best-practices Review this FastAPI and React app and write the report. No fixes yet.

OpenAI has marked openai/skills deprecated; our copy is pinned to a commit there, and as of November 2026 openai/plugins has no newer version of this skill.

How it differs from similar skills

Security review audits a diff by tracing untrusted input to sinks and reports only exploitable findings; this skill checks the whole project against framework rules, including misconfigured headers, cookies and CORS. Security review, Sentry reports only high-confidence findings. Security hardening is a stack-independent rule set for writing code. Repository threat model maps how the system can be attacked instead of checking code against rules. Security audit for codebases and services also covers the whole repository, but instead of framework rules it hunts for vulnerabilities across trust boundaries with subagents and gives each finding to a separate verifier.

Install

Run one command — it saves SKILL.md and the files it uses into your agent's skills folder. Claude Code and Codex pick up a new skill without a restart; if it does not show up, restart the agent.

Claude Code — macOS, Linux
curl -fsSL --create-dirs -o ~/.claude/skills/security-best-practices/SKILL.md https://anymodel.org/en/skills/openai/security-best-practices/SKILL.md -o ~/.claude/skills/security-best-practices/LICENSE.txt https://anymodel.org/en/skills/openai/security-best-practices/LICENSE.txt -o ~/.claude/skills/security-best-practices/agents/openai.yaml https://anymodel.org/en/skills/openai/security-best-practices/agents/openai.yaml -o ~/.claude/skills/security-best-practices/references/golang-general-backend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/golang-general-backend-security.md -o ~/.claude/skills/security-best-practices/references/javascript-express-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-express-web-server-security.md -o ~/.claude/skills/security-best-practices/references/javascript-general-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-general-web-frontend-security.md -o ~/.claude/skills/security-best-practices/references/javascript-jquery-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-jquery-web-frontend-security.md -o ~/.claude/skills/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md -o ~/.claude/skills/security-best-practices/references/javascript-typescript-react-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-typescript-react-web-frontend-security.md -o ~/.claude/skills/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md -o ~/.claude/skills/security-best-practices/references/python-django-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/python-django-web-server-security.md -o ~/.claude/skills/security-best-practices/references/python-fastapi-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/python-fastapi-web-server-security.md -o ~/.claude/skills/security-best-practices/references/python-flask-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/python-flask-web-server-security.md
Codex, Cursor — macOS, Linux
curl -fsSL --create-dirs -o ~/.agents/skills/security-best-practices/SKILL.md https://anymodel.org/en/skills/openai/security-best-practices/SKILL.md -o ~/.agents/skills/security-best-practices/LICENSE.txt https://anymodel.org/en/skills/openai/security-best-practices/LICENSE.txt -o ~/.agents/skills/security-best-practices/agents/openai.yaml https://anymodel.org/en/skills/openai/security-best-practices/agents/openai.yaml -o ~/.agents/skills/security-best-practices/references/golang-general-backend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/golang-general-backend-security.md -o ~/.agents/skills/security-best-practices/references/javascript-express-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-express-web-server-security.md -o ~/.agents/skills/security-best-practices/references/javascript-general-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-general-web-frontend-security.md -o ~/.agents/skills/security-best-practices/references/javascript-jquery-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-jquery-web-frontend-security.md -o ~/.agents/skills/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md -o ~/.agents/skills/security-best-practices/references/javascript-typescript-react-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-typescript-react-web-frontend-security.md -o ~/.agents/skills/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md -o ~/.agents/skills/security-best-practices/references/python-django-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/python-django-web-server-security.md -o ~/.agents/skills/security-best-practices/references/python-fastapi-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/python-fastapi-web-server-security.md -o ~/.agents/skills/security-best-practices/references/python-flask-web-server-security.md https://anymodel.org/en/skills/openai/security-best-practices/references/python-flask-web-server-security.md
Claude Code — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE.txt','agents/openai.yaml','references/golang-general-backend-security.md','references/javascript-express-web-server-security.md','references/javascript-general-web-frontend-security.md','references/javascript-jquery-web-frontend-security.md','references/javascript-typescript-nextjs-web-server-security.md','references/javascript-typescript-react-web-frontend-security.md','references/javascript-typescript-vue-web-frontend-security.md','references/python-django-web-server-security.md','references/python-fastapi-web-server-security.md','references/python-flask-web-server-security.md') { $p = Join-Path "$HOME\.claude\skills\security-best-practices" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/openai/security-best-practices/$f" -UseBasicParsing -OutFile $p }
Codex, Cursor — Windows PowerShell
foreach ($f in 'SKILL.md','LICENSE.txt','agents/openai.yaml','references/golang-general-backend-security.md','references/javascript-express-web-server-security.md','references/javascript-general-web-frontend-security.md','references/javascript-jquery-web-frontend-security.md','references/javascript-typescript-nextjs-web-server-security.md','references/javascript-typescript-react-web-frontend-security.md','references/javascript-typescript-vue-web-frontend-security.md','references/python-django-web-server-security.md','references/python-fastapi-web-server-security.md','references/python-flask-web-server-security.md') { $p = Join-Path "$HOME\.agents\skills\security-best-practices" $f; New-Item -ItemType Directory -Force (Split-Path $p) | Out-Null; Invoke-WebRequest "https://anymodel.org/en/skills/openai/security-best-practices/$f" -UseBasicParsing -OutFile $p }

Any other agent: save the file into its skills folder, or give it the link to the file: https://anymodel.org/en/skills/openai/security-best-practices/SKILL.md

SKILL.md

Raw

Security Best Practices

Overview

This skill provides a description of how to identify the language and frameworks used by the current context, and then to load information from this skill's references directory about the security best practices for this language and or frameworks.

This information, if present, can be used to write new secure by default code, or to passively detect major issues within existing code, or (if requested by the user) provide a vulnerability report and suggest fixes.

Workflow

The initial step for this skill is to identify ALL languages and ALL frameworks which you are being asked to use or already exist in the scope of the project you are working in. Focus on the primary core frameworks. Often you will want to identify both frontend and backend languages and frameworks.

Then check this skill's references directory to see if there are any relevant documentation for the language and or frameworks. Make sure you read ALL reference files which relate to the specific framework or language. The format of the filenames is <language>-<framework>-<stack>-security.md. You should also check if there is a <language>-general-<stack>-security.md which is agnostic to the framework you may be using.

If working on a web application which includes a frontend and a backend, make sure you have checked for reference documents for BOTH the frontend and backend!

If you are asked to make a web app which will include both a frontend and backend, but the frontend framework is not specified, also check out javascript-general-web-frontend-security.md. It is important that you understand how to secure both the frontend and backend.

If no relevant information is available in the skill's references directory, think a little bit about what you know about the language, the framework, and all well known security best practices for it. If you are unsure you can try to search online for documentation on security best practices.

From there it can operate in a few ways.

  1. The primary mode is to just use the information to write secure by default code from this point forward. This is useful for starting a new project or when writing new code.

  2. The secondary mode is to passively detect vulnerabilities while working in the project and writing code for the user. Critical or very important vulnerabilities or major issues going against security guidance can be flagged and the user can be told about them. This passive mode should focus on the largest impact vulnerabilities and secure defaults.

  3. The user can ask for a security report or to improve the security of the codebase. In this case a full report should be produced describe anyways the project fails to follow security best practices guidance. The report should be prioritized and have clear sections of severity and urgency. Then offer to start working on fixes for these issues. See #fixes below.

Workflow Decision Tree

  • If the language/framework is unclear, inspect the repo to determine it and list your evidence.
  • If matching guidance exists in references/, load only the relevant files and follow their instructions.
  • If no matching guidance exists, consider if you know any well known security best practices for the chosen language and or frameworks, but if asked to generate a report, let the user know that concrete guidance is not available (you can still generate the report or detect for sure critical vulnerabilities)

Overrides

While these references contain the security best practices for languages and frameworks, customers may have cases where they need to bypass or override these practices. Pay attention to specific rules and instructions in the project's documentation and prompt files which may require you to override certain best practices. When overriding a best practice, you MAY report it to the user, but do not fight with them. If a security best practice needs to be bypassed / ignored for some project specific reason, you can also suggest to add documentation about this to the project so it is clear why the best practice is not being followed and to follow that bypass in the future.

Report Format

When producing a report, you should write the report as a markdown file in security_best_practices_report.md or some other location if provided by the user. You can ask the user where they would like the report to be written to.

The report should have a short executive summary at the top.

The report should be clearly delineated into multiple sections based on severity of the vulnerability. The report should focus on the most critical findings as these have the highest impact for the user. All findings should be noted with an numeric ID to make them easier to reference.

For critical findings include a one sentence impact statement.

Once the report is written, also report it to the user directly, although you may be less verbose. You can offer to explain any of the findings or the reasons behind the security best practices guidance if the user wants more info on any findings.

Important: When referencing code in the report, make sure to find and include line numbers for the code you are referencing.

After you write the report file, summarize the findings to the user.

Also tell the user where the final report was written to

Fixes

If you produced a report, let the user read the report and ask to begin performing fixes.

If you passively found a critical finding, notify the user and ask if they would like you to fix this finding.

When producing fixes, focus on fixing a single finding at a time. The fixes should have concise clear comments explaining that the new code is based on the specific security best practice, and perhaps a very short reason why it would be dangerous to not do it in this way.

Always consider if the changes you want to make will impact the functionality of the user's code. Consider if the changes may cause regressions with how the project works currently. It is often the case that insecure code is relied on for other reasons (and this is why insecure code lives on for so long). Avoid breaking the user's project as this may make them not want to apply security fixes in the future. It is better to write a well thought out, well informed by the rest of the project, fix, then a quick slapdash change.

Always follow any normal change or commit flow the user has configured. If making git commits, provide clear commit messages explaining this is to align with security best practices. Try to avoid bunching a number of unrelated findings into a single commit.

Always follow any normal testing flows the user has configured (if any) to confirm that your changes are not introducing regressions. Consider the second order impacts the changes may have and inform the user before making them if there are any.

General Security Advice

Below is a few bits of secure coding advice that applies to almost any language or framework.

Avoid Using Incrementing IDs for Public IDs of Resources

When assigning an ID for some resource, which will then be used by exposed to the internet, avoid using small auto-incrementing IDs. Use longer, random UUID4 or random hex string instead. This will prevent users from learning the quantity of a resource and being able to guess resource IDs.

A note on TLS

While TLS is important for production deployments, most development work will be with TLS disabled or provided by some out-of-scope TLS proxy. Due to this, be very careful about not reporting lack of TLS as a security issue. Also be very careful around use of "secure" cookies. They should only be set if the application will actually be over TLS. If they are set on non-TLS applications (such as when deployed for local dev or testing), it will break the application. You can provide a env or other flag to override setting secure as a way to keep it off until on a TLS production deployment. Additionally avoid recommending HSTS. It is dangerous to use without full understanding of the lasting impacts (can cause major outages and user lockout) and it is not generally recommended for the scope of projects being reviewed by codex.

Connect through AnyModel API

This skill runs on whatever model your agent uses. Point Claude Code, Codex or Cursor at AnyModel to run it on Claude, GPT, Gemini and more with one key — pay per token, no subscription.

More from the pack OpenAI skills

ASP.NET Core apps

Guides the agent through current ASP.NET Core practice: choosing Blazor, Razor Pages, MVC or Minimal APIs, Program.cs and middleware order, auth, EF Core, tests and upgrades to .NET 10. Use when building, reviewing or upgrading an ASP.NET Core app.

ChatGPT Apps SDK

Builds ChatGPT apps on the Apps SDK: reads current OpenAI docs first, picks an app archetype, plans MCP tools, adapts an official example or scaffolds a Node server and widget, then tests in Developer Mode. Use when building or fixing an app inside ChatGPT.

CLI creator from API docs

Builds a durable CLI from API docs, an OpenAPI spec, curls or a script: JSON output, doctor and dry-run commands, safe auth, installed on PATH and paired with a companion skill. Use when an agent keeps hitting the same service through ad hoc calls.

Define a measurable goal

Turns a fuzzy intention into one measurable goal with a validator, scope and stop condition, then registers it via get_goal and create_goal. Use before goal-backed or long-running agent work, when "done" needs a number or a check.

Address GitHub PR comments

Fetches all comments, reviews and inline threads on the current branch's GitHub PR with a gh GraphQL script, numbers them and fixes only the ones you pick. Use when a PR has review comments to work through and you want to choose which get changed.

Fix failing GitHub Actions checks

Finds failing GitHub Actions checks on a PR with gh, pulls the logs, extracts the failure snippet and drafts a fix plan, changing code only after approval. Use when a PR's CI is red and you want the cause and a plan before any edit.

Jupyter notebooks

Creates and tidies Jupyter notebooks for experiments or tutorials from bundled templates via a stdlib script, with structure patterns and a run-top-to-bottom checklist. Use when starting a notebook or turning a messy one into something others can rerun.

Linear issues and projects

Works with Linear issues, projects and cycles through Linear's MCP server in a fixed order: setup, scope, read, then write, with sample workflows for triage, sprints and releases. Use when an agent should read or update Linear as part of a task.

Deploy to Netlify

Deploys the current project to Netlify with `npx netlify`: checks the login, links the folder to a site by Git remote or creates one, builds locally and returns a preview or production URL. Use when you want to publish a site to Netlify from your machine.

Browser automation with Playwright CLI

Drives a real browser from the terminal with playwright-cli: snapshots give element refs for clicks and typing, plus screenshots, console, network and traces, with no test files written. Use when a task needs a browser clicked through step by step.

Deploy to Render

Deploys an app to Render from a Git repo: writes and validates a render.yaml Blueprint with services, databases and secrets, or creates one service through the Render MCP server, then checks status and logs. Use when an app needs hosting on Render.

Repository threat model

Writes a repository-grounded threat model: trust boundaries, assets, attacker capabilities and ranked abuse paths with mitigations, asking you to confirm key assumptions before the final file. Use when you explicitly ask to threat model a codebase.

Sentry issues and events

Reads Sentry issues and events through the sentry CLI without changing anything: recent production errors, issue and event details, AI root-cause summaries, with PII redacted. Use when you ask what is failing in production according to Sentry.

Deploy to Vercel

Deploys a project to Vercel, as a preview unless told otherwise, through the Vercel CLI or, without an account, a bundled script that uploads the folder and returns a preview link and a claim link. Use when you want a shareable deployment link fast.

Figma MCP design context

Reads Figma frames through the Figma MCP server in a fixed order (design context, metadata, screenshot) and rebuilds them with the project's components and tokens; also covers server setup in Codex. Use when connecting Figma MCP or coding from a frame link.

Figma use_figma prerequisite

Sets the rules an agent must load before every use_figma call that runs Plugin API JavaScript in a Figma file: return values, page resets, colours, fonts, node IDs, small validated steps. Use when creating or editing anything inside a Figma file.

Implement a Figma design in code

Implements a Figma frame or component as code in your repo with 1:1 visual parity: fetches context and a screenshot, maps the output to project tokens and components, then runs a validation checklist. Use when a Figma link must become production UI.

Generate a Figma design from an app

Builds or updates a full screen in Figma from code or a description, section by section, using the file's published components, variables and styles instead of hardcoded values. Use when a page from your app should exist as a Figma screen.

Figma design system from a codebase

Builds a Figma design system library from a codebase in five supervised phases: discovery, variables and styles, page structure, components one by one, QA. Use when a product needs a Figma library that matches its code tokens and components.

Figma Code Connect components

Links published Figma components to the code components that implement them via Code Connect: finds unmapped ones, matches them in the codebase, maps only what the user approves. Use when a Figma library and its code both exist but are not linked.

Figma design system rules

Writes project rules for turning Figma designs into code into CLAUDE.md, AGENTS.md or a Cursor rules file, based on Figma's rule template and an analysis of the codebase. Use when setting up an agent for regular Figma-to-code work in a repo.

Create a new Figma file

Creates a blank Figma design file or FigJam board in your drafts, resolving the plan through whoami, and returns the file key and URL. Use when the next Figma step needs a fresh file to write into.