You ask an AI coding agent to fix payments. It changes the code, runs the tests, and reports that everything is green. Is the work ready to merge?
Before you decide, there are three things worth understanding: what the agent was allowed to change, whether the checks still test what you asked for, and whether someone approved the final version.
The same questions matter when developers, agents, or both contribute to the task. Let’s follow one payment fix through them.
Your expected outcome is simple: a signed-in customer pays 900 and receives a paid receipt for 900. That requirement stays the same while the implementation changes.

Before the fix: what is the agent allowed to do?
“Fix payments” describes the assignment. It does not settle whether the agent may merge its own change, deploy it, access production credentials, or alter the rules for approval.
For this task, you might permit local edits, relevant tests, and a proposed pull request. A pull request gives the team a place to review the change before it joins the main code. Keep the authority to merge or release with the people you have assigned those decisions to.
Here is one way to make those boundaries concrete:
| Action | Access for the payment task | Who owns the next decision? |
|---|---|---|
| Edit relevant code and run checks | Assigned workspace and test resources | Task owner reviews scope changes |
| Propose a pull request | Scoped repository access | Reviewer assesses the proposal |
| Merge into main | Required repository approvals and checks | Authorized maintainer |
| Deploy or use production credentials | Separate approved deployment access | Release owner |
| Change review or access rules | Repository administration access | Authorized administrator |
An instruction saying “do not deploy” is useful, but an access restriction does a different job. Ask which credentials and tools the agent actually has. If deployment credentials are available to its process, the wording of the assignment has not removed them.
The token used by an automated verification workflow is another boundary. This permission excerpt requests read access to repository contents:
permissions:
contents: read
That setting concerns the workflow’s GitHub token. It does not restrict every credential available to an agent, its local filesystem, or its network access. Scope each part deliberately. GitHub’s secure workflow guidance covers minimum token permissions and approval controls for environment secrets.
Worktrees can keep task files separate. They do not establish these access boundaries.
The question to ask is: “Can it propose this fix without also having authority to merge or deploy it?”
During the fix: did the condition for passing change?
Now the payment patch is ready for review. The test passes. Open the change and look at the test alongside the feature code.
Suppose the payment function still returns a receipt amount of 1,000 when called with 900. The original test checks both the paid status and the amount. It fails, correctly exposing the disagreement.
Then the amount assertion is removed. The remaining test checks the paid status. It passes, even though the receipt amount is still wrong.
Before: the test checks paid status and the amount.
self.assertEqual(receipt["status"], "paid")
self.assertEqual(receipt["amount"], 900)After: only the status check remains.
self.assertEqual(receipt["status"], "paid")Notice what disappeared: the comparison with 900. The customer requirement has not changed. Only the test’s ability to detect that particular failure has changed.
We can see the difference by running the focused payment test in three states:
| What was checked? | Receipt amount | Test result |
|---|---|---|
| Paid status and amount, before the fix | 1,000 instead of 900 | Fails |
| Paid status only, with the amount assertion removed | Still 1,000 | Passes |
| Paid status and amount, after correcting the code | 900 | Passes |
The original check fails against the wrong receipt. The weaker check passes against the same wrong receipt. After restoring the amount assertion and correcting the payment function, the meaningful check passes too.
A green result therefore needs a question attached: what did it actually verify? This focused test checks receipt behavior; the complete signed-in purchase still needs its relevant checks.
One payment fix. Three controls.
The receipt must show 900 throughout. Watch what happens to access, evidence, and approval.
The task may edit and test a proposed payment fix. Merging and deployment need separate authority. A written instruction and an enforced boundary are different controls.
Read the full explanation
- Set the permission boundary. The task may edit and test a proposed payment fix. Merging and deployment need separate authority. A written instruction and an enforced boundary are different controls.
- The meaningful check fails. The receipt shows 1,000 instead of 900. The amount assertion detects the wrong behavior.
- The assertion is removed. Only paid status is checked. The workflow passes, but the receipt still shows 1,000. The expected outcome has not changed.
- Restore the required check. The amount assertion is restored. The same wrong receipt fails again; the payment behavior still needs correction.
- Correct the behavior and review V1. The payment function now returns the requested amount. The original assertion passes. A reviewer assesses V1.
- Another commit creates V2. The proposal changes after V1 was reviewed. The applicable repository rules determine the review needed for V2. The V1 approval alone does not describe the new edits.
- Review the final version. The final proposal needs the required checks and review under the chosen rules. Merging and deployment remain separate decisions.
Changing a test is not automatically a problem. A changed requirement or an inaccurate old test may justify it. The reviewer needs to understand the reason and confirm that the replacement still protects the intended outcome.
Apply the same attention when the patch changes the workflow that runs the tests, its permissions, or a dependency used to execute them. If a check stops running, the remaining green checks cannot speak for it.
You can ask for the explanation in ordinary language: “What changed in the checks, and why does the new version still protect the payment outcome?”
Before merging: was this version approved?
The amount check is restored, the payment function is corrected, and the reviewer approves the proposal. Call that reviewed version V1.
Then another commit arrives. The agent describes it as a small follow-up. The proposal is now V2. It may be a good change, but the earlier approval concerned a different version.
- V1 reviewedApproval concerns these changes
- New commit → V2The proposal has changed
- Review V2Apply the repository rules
- Merge decisionCheck final evidence
GitHub provides configurable review controls for this situation:
- Dismiss stale approvals: a qualifying change to the proposed diff can require approval again.
- Require approval of the most recent reviewable push: an authorized reviewer other than the latest pusher must approve the latest reviewable changes.
These are separate settings. Your team should inspect which requirements apply and who can bypass them. GitHub’s protected branch documentation explains the behavior and the choices.
You do not need to configure every setting yourself to ask a useful question: “Does the required approval cover the version we are about to merge?”
Also keep the evidence separate. An approval says someone reviewed a change. A test result records what ran against a particular version. Neither should silently substitute for the other.
A merge queue can help check proposed combinations as main changes. The tests it runs still need to protect the intended behavior, and the applicable review requirements still matter.
Three questions before you accept “done”
Return to the same payment fix. Before approving the next step, ask:
- What could the agent change or execute? Look at the actual access boundaries, including separate authority to merge or deploy.
- Do the checks still protect the agreed outcome? Review changes to the tests and the machinery that runs them.
- Does approval cover the final version? Identify the proposed revision and the review requirements it satisfies.
Apply these questions to one upcoming pull request. Ask to see the relevant permission configuration, the feature and test diff, and the latest review state. Each artifact answers a different part of the decision.
Merging and deployment remain separate steps. Name who authorizes release and verifies the running payment flow. If the outcome fails later, preserve the evidence for investigation and recovery.
Delegating implementation also means deciding who can change the checks and who approves the result. That gives you a practical way to assess the next “done” message before it becomes a customer-facing change.