Tax Preparation

Codex for Tax Prep: When a Coding Agent Helps a Tax Firm

Bobby Huang7 min read
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.

  1. 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.
  2. 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.
  3. 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.
  4. Second read. The page lists /review and 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.
  5. 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

Join the waitlist

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?
This piece doesn't use Codex that way. Under the Firm's rule, scripts are built and tested only on Doe test files in a separate scripts folder, and the AGENTS.md file tells Codex never to open a client folder. Document and research work is a different job with its own setup.
Does the /review command replace a person reading the diff?
No. The CLI page says the review reports prioritized findings without modifying the working tree. The Firm treats those findings as a second read. A person still reads every diff before a script is approved, and that person's name goes in the change log.
What if a script needs to rename or move files?
That job is out of scope here. The scripts in this approach only read and print a list. If files need renaming or moving, a person at the Firm does it by hand after reading the list, so no script changes a file on its own.
Who approves a script before staff use it?
A person the Firm names, such as a partner or office manager. That person reads the final diff, confirms the output matched the expected output for the Doe test folder, and approves. The change log records the approver with the version label and a one-line reason.
Does someone on staff need to know how to code?
Someone has to be able to read the diff and judge what changed. If no one at the Firm can do that, the Firm keeps the task manual. A script nobody can read is a script nobody can approve.

Share this article

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.