Work

Mitigating the Mirror Effect in Agentic Bug Detection: A Context-Grounded Human-in-the-Loop Architecture

Year: 2026
Type: preprint
Abstract: Agentic code-reviewing and bug-finding tools can scale the software quality process, but source code often lacks the business rules needed to determine the correct solution. The Mirror Effect is defined as the retention and possible magnification of missing and/or ambiguous information in engineering artifacts created by AI. In bug finding, this effect manifests itself when an agent recognizes familiar code anti-patterns but considers locally plausible-looking code that does not conform to the external domain rules. In the exploratory pilot experiment, we examined 20 Python functions, including 8 pattern-evident defects, 8 context-dependent defects, and 4 clean controls. Without any context, one configuration of the detector found 6 out of 8 pattern-evident defects but 1 out of 8 context-dependent defects. Adding one sentence about the governing rule made the detector recognize all 8 context-dependent defects without any false positives for the controls. Wilson intervals and exact tests are provided, along with a discussion of the design limitations that render these counts exploratory. A four-layer human-in-the-loop system design is presented that consists of versioned context injection, confidence-based escalation, mirror-risk routing, and calibration feedback, using READY, REVIEW, and BLOCK release criteria, along with a replication procedure for testing. The goal is to focus human attention where the agent does not provide justification for its decision.
Language: English
Subfield: Software
Open Access status: green
OpenAlex ID: W7226022245
Cites:
Cited by:
Related to: 10