Technical document

Practical Quality Assurance in AI Development: Design Points for 6-Axis Critical Review and Zero-Defect Convergence Loop

This article explains 6-axis quality verification, which prevents AI review's sycophancy bias and over-engineering, prioritizing security and cost optimization, along with design points for a P0/P1=0 convergence loop. Prompt samples immediately usable in practice are also included.
AI Development45 minPublication Date November 23, 2026Update date November 23, 2026
Thumbnail for Practical Quality Assurance in AI Development: Design Points for 6-Axis Critical Review and Zero-Defect Convergence Loop

Summary

Key points of this document

  • Background and Challenges: Why Simple "AI Review Requests" Cannot Guarantee Quality
  • The "Six Evaluation Axes" and Top-Priority Defense Lines as the Foundation of Quality Assurance
  • 4 Design Points to Make the Zero-Correction Convergence Loop Functional

Overview

In software development utilizing generative AI, while code generation speed has dramatically increased, a major practical challenge is how to stably control the quality of output results and operational costs.

This article, based on a 6-axis critical review covering security, performance, UI/UX, maintainability, cost optimization, and robustness,**defines "security" and "cost optimization" as non-negotiable top-priority defense lines.**We explain a design policy that positions "security" and "cost optimization" as non-negotiable top-priority defense lines. Furthermore, we introduce a method for controlling an autonomous correction loop that converges P0/P1 priority issues to zero, along with prompt samples immediately usable in practice.


Background and Challenges: Why Simple "AI Review Requests" Cannot Guarantee Quality

Simply asking AI to review code does not provide practical quality assurance. This is because it tends to swing between two extremes: overly lenient approvals and excessive criticism that disregards costs and practicality.

Overlooking Issues Due to Sycophancy Bias

Large Language Models (LLMs) exhibit a sycophancy bias, tending to positively evaluate user intentions and existing implementations. When vaguely asked to "review this code," LLMs often praise only superficial coding styles and conclude, "It's generally implemented without issues," frequently overlooking authorization boundary leaks or unlimited billing risks.

Bloating, Over-engineering, and Cost Explosion Caused by Vague Critical Instructions

Conversely, if instructed only to "point out problems strictly from a critical perspective," AI makes "the act of issuing criticisms itself" its objective. As a result, the following counterproductive effects occur:

  • Inflated Criticisms Based on Unsubstantiated Generalities: Without checking actual code or execution logs, abstract criticisms such as "it might not scale in the future" or "error handling should be more robust" are presented.
  • Confusion of Importance: Critical vulnerabilities that could lead to production failures or data breaches are treated with the same weight as minor improvement suggestions, such as preferences for variable names.
  • Bloated Operational Costs Due to Over-engineering: Over-engineering is proposed, which, in the extreme pursuit of performance and robustness, leads to increased billing due to unnecessary persistent instances, excessive caching layers, and multiple retries.
  • Endless Correction Loop: Each correction introduces new "improvement suggestions" from different angles, preventing completion and continuously increasing LLM token consumption.

To prevent these issues, it is necessary to design a structured approach with clear priorities for each evaluation axis, rules for justification, criteria for importance, and termination conditions.


The "Six Evaluation Axes" and Top-Priority Defense Lines as the Foundation of Quality Assurance

To verify quality from multiple perspectives, after fixing the six evaluation axes,**it is essential to define "security" and "cost optimization" as the top-priority axes, rather than treating all axes equally.**is essential.

In practical system development, covering all six axes prevents omissions not only in functional requirements but also in non-functional requirements. However, it is not possible to maximize all six axes simultaneously. As shown in the comparison table below, priorities are divided into two layers, and criteria for conflict resolution are fixed in advance.

Evaluation AxisPriorityMain Verification PointsTypical Trade-off Conflicts
Security[Top Priority]Authentication/authorization boundaries, input validation, secret management, dependency library vulnerabilitiesOften conflicts with UI/UX (increased operational steps) and development speed (effort for verification implementation)
Cost Optimization[Top Priority]Elimination of unnecessary persistent instances, suppression of excessive scans, prevention of LLM token waste, avoidance of unlimited pay-as-you-go billingOften conflicts with performance (persistent cache maintenance costs) and robustness (redundant configurations, excessive retries)
PerformanceStandard BalanceResponse time, N+1 query resolution, appropriate caching strategy, payload sizeOften conflicts with cost optimization (consumption of high-spec resources) and maintainability (increased control complexity)
UI/UXStandard BalanceIntuitive operation, prevention of responsive layout breakage, accessibility, clarity of error displayOften conflicts with security (strict verification procedures) and development cost (effort for detailed presentation)
MaintainabilityStandard BalanceSeparation of concerns, naming consistency, duplicate code elimination, type safety, testabilityOften conflicts with robustness (reduced readability due to excessive defensive code) and development speed
RobustnessStandard BalanceException handling, boundary/abnormal case resilience, retry/idempotency, timeout controlOften conflicts with cost optimization (increased load due to multiple retries/waits) and maintainability (branch proliferation)

Absolute Rules for the Top 2 Priorities (Security & Cost Optimization)

Among the 6 axes, "Security" and "Cost Optimization" will not be compromised when there is a trade-off with the other 4 axes.line of defenseas.

  • Security First Principle:
    • Missing authentication/authorization boundaries, risk of secret information exposure, and inadequate input validation will not be compromised for reasons of convenience (UI/UX), development speed, or implementation simplicity. If these are detected, regardless of scale or purpose,**unconditionally P0 (immediate fix required)**and the design ensures that the next step cannot proceed until the fix is complete.
  • Cost Optimization First Principle:
    • We prioritize eliminating unnecessary persistent instances, full table scans or excessive polling in databases, wasted LLM tokens, and usage-based billing without upper limits (open-ended risk).
    • If it conflicts with other axes such as performance or robustness,“Solutions that involve increased costs will not be adopted unless there is clear quantitative evidence (such as measured latency or anticipated request volume); instead, designs that can be achieved at low cost will be chosen first.”This priority rule will be applied.

Importance of Explicit Trade-offs and "Intentional Scope-out"

The key to a healthy review convergence is to have the AI explicitly state "decisions to intentionally not do something for now (intentional scope-out)."

For example, demanding always-on distributed caches or multi-region redundant configurations for an internal management tool with limited access is an over-design that violates the principle of cost optimization. The review results must always record "which improvements were intentionally deferred after meeting the top 2 priorities" and "the reasons why that decision is valid (anticipated scale, cost constraints)."


4 Design Points to Make the Zero-Correction Convergence Loop Functional

Simply defining the 6 axes' perspectives and priorities will not stably converge the fix and re-review loop. To ensure the autonomous correction loop converges reliably, incorporate the following 4 design points:

1. Fact-Based Principle (Exclusion of Speculation and Generalizations)

AI's feedback must be based solely on actually confirmed file paths, line numbers, function/symbol names, actual logs, or documented specifications. Speculative feedback like "just in case" or "generally speaking" is prohibited, and any feedback that cannot explicitly state its basis will be treated as invalid. This structurally eliminates unsubstantiated, inflated feedback.

2. Severity Triage (P0 / P1 / P2)

If all feedback is treated the same, releases will be halted for minor refactoring suggestions. Feedback must always be categorized into the following three levels, clearly separating how they are handled within the loop.

SeverityDefinition / ExamplesHandling within autonomous loopCompletion criteria
P0 (Immediate Fix Required)Auth/Auth bypass, secret exposure, input validation omission, open-ended billing risk, data loss, build failureImmediately implement fixes without exception, re-run tests and re-verifyMandatory pass with 0 items
P1 (Early Action)Boundary value bugs, N+1 queries, cost increase due to excessive scans, UI breakage, duplicate logic impairing maintainabilityGenerally fix within the loop (exclude only if there's a trade-off agreement based on quantitative evidence)Pass with 0 items (convergence condition)
P2 (Future Improvement)Naming improvements closer to preference, abstraction anticipating future scale, minor optimizationsDo not fix within the loop; only record as improvement backlogPermitted to remain (does not stop the loop)

3. Convergence Conditions and Prohibition of Reopening Previous Agreements

The loop's passing condition is not "all feedback is zero," but ratherP0 = 0 items AND P1 = 0 itemsis set as the achievement. If you try to make future improvement suggestions (P2) zero as well, the AI will constantly generate new suggestions, preventing convergence.

Even more important is not to rehash "intentional scope-outs based on cost optimization" or P2 classified items agreed upon in the previous round during the next review. By carrying over the decision history (exclusion list) from the previous round to the next round's context, we prevent endlessly circling the same points.

4. Safety Limit (Max Iterations) and Deterministic Re-verification After Fixes

Autonomous loops must always have a maximum number of iterations (e.g., a maximum of 5 rounds). If P0/P1 do not become zero after 5 rounds, it is highly likely that structural blockers exist that AI alone cannot resolve, such as conflicting requirements or environmental constraints. In such cases, the loop should not continue indefinitely but should safely stop, outputting "a list of unresolved blockers and verification logs."

Furthermore, each time a fix is made, it must not be determined as "fixed" solely based on AI's self-declaration. Type checks (e.g., TypeScript's tsc), static analysis (e.g., ESLint), unit tests, builds, and E2E tests with real browsers must always be re-executed, and only when all pass should the review proceed to the next round.


Overall Flow of Autonomous Correction and Re-review Loop

By placing security and cost optimization as the two priority gates at the beginning, and structuring the process up to correction implementation, deterministic re-verification, and convergence determination, AI behavior can be operated as a highly reproducible engineering process.

Control Flow of 6-Axis Critical Review Incorporating Priority Gates

The flowchart below illustrates the process where, in each iteration, the security and cost optimization priority gates are evaluated first, followed by P0/P1 triage and deterministic verification, leading to convergence determination.

Loading diagram...

Convergence Comparison of Unconstrained Review vs. Priority-Controlled Review

The differences in behavior between requesting a critical review without constraints or priorities, and incorporating the top-priority 2-axis gates with convergence control, are as follows.

Loading diagram...

Prompt Sample for Immediate Practical Use (Cost-Optimized, Security-First Version)

We present practical prompt samples that can be directly copied and integrated into code reviews in development environments or as implementation verification instructions for autonomous agents.

## Quality Assurance Review & Autonomous Correction Directives (Security & Cost Optimization - Highest Priority Version)

### 0. Project Prerequisites (Edit this section for use)
- Expected Scale: Business web application with approximately 50 concurrent users, fewer than 10,000 daily requests.
- Cost Constraints: Operate primarily serverless, minimizing monthly fixed costs and increases in pay-as-you-go charges.
- Technology Stack: TypeScript / React / Cloudflare Workers / SQLite-compatible D1

### 1. Evaluation Axes and Priorities (6 Axes)
Validate the target diff and related files against the following 6 axes.
**[Highest Priority Axes (Non-negotiable Defense Lines)]**
1. Security (Authentication/Authorization boundaries, input validation, secret management, dependency vulnerability)
2. Cost Optimization (Unnecessary resident instances, full table scans, excessive polling, LLM token waste, lack of pay-as-you-go caps)

**[Standard Balance Axes]**
3. Performance (Computational complexity, N+1 queries, appropriate caching, payload size)
4. UI/UX (Usability, responsive layout issues, accessibility, clarity of error messages)
5. Maintainability (Separation of concerns, duplication elimination, type safety, testability)
6. Robustness (Error handling, boundary values, idempotency, timeout control)

### 2. Absolute Decision Rules for the Top 2 Priority Axes
- **Security flaws are unconditionally P0**:
  Authentication/authorization omissions, hardcoding or logging of secrets, and lack of input validation must be classified as P0 (immediate correction required) without compromise for reasons of convenience or development speed.
- **Do not adopt solutions that increase costs without quantitative justification**:
  If proposed improvements for other axes (performance or robustness) involve increased costs (e.g., persistent instances, increased call frequency, increased tokens, increased charges), do not adopt them unless there is clear quantitative justification for the assumed scale. Prioritize designs that are low-cost first.

### 3. Fact-Based Principle (Prohibition of Speculation and Generalizations)
- All findings must be based on actual evidence, including "confirmed file path, line number, function name, execution log, and specification."
- Do not output findings based on generalities that cannot be substantiated (e.g., "just in case," "for future scalability").

### 4. Severity Triage and Intentional Scope-Out
- Classify findings as `P0 (Immediate Correction Required)` / `P1 (Early Action)` / `P2 (Future Improvement)`.
- Items deferred due to conflict with the top 2 priority axes or the assumed scale should be recorded as "Intentional Scope-Out (deliberate decision not to do)" with a reason.

### 5. Autonomous Correction Loop and Termination Conditions (Max 5 Rounds)
- The passing condition is **`P0 = 0 items AND P1 = 0 items`** (P2 items are for record only and not subject to correction).
- If P0 or P1 items remain, implement corrections, and always re-run type checks, Lint, unit tests, and build processes, confirming all pass before proceeding to the next review round.
- It is strictly forbidden to delete, skip, relax assertions, or suppress type errors in existing tests for the purpose of correction.
- Do not re-raise "Intentional Scope-Out" and "P2 items" agreed upon in previous rounds in subsequent rounds.
- If convergence is not achieved within a maximum of 5 rounds, stop the process, clearly stating a list of unresolved blockers and the latest execution logs.

### 6. Output Format
At the end of each round, you must output the following:
1. Summary (Round number / P0 count / P1 count / P2 count / Verdict: Pass or Continue or Safe Stop)
2. List of Findings (Severity / Evaluation Axis / Evidentiary File & Line Number / Content / Action Plan)
3. List of Intentional Scope-Outs (Deferred Item / Reason)
4. Results of Deterministic Verification (Command and Exit Code / PASS/FAIL Counts)

Purpose and Customization Guidelines for Each Specified Item in the Prompt

This prompt is designed with the following objectives to structurally prevent both LLM's 'flattery' and 'over-engineering'.

  • Section 0 (Explicit Statement of Prerequisites): By placing the assumed scale and cost constraints at the beginning, it prevents runaway proposals of over-engineered enterprise configurations for small-scale applications. During operation, simply rewriting 2-3 lines here can significantly change accuracy.
  • Sections 1 & 2 (Absolute Rules for the Top 2 Priority Axes): If the 6 axes are arranged flatly, AI tends to choose 'technically elaborate, high-cost proposals'. By explicitly stating the unconditional P0 classification of security flaws and requiring quantitative justification for cost-increasing proposals, it guides AI towards practical and sound judgments.
  • Section 3 (Fact-Based Principle): By enforcing the inclusion of file paths and line numbers, it eliminates general criticisms made without reading the code.
  • Section 5 (Deterministic Verification and Prohibition of Tampering): Explicitly prohibits the AI-specific loophole of 'loosening tests to pass them', and fixes the actual build and test results as prerequisites for the next iteration.

Limitations, Caveats, and Verification Perspectives

While the 6-axis review and convergence loop are powerful mechanisms, it's necessary to establish guardrails after understanding the limitations stemming from LLM characteristics.

Blind Spots of Self-Review by the Same Model and Role Separation

Performing a review with the exact same model and context as the one that wrote the code tends to create blind spots, where errors in assumptions overlooked during implementation are similarly overlooked during review. To mitigate this, it is effective in practice to use either or both of the following approaches.

  • Separation of Implementation and Review: Separate the session (or model) responsible for implementation from the session (or different model) responsible for review, and provide the review side only with 'deliverables, specifications, and test results', not the implementation's thought process.
  • Mandatory Inclusion of Deterministic Verification: Do not solely rely on AI's qualitative judgment; always pass through mechanical, deterministic pass/fail gates such as type compilers, linters, static analysis tools, unit tests, and real browser E2E tests using Playwright, etc., before the end of each iteration.

Monitoring Token Cost of the Loop Itself and Preventing 'Deceptive Zero Findings'

As the number of correction loops increases, the context length expands, leading to increased LLM token consumption and execution time. From a cost optimization perspective, it is crucial to keep the change delta per iteration small and strictly adhere to a maximum limit of 5 iterations.

Furthermore, in an eagerness for autonomous correction, AI might 'delete failing tests', 'loosening assertions', or 'suppress type errors with any or 'as unknown' to create deceptive zero findings (a superficial pass). Before the loop ends, perform a final check of the diff to ensure there is no regression in test conditions or type safety.


Summary: Decision Axes to Take Back to the Field

Quality assurance in AI development functions not by asking AI to 'be strict', but by designing priorities and termination conditions as a system. When introducing and operating such a mechanism in the field, please use the following decision axes as criteria.

  • Establish Security and Cost Optimization as the Foremost Line of Defense: Instead of treating all 6 axes equally, first establish rules that security flaws are unconditionally P0, and proposals involving cost increases are rejected unless supported by quantitative evidence.
  • Eliminate Speculation, Base Decisions Solely on Facts: General statements not accompanied by file paths, line numbers, or actual measurement logs will not be adopted as findings.
  • Draw the Line at P0/P1=0, Prohibit Reopening Issues: Do not carry over P2 (future improvements); instead, inherit the agreement from the previous iteration (intentional scope-out) and ensure definite convergence.
  • Set Maximum Iterations, Mandate Deterministic Verification: Combine a fail-safe of around 5 iterations with re-execution of builds, tests, and actual operation checks to prevent blind spots of the same model and deceptive passes.

Technical documents

We will continue to increase technical documentation.

We will continue to organize our thoughts on AI, cloud, business app development, requirements definition, and operational design into documents.

Go to technical documentation list