Tax Preparation
Codex for Tax Prep: When a Coding Agent Helps a Tax Firm
Jump to a section
Key takeaways
- OpenAI's help article calls Codex its coding agent, and this approach uses it only for small office scripts.
- Each script job is a read-only checker that prints a list; a person reads the list, decides and acts.
- The Firm keeps one scripts folder under Git, apart from every client folder, with an AGENTS.md file the Firm writes.
- The Firm sets permissions so Codex asks before it edits a file or runs a command.
- Every script is checked against a known answer on Doe test files, and a person reads every diff before approval.
- Each approved version keeps its version label and a change-log row: who asked, who read the diff, who approved and why.
Some of the work around tax prep is code. Small scripts list the files in a folder, check names against the Firm's naming rule, or flag a blank column in an export. Codex is OpenAI's coding agent, and this piece covers using it for that kind of script work and nothing else.
A script lists and checks. Preparing the return stays with the Firm's people in its tax software, and the Firm's Reviewer signs off.
What Codex is, in OpenAI's words
OpenAI's help article on using Codex with a ChatGPT plan says: "This article covers Codex, OpenAI's coding agent that helps you write, review, and ship code." The Codex CLI page on learn.chatgpt.com describes local work this way: "Let Codex inspect files, make edits, and run the tools already installed on your machine." Both pages were read on October 17, 2026, and either can change.
That second line is the reason for care. An agent that can edit files and run tools on a staff member's machine needs a fenced place to work, and setting up that fence is the Firm's job.
The same help article draws a boundary. The help article describes ChatGPT Work as "a separate ChatGPT experience for longer research and deliverable tasks". For document and research work, see ChatGPT for tax preparation.
One more step comes before any script. The CLI page lists "Sign in with ChatGPT" among the ways to sign in on first run. The Firm reads the current terms for the account Codex signs in under before the first request.
Three script jobs worth handing to a coding agent
Each job below is a read-only checker. It reads Doe test files and prints a list. A person reads the list, decides and acts.
Script | What it reads | What it prints |
|---|---|---|
Naming-rule checker | A Doe test folder | Every file whose name breaks the Firm's naming rule; it never renames anything |
Folder-listing compare | Two saved listings of a Doe folder | The files added and the files missing between the two |
Blank-column check | A Doe CSV export | Each row where a column the Firm marks as required is blank |
The Firm keeps this list narrow on purpose. No script moves, renames, deletes or sends a file. No script produces a figure for a return or touches the tax software. If a job needs any of that, a person does it by hand.
The Firm tests each checker against the Doe folder's known answer. Staff resolve any mismatch before approving the script.
Set up the scripts folder first
Before the first request, the Firm creates one scripts folder under version control with Git, separate from every client folder. Inside it sits a Doe test folder with known contents: files named for Doe Holdings, a sample export with made-up rows, and nothing taken from a client. The scripts and their change log stay in that folder, inside the Firm's own systems.
The CLI page lists /init with the description "create an AGENTS.md file with instructions for Codex". The Firm writes its own rules into that file:
- Work only inside this scripts folder.
- Never open a client folder.
- Every script is read-only and prints a list.
- Test every script against the Doe test folder.
For how a Firm writes and owns instructions for document tasks, a different job, see writing AI instructions for tax documents.
The same page lists /permissions, with this line: "Choose when Codex can edit files or run commands without asking, and inspect the active sandbox and writable roots before you continue." The Firm's choice is that Codex asks before it edits a file or runs a command. Before each run, the staff member checks the sandbox and writable roots, meaning which folders Codex may change.
Neither the file nor the setting is the control the Firm relies on. A person still reads every change in the diff: the before-and-after view of each line Codex added, removed or edited.
Build, test, review, then approve
Each script goes through the same five steps.
- Checkpoint. The CLI page says: "Create Git checkpoints before and after a task so you can revert changes." The Firm takes one before each request.
- Write the expected output first. Before the script runs, a staff member writes down exactly what it should print for the Doe test folder. The known-answer idea from where AI fails in tax prep applies here too, to a script instead of a document pass.
- Run and compare. The script runs against the Doe test folder only. Its output is compared line by line with the expected output written before the run, and any mismatch goes back as a fix request.
- Second read. The page lists
/reviewand describes a dedicated review this way: "Codex reports prioritized findings without modifying your working tree, so you can address risks before you commit or open a pull request." The Firm treats that as a second read. It never stands in for a person reading the diff. - Approve and log. A person reads every diff before a script is approved. The change log gets one row: who asked, who read the diff, who approved, the version label, and a one-line reason for the change.
Each approved version keeps its own version label, so earlier versions stay on the record. The Firm limits every script run described here to the Doe test folder. Staff keep Codex and these test runs separate from client folders.
A Doe example
Riley Doe, the office manager at Doe & Co. CPA, asks Codex for a naming-rule checker in the scripts folder. The Doe Holdings test folder holds four files, and two of them are misnamed on purpose. Before the first run, Riley writes the expected output: those two file names and nothing else.
The first run lists three files. Riley reads the diff, finds the check that misreads the naming rule, and asks for a fix. The second run lists the two expected names.
Morgan Doe, a partner, reads the final diff and approves it. The change log gets its row: Riley asked, Riley and Morgan read the diff, Morgan approved, version label v2, reason "fixed a check that flagged a correctly named file."
Nothing in the example opened a client folder. The checker never renamed a file.
Where TracePrep fits
TracePrep's one shipped workflow today is the Reasonable Compensation Study for an S-corporation shareholder-employee. It's a different job from this workflow, and it keeps the same kinds of records:
In this workflow | In the Study |
|---|---|
A script's output is compared with the expected output written before the run | Every figure traces to its source, occupation, geography, and period, at field level |
Each approved version keeps its own version label | Wage evidence is versioned |
Each approved change carries a one-line reason in the change log | Each Preparer adjustment carries a documented rationale |
The change log records who asked, who read the diff, and who approved | The audit log records who prepared, who changed what, and who approved |
A person reads every diff before a script is approved | A qualified Reviewer controls the conclusion and signs off |
This is general information, not tax or legal advice. Your licensed professional and your Firm's Reviewer are responsible for every return and every conclusion. Keep client data inside the systems your Firm has approved. As general guidance only, not advice: if you use an AI tool with client data, firms generally look for a business or commercial plan whose terms cover how that data is handled; read the vendor's current terms before you do.
Frequently asked questions
Can Codex read our clients' tax documents for us?
Does the /review command replace a person reading the diff?
What if a script needs to rename or move files?
Who approves a script before staff use it?
Does someone on staff need to know how to code?
Bobby Huang · founder of TracePrep Inc.
Bobby Huang is the founder of TracePrep Inc. TracePrep is a tax-prep platform for CPA, EA, and accounting firms, and it also produces the Reasonable Compensation Study.
Related reading
- Tax Preparation
A Status Board for AI-Drafted Files: Where Each File Stands
How a manager keeps a status board for AI-drafted files: six fixed stages, one owner and one date per file, and a weekly read for files stuck in a stage.
Bobby Huang7 min read - Tax Preparation
When a Source Page Can't Be Read: Poor Scans and the AI Pass
How a Firm can have a Preparer screen poor scans before an AI drafting pass, hold back pages a person can't read with confidence, and get a clean copy or key by hand.
Bobby Huang8 min read - Tax Preparation
Marking Hand Edits on an AI-Drafted Entry List
How a Firm can have a Preparer mark each AI-drafted row as drafted, edited or keyed by hand, and have the Reviewer read changed rows, then the rest, before sign-off.
Bobby Huang7 min read