Short answer: codex exec "your task" runs Codex once, with no interface: progress goes to stderr and only the final answer to stdout, so codex exec "summarise today's data-quality test results in tests/out/" > dq-summary.md just works in a scheduled job. It starts in a read-only sandbox; add --sandbox workspace-write only when it must change files. --json streams every event, and -o file saves the final answer.
Most data teams have a step after the pipeline where a person reads logs and writes a summary. That step is a good fit for an agent: it reads a lot, writes a little, and changes nothing.
Where does it fit in a pipeline?
- 1Loadthe pipeline runs as usual
- 2Testdata-quality tests write their results to a folder
- 3codex execreads the results, writes a short summary (read-only)
- 4Sendthe summary goes to the team channel or an email
Which tasks suit it?
| Task | Fits? | Why |
|---|---|---|
| Summarise test results in plain English | Yes | Reads only, output is text |
| Explain why a load failed, from the log | Yes | Reads only |
| Draft release notes for model changes | Yes | Reads Git history |
| Fix failing data automatically in production | No | Writes, with nobody reviewing |
What should you be careful with?
- Keep the sandbox read-only for reporting tasks; the default already is.
- Use an API key from the CI's secret store, never in the script.
- Treat the output as a draft when it goes to people outside the team.
Where can you check this?
Where do you start?
Get comfortable with Codex at the terminal first: your first Codex task on a data repository. The tests it summarises can come from a data quality quarantine in a Fabric notebook.