A coding agent can implement a coherent feature that your product does not need. A developer's November 28 account describes an agent building cross-user revocation safeguards and tests for a product whose project Spaces could not be shared between users. The plan had been reviewed repeatedly, but the premise that sharing existed was never challenged. The story is one builder's experience, not a measure of how often agents make this mistake. It does show why a green test suite cannot prove that the requirement behind the test was real.
The useful question before implementation is not only “can this code satisfy the request?” It is “which verified product rule makes this work necessary?” A few checks can expose an unsupported premise before it grows into code, security scaffolding, and a test suite that all agree with one another for the wrong reason.
Separate product facts from assumptions and choices
Read the task and the agent's plan, then mark each claim that changes the design: who owns a record, which roles can access it, what data is shared, which system is authoritative, or what must happen after a user is removed. Classify each claim as a verified product fact, an open question, an assumption, or a proposed design choice. Do not let a confident sentence in the plan turn an assumption into a requirement.
For every consequential fact, point to its source and scope. That might be an approved product decision, a current permission model, a data relationship, or a documented user workflow. Check that the evidence is current and applies to this feature. A code path that does not implement sharing does not by itself prove sharing is prohibited; a product decision or the people responsible for the behavior must establish that boundary. If the sources conflict or no one can verify the claim, pause the affected design choice and ask a narrow question before coding.
Make the important behavior explicit
Write down the positive behavior the feature needs, but also the constraints and things it must not do. For example, a task about optimizing context for a user-owned Space could state that the operation only reads that user's Space, that cross-user sharing is out of scope, and that no revocation workflow should be added unless sharing is separately approved. The wording should reflect verified product facts; do not copy an example constraint into a different product without checking it.
This is more than filling in a longer template. In a controlled study, Elmira Onagh and Maleknaz Nayebi assigned 72 participants to implement and revise Python tasks with ChatGPT-4o under three specification conditions. The condition that spelled out constraints, invariants, negative requirements, edge cases, tie-breaking and exception handling had 47.2% fewer hidden-test failures than the unstructured condition. A lighter template reduced failures by 8.7%. The result applies to the study's tasks and setup, not every coding agent or production project. It supports a narrower lesson: name the behaviors the code must preserve or reject, rather than assuming a form or a plan will surface them automatically.
Asking the agent to clarify can help, but it is not a substitute for checking its answer. A separate benchmark of repository-level requirement clarification used 341 tasks and six language models; the authors report that clarification ability did not reliably translate into better requirement documents, and results varied with the simulated user's persona. Treat questions as a way to reveal uncertainty. Verify the resulting statement against the product's actual source of truth.
Trace the work in both directions
Before the agent edits files, ask it to connect each major implementation activity to the requirement and source that justify it. A short table can be enough: product claim, evidence, affected code or data, and the test that checks the behavior. In the Space example, a reviewer could follow the chain from context optimization to the assumed sharing model, then to revocation code and tests. A missing link is a prompt to investigate, not automatic proof that the code is wrong. Some security safeguards are necessary even when they are not visible in the user story; their basis should still be explainable.
Review from the diff back to the task as well. For each new API, permission check, data migration, or test, ask which verified rule requires it. Check whether tests encode the product's intended behavior or merely repeat the implementation's assumption. Tests can show that code follows an oracle; they cannot establish that the oracle describes the product correctly. When a change has no clear justification, request the source or narrow the work before accepting it.
A short pre-coding review
- List the product facts the proposed design depends on, especially ownership, permissions, sharing and data flow.
- For each fact, record a current source; label unresolved claims as assumptions or questions.
- State verified constraints, negative requirements, edge cases and acceptance behavior explicitly.
- Ask the agent to map consequential code and tests back to those claims before implementation.
- Pause if the source is missing, contradictory or outside the task owner's authority; resolve the question first.
- Review the finished diff in reverse and check that each added behavior and test still has a valid reason.
Keep product facts maintained as the app changes. Mark who owns a decision, when it was checked, and what would make it stale. An agent's retrospective is useful evidence about what it believed, but it should not automatically become durable product knowledge. Otherwise, a mistaken premise can be retrieved more reliably on the next task.
This review does not replace ordinary security review, tests, or a recoverable branch. It helps ensure those safeguards protect the product that exists and the change the owner actually requested. Once a feature works, makers can describe what it does, how it behaves, and why someone might use it; clear product context helps both agents and future users understand the app.
How to test an AI agent harness before shipping it
