OpenAI Codex for data engineers: what it does in a repo

Codex is OpenAI's coding agent: it reads your code, edits files and runs commands, inside a sandbox, with an AGENTS.md for your rules. What that means in a repository of SQL, Python and pipeline definitions, and how to start safely.

Short answer: Codex is OpenAI's coding agent. In a data repository it can read your SQL, Python and pipeline files, edit them and run commands such as tests or a dbt build, in your terminal (Codex CLI), your editor, the ChatGPT desktop app or the cloud. Locally it works inside a sandbox that limits what it may touch, and an AGENTS.md file tells it your project's rules. Start with read-only questions, then small changes you review with /review.

Data engineering repositories are full of jobs an agent is good at: renaming a column across forty models, adding tests to transformations, writing the boring half of a pipeline. They are also full of things it must not touch, like production connections. The sandbox and AGENTS.md are how you draw that line.

Nothing loads from YouTube until you press play. Then Google receives your IP address and may set its own storage. Narrated with an AI-generated voice. Privacy

What can it do in a data repo?

Refactorrename a column across every SQL model and its tests
Testadd tests for nulls, unique keys and accepted values to transformations
Explain"what does this 400-line stored procedure do, step by step?"
Scaffolda new pipeline from an existing one as the pattern
Review/review on your changes before you commit
Data engineering jobs for Codex

How do you set the rules?

  1. Sandboxlimits where it can write and whether it can use the network
  2. Approvals/permissions: what it may do without asking
  3. AGENTS.mdthe project's rules: how to test, naming, never touch prod
  4. Gita checkpoint before each task, so any change can be undone
What keeps Codex in bounds

What should go in AGENTS.md for data?

  • The test command and the build command, exactly.
  • Which folders hold sources, models and tests.
  • The naming rules for tables and columns.
  • "Never connect to production; use the dev profile."

Run /init once and Codex writes a first version you then edit.

Where can you check this?

Where do you start?

Take a first small task with your first Codex task on a data repo, and compare it with the Anthropic agent in Claude Code vs Codex for data work.

Keep reading

More from the blog.

Every post

Next

Building this? Say hello.

A question about this post, a pattern you would build differently, or the next thing you want written out: Behnia reads every message.