OpenAI / Codex9 minLesson 11 of 60

Prompting Codex for Agentic Coding

OpenAI's prompting guidance for coding agents lines up with the foundations in this course: define the agent's role, make tool use explicit, demand testing, and set clear output standards. The wording differs by model, but the spine is the same.

Be explicit about tools

OpenAI recommends passing tools through the proper tools mechanism rather than describing them by hand in the prompt. The model handles structured tool definitions better than prose, and you avoid drift between what you wrote and what the tool actually does.

Demand verification

Tell the agent to test its own work before declaring victory. A coding agent that runs the suite and reads the output catches its own mistakes. One that does not will confidently hand you broken code.

Set output standards
Spell out formatting expectations, like clean Markdown in summaries or a specific commit style. Models follow standards you state and guess at ones you do not.
OpenAI CookbookFree, open-source collection of guides and examples, including model-specific prompting guides for agentic coding.cookbook.openai.com
Finished this lesson? Mark it read to track your progress.