AI Coding Agents: What to Check Before You Ship Their Code
The demo works. Now try another account, a failed request, and a retry. A practical way to review agent-written code before customers depend on it.
By Duangduean Studios

The button works. The build is green. The agent says the task is finished. Before you deploy, sign in as a second user and click it again.
That small change catches a surprisingly important class of mistakes. A feature can work perfectly for the person building it while exposing another account’s records or letting an ordinary user perform an admin action. The happy path proves that one route through the feature works. Shipping asks much more of it.
GitHub’s guidance for coding agents makes the developer responsible for reviewing and testing generated work, including its security. That responsibility becomes easier to manage when the review follows the behaviour of the feature. GitHub’s responsible-use guidance
Read the change through a user’s eyes
Take an example: an agent adds a download button for a private invoice. Start at the page where a customer finds the invoice, follow the request to the server, and check how the server decides which account owns it.
Then try another invoice identifier while signed in as a different customer. A hidden button is a presentation choice. The server still needs to check whether the caller may read the requested record.
For an admin feature, make the same trip with an ordinary account. Reviewing those two situations often exposes more than staring at a large diff and hoping the important line stands out.
Interrupt the operation halfway through
Suppose a new article form uploads a cover and then inserts a database row. What happens if the upload succeeds and the database write fails? Does retrying create two files? Does the user get a useful message? Can they safely submit again?
Pick a likely failure point and test it deliberately in a development environment. Repeat clicks, expired sessions, slow responses, and missing records are ordinary conditions. A finished feature needs a coherent outcome for them.
Ask what the change can reach
Look at new dependencies, environment variables, outbound requests, and logging. Check that credentials stay on the server and that error reports avoid recording private request bodies. If the agent introduced a package, confirm that it exists, does the required job, and fits the project’s licence and maintenance needs.
Keep the agent’s own working permissions tied to the task as well. A formatting fix needs a much smaller set of capabilities than a production migration. Permissions become easier to review when you can explain why each one is needed.
Match the tests to the risk
A spelling correction and a payment retry deserve different effort. For behaviour changes, run the existing checks and add targeted coverage when a specific failure could otherwise return unnoticed. A test is valuable when it demonstrates the requirement or catches a plausible regression.
Finally, ask the agent for the files changed, the checks it actually ran, and anything it could not verify. Read the results alongside the code. The goal is to understand the feature well enough that you can explain why it is ready to ship.
Our article on agents leaving the sandbox explores what can happen when tool access reaches beyond the intended environment.
Frequently asked questions
What should I check before shipping code written by an AI coding agent?
Follow the feature as a user: sign in as a second user and as an ordinary non-admin user and try it again, interrupt the operation halfway, check new dependencies, environment variables, outbound requests and logging, and match the tests to the risk of the change.
Who is responsible for code written by an AI agent?
The developer. GitHub's guidance for coding agents makes the developer responsible for reviewing and testing generated work, including its security.
Why test with a second user account?
A feature can work perfectly for the person who built it while exposing another account's records or letting an ordinary user do an admin action. Hiding a button is not enough; the server must check whether the caller may access the record.


