zero gravitySOLUTIONS
← All insightsENGINEERING PARTNERSHIPS / REVIEW EXPERIMENT

Make AI-assisted engineering easy to review

QUICK ANSWER

AI-assisted changes need the same inspectable evidence as other software: a clear invariant, relevant counterexamples, trusted input boundaries, and checks that actually ran. Keep changes focused, review dependencies and data handling, and make a person responsible for the acceptance decision.

Inside this article 6 sections

AI-assisted software delivery remains reviewable when a person can connect the requested behavior to the changed code and the evidence that it works. A long generated explanation is not that connection. The review package should make the important assumptions, boundaries, and failure cases inspectable without replaying an entire chat.

Use AI to accelerate implementation, investigation, and test drafting, while keeping acceptance tied to the application contract. The engineer proposing the change should be able to explain why it is correct, what was actually executed, and which uncertainties remain. That responsibility should be visible in the pull request, whether the first draft came from a person or a model.

Start the review with an invariant the code must preserve

Consider an illustrative export-download endpoint. Its requirement is that an authenticated member can download an export belonging to the same active workspace, provided the export is ready and has not expired. The invariant is more precise than “add authorization” and can be checked independently of the generated implementation.

Write down the authority sources. The workspace identity comes from the authenticated request context; export ownership comes from trusted storage; readiness and expiry come from the current operation record. A client-supplied workspace field should not establish permission. This short model directs the review toward the inputs that matter.

Then inspect where the checks happen relative to the effect. A correct predicate applied after a signed download link is generated and logged may already expose sensitive access. A stale membership loaded earlier in a long operation may no longer authorize the request. The review must follow the full path, not only the helper function whose name sounds reassuring.

Write counterexamples before trusting the test suite

Original authorization review fixture: expected behavior before implementation
Request conditionExpected outcomeWhat it challenges
Member, same workspace, ready, unexpiredAllowRequired successful behavior
Member of another workspaceDenyResource ownership boundary
Membership removedDenyCurrent authority rather than cached assumption
Export still running or expiredDenyResource lifecycle
Caller supplies another workspace IDDeny unauthorized accessUntrusted input cannot create authority
The expected outcomes come from the product contract. Tests generated from the implementation alone may reproduce the same mistaken assumption as the code.

Ask the reviewer to identify at least one change that should make an important test fail. Removing the workspace comparison should break the cross-workspace case. Ignoring expiry should break the expired-resource case. If those mutations leave the suite green, the tests may exercise the function without establishing its security property.

A small pure function can help make part of the policy explicit. The following illustrative predicate deliberately omits HTTP, database access, and signed-link generation. Its inputs must come from the trusted sources described above; the function does not establish that trust by itself.

def may_download(member_active, same_workspace, ready,
                 expires_at, now):
    return (
        member_active
        and same_workspace
        and ready
        and now < expires_at
    )

assert may_download(True, True, True, 200, 100)
assert not may_download(True, False, True, 200, 100)
assert not may_download(True, True, True, 100, 100)

Test the actual endpoint as well. The helper's assertions cannot reveal that a route passes a client-provided boolean as same_workspace, bypasses the helper on a cache hit, or returns a previously cached signed URL after revocation. Separate policy tests from integration tests so each makes a clear claim.

Make the change package small enough to inspect

Keep unrelated refactoring out of the authorization change unless it is necessary to establish the boundary. Large generated diffs can make a critical behavior change difficult to distinguish from formatting and renaming. A useful sequence might introduce a policy boundary first, connect one endpoint, then migrate additional callers after the first path is understood.

The pull request description should state the trigger, resulting behavior, major assumptions, and actual validation. Include the command and environment for a relevant check, with an honest result. “Tests added” and “tests passed” are different claims. A generated test file that has never run is still unverified.

Keep model transcripts out of the review path unless a specific exchange contains necessary reasoning. A concise design note should preserve the decision and alternatives in the repository's normal form. The team should not need access to one developer's chat account to understand why a security boundary exists.

Inspect dependencies and data handling as part of the diff

Review new packages, version constraints, lockfile changes, and installation behavior. A plausible package name in generated code is not evidence that the dependency is correct or appropriate. Verify its identity, supported API, maintenance context, and the permissions its build or runtime behavior requires.

Check whether debugging code exposes tokens, customer documents, or authorization context in logs. Review fixtures should use synthetic data and narrowly scoped credentials appropriate to the environment. A convenience change that copies a production payload into a test can create a separate data-handling problem even when the endpoint logic is correct.

Automated scanners and AI review tools can supply useful findings, but their output still requires evaluation. A suggested fix may misunderstand the code; silence does not prove that all relevant flaws are absent. Keep the acceptance decision attached to the invariant, executed checks, and informed human review rather than the number of automated approvals.

Review an inherited AI-built prototype before expanding it

An existing prototype needs a different starting point from a pull request. First establish a repeatable build and one representative customer journey. For an export portal, trace sign-in, workspace selection, export creation and download. Record which data is real, which service is mocked, and which parts only work in the original developer’s environment. This prevents a convincing demo from becoming an unsupported production-readiness claim.

Use three decisions for each finding: keep, repair or investigate. Keep the export interface when its behaviour is understood and useful. Repair the download boundary if a caller can select another workspace’s export. Investigate whether the upstream export provider can safely reconcile a timeout before proposing retries. “Rewrite everything” and “ship what already works” are both premature when the actual boundaries have not been inspected.

Illustrative inherited-prototype review record
FindingEvidence to retainNext decision
Export interface handles expected statesRepeatable journey and tested build identifierKeep, subject to integration acceptance
Another account’s export can be requestedSanitised counterexample and affected boundaryRepair before allowing real account data
Provider completion after a timeout is unknownObserved response and missing recovery evidenceInvestigate before enabling automatic retry
These are invented findings showing the record’s structure. An actual review must inspect the application and report its own evidence.

Deliver a prioritised review with the affected journey, demonstrated behaviour, uncertainty, owner and acceptance check. Separate the effort to understand a problem from the effort to fix it. A code review can identify a bounded implementation scope, but it does not by itself approve a production release. Include the receiving engineer in the walkthrough so the findings remain usable without the original reviewer.

Close the loop with observable release behavior

Choose a rollout method proportionate to the change. For the export endpoint, observe authorized success, expected denials, unexpected failures, and link generation without collecting sensitive payloads. Have a recovery action that preserves the authorization requirement; reverting to an insecure endpoint is not an acceptable operational fallback.

Record review findings that change future work. If generated tests consistently miss tenant isolation, add that expectation to the repository's development guidance and relevant regression suite. If a tool repeatedly invents unavailable APIs, improve the context or require documentation verification at that boundary.

The cross-team review guide covers ownership, and tenant-aware idempotency develops another important application boundary. Our technical consulting and prototype reviews turn inspected evidence into practical next steps. When a repair is agreed, software implementation takes that scoped work through acceptance.

FROM INSIGHT TO ACTIONSoftware development consulting

Know what to keep, fix and investigate.

Bring your codebase or AI-built prototype. We can review a representative journey, document the evidence and scope the next engineering decision.

Explore technical consultingDiscuss your challenge

Start with your goals.
We’ll work through the next step together.