automotif

all articles
ai · 6 min read

AI-assisted coding: a review workflow for Canvas and other AI workspaces

Use an AI coding workspace for scoped edits, then review diffs, run tests and check for sensitive data before accepting generated code into a project.

AI coding workspaces make it easy to produce a lot of code quickly. The hard part is deciding which of that code belongs in your project. This article gives a review workflow that works whether you use ChatGPT's canvas, a chat window with code blocks, or an AI editor, so a small team can accept generated code with the same confidence as code written by a colleague.

What changed with canvas

OpenAI introduced canvas in ChatGPT in 2024 as a workspace next to the chat for editing writing and code.

The product has moved since then. OpenAI's model release notes say that from late May 2026, canvas is no longer available in GPT-5.5 Instant or GPT-5.5 Thinking, and that writing and coding now happen directly in chat through writing and code blocks. The same notes say paid users can keep using canvas through legacy models for a limited time, until those models are retired. Check the release notes before you build a team habit around canvas specifically, because availability depends on your plan and the model you pick.

For that reason, the workflow below does not depend on any one tool. The AI workspace is where a draft gets written. Your repository, your tests and a human reviewer decide what ships.

The rule: the AI drafts, the repository decides

Treat every piece of generated code as an unreviewed pull request from a capable stranger. It may be correct. It may also call a function that does not exist, quietly change behavior you rely on, or include a credential you pasted in as context. None of that is visible until you read the diff and run the code.

That gives three checkpoints that cannot be skipped:

  1. The change is small enough to read in one sitting.
  2. Tests you can rerun prove it does what you asked.
  3. A person who did not write the prompt approves it.

Step 1: scope the request before you open the workspace

Most bad AI edits start with a vague request against a large file. Before prompting, write down:

  • The one file or function that should change.
  • What the code should do after the change, in one or two sentences.
  • What must not change: public function names, database schema, API responses.
  • How you will check it: an existing test, a new test, or a manual step you can describe.

Paste only the code needed for that change. If the AI needs more context, give it more, but keep each request to one behavior. A request like "add input validation to the invoice form handler and return a 400 with a message when the amount is missing" produces a reviewable diff. A request like "clean up this service" does not.

Step 2: get the change into version control as a diff

Whatever workspace you use, do not copy a whole regenerated file over your working copy without looking. Copy the change into a branch and let your version control show you exactly what moved.

git switch -c ai/invoice-validation
# paste or apply the edited code
git diff --stat
git diff

Read git diff --stat first. If you asked for a change to one function and three files moved, stop and find out why. Then read the full diff line by line. Watch for:

  • Deleted code you did not ask to remove, especially error handling and logging.
  • New dependencies or imports. Each one is a supply-chain decision, not a formatting detail.
  • Renamed variables or reformatted blocks that hide the real change. Ask the AI to redo it without unrelated edits.
  • Hardcoded values: URLs, IDs, keys, email addresses.

Version history inside an AI workspace is useful while drafting. It is not a substitute for a commit history your whole team can see.

Step 3: make the tests reproducible

"It worked when I ran it" is not a test. A reproducible test is one that anyone on the team, or your CI system, can run with one command and get the same result.

For each AI-assisted change:

  • Run the existing test suite before applying the change, so you know the baseline.
  • Add at least one test that fails without the change and passes with it. If you ask the AI to write this test, read it carefully: generated tests sometimes assert whatever the code currently does, which proves nothing.
  • Include an edge case you thought of yourself: an empty value, a very long string, a missing field.
  • Run the full suite again after the change.

Running code inside the AI workspace, where available, is a quick sanity check. It runs in a different environment from your project, with different versions and no access to your real configuration, so it does not replace your own test run.

Step 4: check for sensitive data in both directions

Two separate risks apply here.

Going in: anything you paste into an AI tool leaves your machine. Before pasting, remove API keys, passwords, connection strings, customer names and personal data. Use fake values that have the same shape. Check your plan's data controls and your company's policy on what may be shared with which provider.

Coming out: generated code can contain credentials copied from your prompt, placeholder keys that look real, or logging that prints personal data. Search the diff for anything that looks like a key or token before committing. GitHub's documentation says secret scanning runs automatically for free on public repositories; for private repositories, availability depends on your account type and plan, so check the current docs for your setup.

Step 5: require a second person and passing checks

On a small team the person who prompted the AI is often the person who merges. That is where most mistakes get through. If your code lives on GitHub, protected branch rules can require pull request reviews before merging and require status checks to pass before merging. Turn both on for your main branch, and make your test suite one of the required checks.

The reviewer should get a short description with every AI-assisted pull request:

  • What was asked, in one sentence.
  • Which tool and model produced the draft.
  • What the author changed by hand afterward.
  • How it was tested.

That record also helps later, when you are trying to understand why a line exists.

A quick decision table

SituationAccept after reviewNeeds extra careDo not paste into an AI tool
Small function change with testsYes
New third-party dependencyCheck license, maintenance and what it pulls in
Authentication, payments, permissionsSenior review and manual testing
Code containing live keys or customer dataRedact first, or keep it out
Large refactor across many filesSplit into smaller requests

Common failure patterns to watch for

  • The code calls a library function or option that does not exist in the version you use. Your tests and type checker catch this; reading alone often does not.
  • The AI "fixes" a failing test by changing the test instead of the code.
  • Error handling is replaced by a broad catch that hides failures.
  • Comments describe what the code was supposed to do rather than what it does.

Keeping the review steps fixed is what stops fast drafting from turning into slow debugging in production.

Where automotif fits

If your team already writes code with AI tools and wants a shared way of reviewing it, AI enablement is the most relevant service: we train the team on its real tasks and leave a written playbook covering prompts, review and testing. If that sounds useful, book a free call of 30 to 60 minutes to talk it through.

Sources