Prompt Buddy logoPrompt Buddy

openai · OpenAI Platform Docs

Safety best practices

A guide on implementing safety layers for AI applications, including using the Moderation API, conducting adversarial red-teaming, implementing human-in-the-loop workflows, and applying input/output constraints to pre...

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Safety best practices

A guide on implementing safety layers for AI applications, including using the Moderation API, conducting adversarial red-teaming, implementing human-in-the-loop workflows, and applying input/output constraints to pre...

When To Use

Use when designing an application architecture to mitigate risks like prompt injection, unsafe content generation, or model misuse through technical and procedural safeguards.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/safety-best-practices-workflow-guide.mdA guide outlining strategies for implementing safety measures including the Moderation API, adversarial testing, and human-in-the-loop workflows.Questions about a guide outlining strategies for implementing safety measures including the Moderation API, adversarial testing, and...
examples/safety-best-practices-openai-safety-best-practices-python-implementation.pythonA Python code example demonstrating how to implement safety parameters within an OpenAI Chat Completions API request.Exact payloads, commands, or snippets shown in A Python code example demonstrating how to implement safety parameters within an OpenAI Chat Completions API request.
examples/safety-best-practices-openai-safety-best-practices-chat-completions.curlA curl command demonstrating how to include safety parameters in a chat completions API request.Exact payloads, commands, or snippets shown in A curl command demonstrating how to include safety parameters in a chat completions API request.

What This Skill Covers

  • OpenAI's Moderation API is free-to-use and can help reduce the frequency of unsafe content in your completions. Alternatively, you may wish to develop your o...
  • Main sections: Use our free Moderation API, Adversarial testing, Human in the loop (HITL), Prompt engineering, “Know your customer” (KYC).

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.openai.com/api/docs/guides/safety-best-practices.md