Reducing False Positives in Penetration Testing with Open-Source Dual-Agent Verification

    This article examines how automated penetration testing often produces more noise than value because of false positives, and presents an open-source AI penetration testing framework design that addresses the problem through engineering mechanisms. It explains the separation of duties between a hunting agent and an independent verification agent, the use of three-state verdicts instead of binary outputs, differentiated validation thresholds per vulnerability class, code-first decision authority over model output, and built-in scope controls. Readers will find practical guidance on lowering false positive rates and building trustworthy, auditable automated validation workflows.

    1. The Problem: Why More Automation Means More Noise

    Automated penetration testing gives security teams far broader coverage per unit of time than manual work, but it also creates a long-underestimated engineering problem: false positives are eating up the gains from automation. A false positive means a scanner or automated agent reports a “suspected vulnerability” that, in the real business context, is neither exploitable nor an actual risk. False positives are not just a matter of slightly lower accuracy; they compound at every stage of the workflow:

    1. Alert noise amplification: once a false positive enters the ticketing system, it takes manual reproduction, triage, and closure, often consuming more time than communicating a fix for a real vulnerability.
    2. Rising trust cost: when a team finds that seven out of ten reports do not hold up, subsequent reports are discounted as a whole, and the automation system becomes effectively useless.
    3. Broken automation loop: if the conclusions cannot be trusted, they cannot be safely plugged into an automated “discover-fix-regress” loop, and the system degrades into “generating documents for people to read.”

    So the real technical dividing line for AI-driven penetration testing frameworks is not “whether it can attack automatically” but “whether it can prove automatically.” This article uses the design of a class of open-source AI penetration testing frameworks as a sample, abstracts its key mechanisms, and discusses how to engineer lower false positive rates.

    2. Core Design: Separation of Duties with Dual Independent Agents

    The traditional approach is to have the same scanning pipeline “take another look,” which is architecturally ineffective: the same context, the same assumptions, and the same tool permissions will only reinforce existing bias when repeated. The effective approach is to split “discovery” and “verification” into two roles and enforce hard isolation across three dimensions: context, permissions, and budget.

    • Hunting agent (discovery role): has a broader tool surface and is responsible for reconnaissance, information gathering, and candidate vulnerability discovery, producing “vulnerability hypothesis + supporting evidence.”
    • Verification agent (validation role): starts from a fresh context, treats all evidence submitted by the hunting agent as untrusted input, and is equipped only with read-only tools, with no permission to modify target state.

    The essence of this design is to hand “proposing a hypothesis” and “falsifying a hypothesis” to two entities that do not share priors, trading independence for the credibility of the conclusion.

    1. Hunting Agent ──(vulnerability hypothesis + evidence pack)──▶ Verification Agent (fresh context / read-only)
    2. │
    3. ┌───────────────┼────────────────┐
    4. Confirmed Inconclusive Falsified
    5. │ │ │
    6. Enter report Manual review queue Discard finding

    3. Verdict Semantics: Three States Instead of a Binary Judgment

    The key step in reducing false positives is to abandon the binary “vulnerable / not vulnerable” output and adopt a three-state verdict: confirmed, inconclusive, and falsified. The three-state design ensures that “insufficient evidence” is no longer forcibly classified as “vulnerability exists,” cutting off the main source of false positives at the semantic level.

    • Confirmed: the verification agent completed a reproducible successful validation within budget.
    • Inconclusive: neither confirmed nor ruled out. Such findings are retained but flagged for manual review instead of being counted directly as vulnerabilities.
    • Falsified: clearly proven to be expected designed behavior or non-exploitable; only then is discarding allowed.

    Equally important are the supporting engineering constraints: set an upper limit on interaction rounds per validation (for example, no more than 8 rounds) and a time limit (for example, no more than 3 minutes) to prevent the verification process from diverging indefinitely on ineffective paths and to avoid the verification stage itself becoming a source of load on the target.

    4. Differentiated Validation Thresholds: Different Evidence Standards per Vulnerability Type

    A “unified standard” is a common breeding ground for false positives. Mature frameworks define differentiated pass conditions for different vulnerability categories. The core idea is to require “observable harm occurring” rather than “the presence of suspicious characteristics.”

    • Cross-site scripting: script execution must actually be observed; input reflection or a parameter-injectable marker alone is not enough to pass.
    • Server-side request forgery: requires observing an HTTP callback from the target server to a brand-new random token address with redirects disabled; merely triggering DNS resolution, or a callback source identified as the scanner itself, does not count as passing.
    • Injection and data access: evidence must show that a data boundary was actually crossed, rather than just returning a string that can be interpreted as a response.

    Illustrative policy configuration (pseudocode, expressing only the verdict semantics):

    1. rules:
    2. xss:
    3. require: script_execution_observed
    4. reject_if: reflection_only
    5. ssrf:
    6. require: http_callback_to_fresh_token
    7. preconditions: redirects_disabled
    8. reject_if: [dns_lookup_only, callback_from_scanner]
    9. generic:
    10. on_model_confirmed_without_retest: downgrade_to_inconclusive

    5. Code Over Model: Who Holds Decision Authority

    Large models are good at proposing hypotheses and chaining steps, but they are not suited to being the final judge. The robust approach is that verification conclusions must be produced by code that checks actual evidence, with the model only responsible for “suggestions.” If the model directly returns “confirmed” without completing a successful retest itself, the framework should downgrade the verdict to “inconclusive.”

    1. def finalize(model_verdict, evidence, retest_ok: bool):
    2. if model_verdict == "confirmed" and not retest_ok:
    3. return "inconclusive" # Code downgrade to prevent model self-certification
    4. if evidence.falsified_by_design():
    5. return "false_positive" # Discard only when clearly falsified
    6. if evidence.needs_second_account() or evidence.out_of_visibility():
    7. return "manual_review" # Beyond the verification capability boundary
    8. return "confirmed" if retest_ok else "inconclusive"

    The value of this rule is that it builds “trustworthiness” on an auditable evidence chain rather than on the wording of model output.

    6. Scope Control: Automation Must Have Built-in Boundaries

    The more powerful the automation, the higher the risk of overreach. Engineering should enforce interception at the tool invocation layer rather than relying on prompt constraints: all outbound request targets must fall within the configured target and its subdomains; out-of-scope calls are rejected outright and recorded in the audit log. In addition:

    • Bind the target allowlist to subdomain enumeration results, with changes subject to approval;
    • Set independent switches and rate limits for high-impact actions (writes, deletions, bulk requests);
    • Retain the full evidence chain and decision logs for traceability and compliance auditing.

    7. Engineering Implementation Recommendations

    1. Keep model integration pluggable: support multiple model services and locally deployed models, route by task tier, and use high-capability models for reconnaissance and low-temperature deterministic configurations for verification.
    2. Work with existing toolchains: invoke mature capabilities such as network probing, template-based vulnerability detection, and injection validation as “tools” called by agents instead of reinventing the wheel.
    3. Continuously measure false positive rates with internal benchmarks: build a labeled historical sample set, calculate false positive and false negative rates separately by vulnerability category, and turn them into regression gates.
    4. Output reports in layers: present “confirmed” and “pending manual review” in separate sections with complete evidence and reproduction steps, so humans only handle the real long tail.
    5. If using cloud capabilities, a combination of general-purpose categories can carry the workload: a container platform to run agent workloads, object storage to hold evidence packs, a message queue for task distribution, and logging and monitoring services for auditing and anomaly detection.

    8. Conclusion

    The maturity of AI penetration testing is not reflected in how many attacks it can launch automatically, but in whether it dares to say “inconclusive” when evidence is insufficient. Dual-agent independent verification, three-state verdicts, differentiated validation thresholds, code-first decision authority, and built-in scope control together form an explainable, auditable, low-noise automated validation paradigm. For teams, the recommended implementation order is: first establish scope and permission isolation, then evidence standards and three-state output, and finally connect the automated loop, so that the automation gains at each step are built on trustworthy conclusions.