Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xSteph Pentest ai Verifier verify candidate

From Leeroopedia
Knowledge Sources
Domains Security_Testing, Verification
Last Updated 2026-10-23 12:00 GMT

Overview

Concrete tool for running a machine-checkable oracle against a candidate finding and issuing a frozen Receipt verdict, provided by the pentest-ai engine.

Description

The Verifier class runs an Oracle's verify() method against a candidate finding and returns a Receipt — the frozen, versioned contract that travels to every downstream consumer. A verdict is earned, never asserted: the verifier reports verified only when the oracle passes, and the receipt names the oracle kind that earned it.

A non-pass is an abstain (candidate), never a refuted. No oracle can prove a vulnerability SAFE; a replay miss means "could not re-prove."

Usage

Import this class when you need to:

  • Run an oracle against a candidate finding and get a Receipt
  • Stamp verdicts during a probe sweep (via `stamp_oracle_verdicts`)
  • Verify findings during the orchestrator's validation phase

Code Reference

Source Location

Signature

class Verifier:
    def __init__(self, event_bus: EventBus | None = None) -> None:

    async def verify_candidate(
        self,
        *,
        engagement_id: str,
        finding_id: str,
        oracle: Oracle,
    ) -> Receipt:
        """Run the oracle, return a Receipt. Emits VerdictChanged event."""

async def stamp_oracle_verdicts(
    db: Any,
    findings: list[dict[str, Any]],
    intensity: str = "normal",
    *,
    event_bus: EventBus | None = None,
) -> int:
    """Run probe-emitted recipes now, while the target is still up.
    Returns how many findings earned VERIFIED."""

Import

from engine.verifier import Verifier, stamp_oracle_verdicts

I/O Contract

Inputs

Name Type Required Description
engagement_id str Yes The active engagement ID
finding_id str Yes The candidate finding ID to verify
oracle Oracle Yes A Protocol object with .kind and async verify() -> OracleResult
event_bus EventBus No Optional event bus for VerdictChanged events

Outputs

Name Type Description
verify_candidate returns Receipt Pydantic model: finding_id, verdict, oracle_kind, evidence, replay
stamp_oracle_verdicts returns int Count of findings that earned VERIFIED
side effect VerdictChanged event Emitted on the event bus if attached

Usage Examples

Basic Verification

from engine.verifier import Verifier
from engine.receipt import OracleKind, Verdict
from engine.verifier import IdempotentReplayOracle

# 1. Build an oracle for the finding
oracle = IdempotentReplayOracle.for_intensity(
    attempt=my_replay_fn,
    intensity="normal",
)

# 2. Run the verifier
verifier = Verifier(event_bus=my_event_bus)
receipt = await verifier.verify_candidate(
    engagement_id="abc123",
    finding_id="finding-1",
    oracle=oracle,
)

# 3. Check the verdict
if receipt.verdict == Verdict.verified:
    print(f"Verified via {receipt.oracle_kind}")
    await db.update_finding_verdict("finding-1", "verified", receipt.model_dump_json())

Stamping Verdicts During a Probe Sweep

from engine.verifier import stamp_oracle_verdicts

# Run probe-emitted recipes while the target is still up
verified_count = await stamp_oracle_verdicts(
    db=db,
    findings=probe_findings,
    intensity="normal",
    event_bus=event_bus,
)
print(f"{verified_count} findings earned VERIFIED during the sweep")

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment