Ревью безопасности по стеку

Делает ревью безопасности кода на Python, JavaScript/TypeScript и Go по встроенным спецификациям для десяти фреймворков, пишет отчёт по серьёзности с номерами строк и чинит по одной находке. Для случаев, когда явно нужно ревью по практикам безопасности.

БезопасностьПак: Скиллы OpenAI86 строкsecurity-best-practices
Автор
Источник
openai/skills/skills/.curated/security-best-practices @ 49f948f
Лицензия
Apache-2.0

Об этом скилле

Что делает

Скилл сверяет код со спецификациями безопасности для найденного стека. Сначала агент определяет все языки и фреймворки в работе — и фронтенд, и бэкенд, — затем подгружает подходящие файлы из references/. Их десять: Express, Next.js, Django, FastAPI, Flask и общий Go на сервере; React, Vue, jQuery и общий веб-фронтенд в браузере. Каждый — длинная спецификация правил MUST и SHOULD с идентификаторами вроде EXPRESS-CSRF-001, с признаками для аудита и исправлениями: ввод, редиректы, заголовки, сессии, CSRF, CORS, инъекции, SSRF, загрузка файлов, утечки в ошибках, лимиты против DoS.

Режимов три: писать код, безопасный по умолчанию; по ходу другой работы отмечать только крупные проблемы; по запросу — полный отчёт в security_best_practices_report.md. В отчёте краткое резюме, разделы по серьёзности, пронумерованные находки с номерами строк, а для каждой критической — одна фраза о последствиях. Исправления начинаются только после того, как вы прочитали отчёт: по одной находке и одному коммиту, так, чтобы не сломать код, который держится на небезопасном поведении. Правило проекта, отменяющее практику, важнее. С TLS скилл намеренно осторожен: отсутствие TLS находкой не считается, HSTS не рекомендуется, а флаг Secure у cookie ставится, только если приложение действительно работает по TLS.

Когда включать и когда не надо

Описание ограничивает его явными просьбами: ревью или отчёт по безопасности, рекомендации по практикам, помощь с безопасным по умолчанию кодом. Спецификации есть только для Python, JavaScript/TypeScript и Go; на другом стеке агент опирается на общие знания и предупреждает, что конкретных правил нет. Для обычного ревью кода и отладки он не предназначен.

Как поставить и вызвать

Команда установки ниже скачивает SKILL.md, десять спецификаций, agents/openai.yaml и лицензию. Сам по себе скилл в большинстве задач не включится, поэтому вызывайте его вручную:

  • Claude Code: /security-best-practices или попросить скилл по имени.
  • Codex: $security-best-practices.
  • Cursor: наберите / в чате Agent и выберите security-best-practices.

Пример: /security-best-practices Проверь это приложение на FastAPI и React и напиши отчёт. Пока ничего не исправляй.

OpenAI пометила репозиторий openai/skills устаревшим; наша копия зафиксирована на одном из его коммитов, а новой версии этого скилла в openai/plugins на ноябрь 2026 года нет.

Чем отличается от похожих

Ревью безопасности проверяет дифф, прослеживая недоверенный ввод до опасных вызовов, и сообщает только об эксплуатируемых находках; этот скилл сверяет с правилами фреймворка весь проект, включая неверно настроенные заголовки, cookie и CORS. Ревью безопасности от Sentry сообщает только о находках с высокой уверенностью. Защита кода от уязвимостей — набор правил для написания кода без привязки к стеку. Модель угроз репозитория описывает, как систему можно атаковать, а не сверяет код с правилами. Аудит безопасности кода и сервисов тоже охватывает весь репозиторий, но вместо правил фреймворков ищет уязвимости на границах доверия силами субагентов и отдаёт каждую находку на проверку отдельному агенту.

Установка

Выполните одну команду — она сохранит SKILL.md и файлы, которые он использует, в папку скиллов агента. Claude Code и Codex подхватывают новый скилл без перезапуска; если скилл не появился, перезапустите агента.

Скилл написан на английском — агент поймёт его и ответит вам по-русски.

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 }

Другой агент: сохраните файл в его папку скиллов или дайте ему ссылку на файл: https://anymodel.org/en/skills/openai/security-best-practices/SKILL.md

SKILL.md

Исходник

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.

Подключить через AnyModel API

Скилл работает на той модели, которую использует агент. Подключите Claude Code, Codex или Cursor к AnyModel и запускайте его на Claude, GPT, Gemini и других моделях по одному ключу — оплата за токены, без подписки.

Ещё из пака Скиллы OpenAI

Приложения на ASP.NET Core

Делает работу с ASP.NET Core по актуальным правилам: выбор между Blazor, Razor Pages, MVC и Minimal APIs, Program.cs и порядок middleware, авторизация, EF Core, тесты, переход на .NET 10. Для случаев, когда вы создаёте, ревьюите или обновляете приложение.

Приложения для ChatGPT на Apps SDK

Делает приложения для ChatGPT на Apps SDK: сначала читает документацию OpenAI, выбирает тип приложения, планирует MCP-инструменты, берёт официальный пример или заготовку на Node, проверяет в режиме разработчика. Для случаев, когда приложение живёт в ChatGPT.

CLI по документации API

Делает постоянный CLI по документации API, OpenAPI, curl-запросам или скрипту: JSON на выходе, doctor и dry-run, безопасная авторизация, установка в PATH и скилл-компаньон. Для случаев, когда агент раз за разом ходит в один сервис самодельными запросами.

Измеримая цель до начала работы

Делает из расплывчатого намерения одну измеримую цель с проверкой, границами и условием остановки и заводит её через get_goal и create_goal. Для случаев, когда перед долгой работой агента надо договориться, что считать «готово».

Разбор комментариев к PR на GitHub

Делает пронумерованный список всех комментариев, ревью и построчных тредов PR текущей ветки через GraphQL-скрипт на gh и правит только выбранные вами. Для случаев, когда в PR накопились замечания и вы хотите сами решить, что исправлять.

Починка упавших проверок GitHub Actions

Делает разбор упавших проверок GitHub Actions в PR: через gh скачивает логи, вырезает кусок с ошибкой и составляет план исправления, а код меняет только после одобрения. Для случаев, когда CI в PR красный и сначала нужна причина.

Ноутбуки Jupyter

Делает ноутбуки Jupyter для экспериментов и учебных разборов из готовых шаблонов через скрипт на стандартной библиотеке, с правилами структуры и чек-листом прогона. Для случаев, когда нужен новый ноутбук или старый надо сделать понятным и перезапускаемым.

Задачи и проекты в Linear

Делает работу с задачами, проектами и циклами Linear через его MCP-сервер в строгом порядке: настройка, рамки, чтение, потом запись, с примерами сценариев для триажа, спринтов и релизов. Для случаев, когда агент должен читать или менять Linear по ходу задачи.

Деплой на Netlify

Делает деплой проекта на Netlify через `npx netlify`: проверяет вход, привязывает папку к сайту по Git-remote или создаёт новый, собирает локально и отдаёт адрес превью или прода. Для случаев, когда сайт нужно выложить на Netlify со своей машины.

Управление браузером через Playwright CLI

Делает действия в настоящем браузере из терминала через playwright-cli: снапшоты дают ссылки на элементы для кликов и ввода, плюс скриншоты, консоль, сеть и трейсы, без файлов тестов. Для случаев, когда браузер нужно пройти по шагам.

Деплой на Render

Делает деплой приложения на Render из Git: пишет и проверяет Blueprint render.yaml с сервисами, базами и секретами или создаёт один сервис через MCP-сервер Render, затем смотрит статус и логи. Для случаев, когда приложению нужен хостинг на Render.

Модель угроз репозитория

Делает модель угроз по коду репозитория: границы доверия, активы, возможности атакующего и ранжированные сценарии атак с мерами защиты, а перед итоговым файлом уточняет ключевые допущения. Для случаев, когда явно нужна модель угроз кодовой базы.

Ошибки и события в Sentry

Делает выборку issues и событий из Sentry через CLI sentry, ничего не меняя: свежие ошибки прода, детали issue и события, ИИ-разбор причины, с маскировкой персональных данных. Для случаев, когда нужно понять по Sentry, что ломается на проде.

Деплой на Vercel

Делает деплой на Vercel, по умолчанию превью: через Vercel CLI или, без аккаунта, скриптом, который загружает папку и отдаёт ссылку на превью и ссылку для переноса деплоя в свой аккаунт. Для случаев, когда быстро нужна ссылка на работающий проект.

Контекст дизайна из Figma MCP

Делает код из фрейма Figma через MCP-сервер: контекст дизайна, метаданные, скриншот, затем перевод на компоненты и токены проекта; описывает настройку сервера в Codex. Для случаев, когда нужно подключить Figma MCP или сверстать фрейм по ссылке.

Работа с Figma через use_figma

Делает обязательную подготовку перед каждым вызовом use_figma: правила Plugin API о return, страницах, цветах, шрифтах, ID узлов и работе малыми проверяемыми шагами. Для случаев, когда агент создаёт или правит что-то внутри файла Figma.

Вёрстка по макету Figma

Делает вёрстку по фрейму или компоненту Figma один в один: берёт контекст и скриншот, переводит на токены и компоненты проекта, проходит чек-лист сверки. Для случаев, когда по ссылке на Figma нужен готовый интерфейс в коде.

Макет в Figma из приложения

Делает экран в Figma по коду или описанию — по секциям, из опубликованных компонентов, переменных и стилей файла, без захардкоженных значений. Для случаев, когда страницу приложения нужно перенести в Figma или обновить там.

Дизайн-система в Figma из кода

Делает библиотеку дизайн-системы в Figma по коду за пять фаз с согласованием: разведка, переменные и стили, структура страниц, компоненты по одному, проверка. Для случаев, когда библиотека в Figma должна совпадать с токенами и компонентами кода.

Связка компонентов Figma с кодом

Делает связи Code Connect между опубликованными компонентами Figma и их реализацией в коде: находит несвязанные, подбирает пары в репозитории, связывает одобренные. Для случаев, когда библиотека в Figma и компоненты в коде уже есть, а связи нет.

Правила дизайн-системы для Figma

Делает файл правил для вёрстки по Figma — в CLAUDE.md, AGENTS.md или правила Cursor — по шаблону Figma и разбору кодовой базы. Для случаев, когда агента нужно один раз настроить на регулярную работу с макетами в этом репозитории.

Новый файл в Figma

Делает пустой файл Figma или доску FigJam в черновиках, выбирая тарифный план через whoami, и возвращает ключ и ссылку. Для случаев, когда следующему шагу с Figma нужен новый файл для записи.