OpenAI prompt engineering guide
Documents prompt engineering as writing effective instructions for models, with guidance on goals, context, examples, structured outputs, constraints, and iterative refinement for non-deterministic model behavior.
What this source can teach
Use this source to understand a platform convention and the setting it was designed for.
- Start with the original. Open the source and find the guidance or example relevant to your task.
- Trace the connection. Use the claim notes below to see how this site applies the source to specific patterns.
- Check the setting. Compare the source's platform, people, and constraints with your own decision.
Pattern Decisions This Source Supports
| Pattern | Supported decision | Required contract | Claim note |
|---|---|---|---|
| Agent plan preview | Choose agent plan preview when an AI agent's proposed multi-step execution needs review before it starts. | The preview names the objective, plan version, source context, model or workflow instructions, planned tools, and expected output before run. | Supports goals, context, constraints, structured outputs, and iterative refinement for model behavior. |
| Editable AI output | Choose editable AI output when the primary object is generated output after creation and users need to revise, review, save, copy, or apply that output. | The generated draft, user edits, tracked changes, source mappings, citations, review status, and final output state are modeled as distinct data rather than one mutable text blob. | Supports distinguishing prompt revision before generation from output editing after generation. |
| Prompt box | Choose prompt box when the central user action is composing and submitting an AI request. | The prompt box always exposes the user's editable draft before submission. | Supports explicit instructions, context, constraints, structured response expectations, and iteration. |
| Regenerate / retry | Choose regenerate / retry when the task is rerunning an AI response attempt, creating a new answer version, continuing a failed generation, or recovering from failed AI source or tool work. | Retry same prompt repeats the submitted prompt and visible context unless the UI explicitly shows which context changed. | Supports distinguishing edited-prompt iteration from regenerating the same submitted prompt. |
| Scope clarification | Choose scope clarification when the AI needs a missing boundary before producing a reliable answer, plan, retrieval query, or tool action. | The system identifies what boundary is missing before asking the user to clarify. | Supports explicit goals, context, constraints, and iterative refinement when instructions are incomplete. |
Comparisons supported by this source
- Agent plan preview vs task list vs recommended next action vs human approval gate vs step navigation
Supports explicit goals, instructions, context, constraints, structured outputs, and iterative refinement for model behavior.
- Editable AI output vs inline edit vs prompt box vs streaming response vs citation display vs source grounding display
Supports the distinction between request composition and generated output editing.
- Prompt box vs prompt suggestions vs command palette vs search suggestions vs textarea
OpenAI guidance supports explicit instructions, context, constraints, and iteration for model prompts.
- Regenerate / retry vs retry vs chat interface vs streaming response vs prompt box vs editable AI output
Supports separating edited prompt iteration from same-prompt regeneration.
- Scope clarification vs prompt box vs search scope selector vs agent plan preview vs human approval gate vs chat interface
Supports explicit goals, context, constraints, and iterative refinement.
Evidence Role
This source is treated as platform-guideline evidence. Its value comes from the specific claims and setting described above.
Publisher: OpenAI. Last checked: .