Security Best Practices

Reviews security requirements in Python, JavaScript, TypeScript, and Go and recommends secure defaults.

Security Best Practices is an official curated OpenAI skill for Codex. According to the provider, it supports explicitly requested security guidance, security reports, and secure-by-default coding help for Python, JavaScript, TypeScript, and Go. The source is published in the official openai/skills repository under skills/.curated/security-best-practices, and the skill directory identifies Apache License 2.0 in LICENSE.txt. This catalog entry separates provider documentation from editorial interpretation: the provenance is verifiable, but every concrete recommendation still needs to be evaluated against the project, its dependencies, and its operating environment.

Purpose and Triggering

The skill is intended for a clear security context. According to the provider, it should trigger only when a person explicitly asks for security best practices, a security review, a security report, or secure-by-default coding help. It is not intended for general code review, ordinary debugging, or non-security tasks. That boundary matters because security guidance requires different evidence, priorities, and assumptions than a functional review. Before analysis begins, the team should therefore decide whether an existing codebase is being assessed, new implementation is being hardened, or a structured report is requested.

Languages and Frameworks

The first step is to identify all relevant languages and frameworks in the actual working context. The provider recommends determining the primary backend and frontend stack and checking both sides of a web application. The agent then looks for matching reference documents in the skill directory. The expected filenames use a language, framework, and stack pattern, alongside general language guidance. If no matching references exist, the agent may use well-known general security practices, but a report must disclose that concrete matching guidance was unavailable. This prevents a general recommendation from being presented as project-specific evidence.

Operating Modes

The primary mode uses the discovered guidance to write new code securely and with sensible defaults. In passive mode, the agent identifies especially consequential security issues while performing other development work and raises them for attention. A third mode produces a prioritized report when the user explicitly asks for one. According to the provider, that report should contain a short executive summary and clearly separated severity and urgency sections. Critical findings need an unambiguous impact statement, numbered references, and concrete code evidence with line numbers. After writing the report, the provider specifies the filename security_best_practices_report.md unless the user gives another location.

Safe Boundaries

Recommendations remain bounded by available sources and the visible project context. When the language or framework is unclear, the agent should inspect the repository and state its evidence. Customer-specific rules may intentionally override a best practice, and those exceptions should be documented so future reviewers understand the reason. For catalog use, a report must never contain secrets, credentials, or tokens. Security examples therefore need placeholder values and must avoid dangerous commands. Connected model or agent services may transmit code and context to their respective provider; analysis performed in a local working directory is not automatically a guarantee that no data leaves the system.

General Advice and Limits

The source includes general advice about avoiding predictable public resource identifiers and using sufficiently random identifiers where exposed resources require them. Its TLS guidance distinguishes development environments from real production architecture; missing TLS in local development is not automatically a finding. The source also cautions against blanket recommendations for secure cookies or HSTS when the deployment context is unknown. The skill does not replace an independent security assessment, controlled testing, or professional approval. Teams should validate recommendations against authentication, authorization, data classification, network paths, dependencies, logging, and incident response. Its value is a focused security workflow with explicit assumptions and relevant reference selection, not an automatic guarantee of safety.

Installation instructions

What the Security Best Practices skill does

The Security Best Practices skill comes from OpenAI's official openai/skills repository, where it lives in the project's curated section. According to the provider, the skill performs language- and framework-specific security best-practice reviews and suggests concrete improvements. It is designed to trigger specifically when users explicitly ask for security best-practice guidance, a security review or report, or help with secure-by-default coding. According to the documentation, it is explicitly not meant for general code review, debugging, or other non-security tasks, which is intended to avoid unwanted triggering. Currently supported languages are Python, JavaScript/TypeScript, and Go.

How it works: detection, references, and application

The skill's workflow begins by identifying all languages and frameworks used in the current project context, and according to the documentation both frontend and backend technologies should be considered. It then searches an internal references directory for matching documents whose filenames follow a fixed pattern of language, framework, and deployment area, for example for a specific language-framework combination or for general, framework-agnostic recommendations for a language. If matching reference files are found, the skill reads them completely before starting an assessment or writing new code. If no reference exists for a particular combination, the skill, per the description, falls back on generally known security principles or, when uncertain, additionally researches the topic online.

Three operating modes in practice

After gathering information, the skill can operate in three different modes. In the first, primary mode, it uses the gathered knowledge immediately to write secure code from the outset, which is particularly suited to new projects or newly added features. In the second mode, it acts passively in the background during ongoing development work and flags critical or especially severe violations of the security guidance without reporting every minor deviation, keeping attention on the genuinely important issues. In the third mode, upon explicit request, it produces a structured vulnerability report with concrete fix suggestions for existing code, which is suitable for targeted security audits.

Step 1: Prerequisites and setup

To use the skill, it must be loaded into a compatible agent environment that supports the skill format of the openai/skills repository; the skill definition itself exists as a configuration file with a name and description, complemented by a directory containing the language- and framework-specific reference documents. Before applying it to a concrete project, it is worth briefly checking this reference directory to see which language-framework combinations already have detailed documentation available and where the skill instead has to rely on general knowledge. Since the currently supported languages are limited to Python, JavaScript, TypeScript, and Go, teams working with other technology stacks should scrutinize the results more critically or bring in supplementary tools.

Security, limitations, and best practices

The skill does not replace a dedicated security tool such as a vulnerability scanner or static code analysis; rather, it supplements development work with contextual expertise directly within the conversation with the AI assistant. Its recommendations should be supplemented, especially for security-critical applications, by established automated review tools and, when in doubt, by human security expertise, because the depth of the analysis depends significantly on whether a reference already exists for the given language-framework combination. When no such reference exists and the skill falls back on general knowledge or a one-off online search, the depth of the analysis can vary. On the positive side, the narrow, well-defined scope explicitly avoids triggering unsolicited security warnings on every code change, which makes the skill less intrusive and more targeted in daily use than an always-on review process.

Free
Provider
OpenAI
License
Apache-2.0
Last reviewed
09.09.2026

Repository and documentation

Categories

Compatible with

Codex