DeepDojo.AIPublished 2026-11-17中文

4 Checks Before You Hand a Task to Codex

CodexAI Coding

Take one request: "Fix the missing error message when the login email is empty." Put it in three different projects and you can hand very different amounts of it to OpenAI's Codex. In your own local practice project, where you've found the code, the tests run, and you can undo anything, let it make the small fix directly. In a team's shared validation module that the sign-up and profile pages also depend on, have it check the callers and write a plan first.

And if digging further shows the fix means changing real account data? Then stop at a written summary and a read-only plan, and let someone with the right access decide whether to write anything. The task name didn't change by a single word. The scope of action did, and so does the way you handle it.

Codex can read, edit, and run commands, so before you hand it the controls, ask whether you'd notice a mistake and whether you could recover from it. Four checks answer that:

  • Is the goal clear? Does it know which behavior to change?
  • Is the scope controllable? Does it land on a few files or modules?
  • Can the result be verified? Is there a test, command, or manual step that confirms it?
  • Is the risk acceptable? If it goes wrong, can you catch it and roll back easily?

Pass all four and Codex can edit directly. Unsure about one or two, and it should read the code and plan first. If the request is vague or the risk is high, have it explain and draft options only. Stopping Codex at analysis still counts as useful work.

01 Look at All Four Together

Four checks decide whether a task suits Codex:

Is the goal clear?
Is the scope controllable?
Can the result be verified?
Is the risk acceptable?

Xiaohei pushes a task through four gates: a clear goal, controlled scope, verifiability, and acceptable risk

Weigh them together. A clear goal still needs a risk check, and even a read-only investigation needs you to confirm what it reads and where that information goes. When the conditions aren't there yet, approve analysis and hold off on changes.

02 Goal and Scope: Does It Know What to Change, and How Much?

A clear goal means Codex knows which behavior to change or what result to produce.

A clear goal:

Fix the login page so it shows an error when the email is empty.

An unclear goal:

Improve the login experience.

"Improve" could mean copy, layout, performance, validation, flow, API, or animation. Until the goal is narrowed, Codex has to pick a direction on its own.

When the goal is unclear, ask Codex to break the problem down and list directions first, then choose the specific behavior you want fixed.

Controllable scope means the task lands on a few files, modules, or behaviors:

ScopeHow to judge it as a beginner
One button, component, or functionCopy, display, and edge-case tests are easy to check
One page or one errorHave it explain the data flow and find key files first
The whole login system, permissions, or site-wide performanceAnalyze and plan first
All legacy code or every failing testPick one specific problem first

The bigger the scope, the more Codex should analyze and plan first. The smaller it is, the better it suits direct execution.

03 Verification: Can You Confirm It Worked?

A verifiable result means you can confirm completion with a test, command, page check, screenshot, manual steps, or output comparison. Good tasks usually come with a way to verify them:

When you're done, run the project's actual test command for `LoginForm`.
If you can't run it, explain why and give me manual check steps.

Check the project's docs and test config first to find which command actually runs the target tests. A command from another project may not apply here. Find the command, then look at this run's real output before calling it done.

Say the test for the empty-email validation function passes. You still need to confirm the error reaches the page. You can check that interaction by hand, or with an automated test that covers it.

If the page won't run, report "validation logic tests pass; the on-page message is not yet verified." Writing down manual steps only prepares the check. It counts once someone actually performs them and records the result.

Check typeCommon uses
AutomatedTests, lint, type checks (typecheck)
ManualUI alignment, button clicks, and copy on screen

A task is done only when the result passes a clear check.

04 Risk: Can You Back Out If It Goes Wrong?

Acceptable risk means that even if Codex gets it wrong, you'll catch it in time, roll back easily, and keep the damage small.

First-pass riskTypical actions
LowerReading files, explaining code, small copy changes, pure-function tests, local tests
MediumBusiness components, dependency usage, shared functions, or edits across several related files
Check carefullyDeleting, overwriting uncommitted work, installing dependencies, network access, databases, sensitive data, commits, and deploys

Judge risk by the specific target and consequence. Reading public docs and uploading customer data both use the network, but the impact is very different. A local commit and a deploy to real users need separate judgments too.

A sandbox limits which files Codex can touch, whether it can write, and whether it can reach the network. The approval policy decides which requests need your sign-off. According to Codex's official security guide, local runs default to no network access and writes limited to the current workspace, and all of this can be configured. So check this run's actual settings. Knowing you're in the App or the CLI doesn't tell you the real permissions.

For high-risk tasks, Codex can analyze first. Before it executes anything, it must explain the plan, the blast radius, and how to roll back, and wait for your approval.

For how to confirm deletes, database changes, and deploys step by step, see what to confirm before Codex deletes or deploys.

05 Three Kinds of Task, Three Levels of Authority

Combine the four checks and tasks fall into three groups:

VerdictSignsWhat to do
SuitableClear goal, small scope, verifiable, low riskLet Codex make the change and verify it
Suitable with cautionGoal roughly clear, but scope, risk, or verification uncertainHave Codex read, analyze, and plan first
Not suitable yetVague, high-risk, irreversible, or involves real business decisionsHave Codex only explain, organize the problem, or propose options

"Not suitable yet" means it's too early to hand over execution. Codex can still do read-only checks, list risks, or propose a plan. For example:

Task: Delete duplicate users from the production database
Verdict: Not suitable for direct execution
Safer approach: Have Codex write read-only SQL checks, explain the risks, and list manual confirmation steps; no writes allowed

Another example:

Task: The login form shows no error when the email is empty
Verdict: Suitable
Approach: Limit changes to the login form components and tests, then run the relevant checks

Every verdict ends in a level of authority: how much scope Codex gets, which permissions, and where it waits for your confirmation. The three projects from the opening show why. Changing one file can still affect many pages, and permission to "fix one message" never included account data.

06 Break a Big Task Into Steps You Can Hand Over

Many tasks that aren't ready for direct execution still have plenty of steps you can safely delegate once you split them. Follow the order of understand, plan, execute, verify, and push execution until after you approve. Take "refactor the whole login system":

Task: Refactor the whole login system
Direct verdict: Not suitable for direct execution

After splitting:
1. Read-only analysis: Codex explains the current login flow's files, entry points, and dependencies, and lists issues
2. Human choice: You pick one specific, verifiable issue from the list
3. Small fix: Codex handles only that issue, lists the files it changes, and gives a way to verify
4. Human review: You check the diff and results, then keep or roll back

Still owned by people: prioritization, API change decisions, anything involving user data

Once split, run each step through the four checks again: one goal, a few files, a checkable result, an easy way back. Look at the evidence for this step, then decide what the next step may do.

Anything irreversible, involving real money, user data, or business judgment stays a human decision even after the split. If the login investigation turns up account data that might need changing, stop at a read-only plan and confirm the business reason, the recovery path, and the authorization first. Spreading a delete across several runs leaves the risk of deleting the wrong thing, or overstepping, exactly where it was.

Once the scope is chosen, the next step is writing it as a request Codex can act on. See turn a vague request into a task Codex can finish.

07 Two Candidate Tasks: Which Comes First?

As a beginner, start with these five kinds of task:

  • Explain: a project, file, function, or error, without changing code.
  • Find: the file behind a page, button, API, or error.
  • Small edit: one piece of copy, a style, a small bug, or a single function.
  • Test and verify: add tests for a function, or choose how to check a change.
  • Review: check a small diff for unrelated edits, missing checks, and risk.

When you can't decide between two tasks, compare them on the four checks:

Candidate A: Fix the bug where the login form shows no error for an empty email
  Goal: clear (one specific missing message)
  Scope: login form components and tests
  Verification: the project's real `LoginForm` test, plus one manual empty-form submit
  Risk: save a recoverable version and existing edits first, then make this small change

Candidate B: Add unit tests across the whole project
  Goal: "across the whole project" has no finish line
  Scope: every module
  Verification: hard to define how much coverage counts as done
  Risk: a huge diff that's hard to review

Side by side, A wins for concrete reasons: you know which behavior is missing, where to look, and how to accept the result. B is still doable. Narrow it the way the previous section describes, for example by adding edge-case tests for one function, and schedule it once it has a finish line.

Two common instincts are worth adjusting along the way. It's tempting to think only big tasks are worth it, but small tasks teach you a process you can follow and check, and that pays off sooner. And when a task is "suitable with caution," have Codex read the code, plan, and list the risks; after you confirm, it can still make the change.

When a task is vague, too big, or impossible to check, shrink the goal and add a way to verify it before you decide how much to authorize.

Codex Essentials for Beginners →

Sort a set of tasks into suitable, suitable with caution, or not suitable yet, pick how much authority to give each, and split an oversized task into steps you can delegate.

RSS