Implementation:0xSteph Pentest ai tool trust
| Knowledge Sources | |
|---|---|
| Domains | Security_Testing, Verification |
| Last Updated | 2026-10-23 12:00 GMT |
Overview
Concrete allowlist-based trust boundary that determines which finding sources are trusted without proof and which need oracle confirmation before surfacing.
Description
The tool_trust module is the single source of truth for the prove-or-kill boundary. It replaces a per-scanner denylist with a drift-safe allowlist: native ptai probes/builtins and recon enumeration tools are trusted; everything else (third-party vuln scanners, unrecognized tools) is gated unless an oracle confirms it.
A finding is surfaced as-is when its tool_source is:
- Native: empty string, "spa_probe", "authenticated_scan", or prefixed "pentest-ai-" / "builtin_"
- Recon: gobuster, ffuf, feroxbuster, whatweb, httpx, amass, subfinder, dnsx, naabu, etc. (factual enumeration, not vuln claims)
Everything else needs proof. Forgetting to add a new recon tool fails safe (toward hiding unproven output), which is the correct direction for a "no proof, no finding" guarantee.
Usage
Import this when you need to:
- Determine if a finding's source is trusted (is_trusted_source)
- Gate unverified scanner output in the orchestrator's prove-or-kill phase (needs_proof)
Code Reference
Source Location
- Repository: pentest-ai
- File: engine/tool_trust.py
Signature
def is_trusted_source(tool_source: str | None) -> bool:
"""True when a finding's source is native or recon — NOT third-party
vuln-scanner output that needs an oracle."""
def needs_proof(tool_source: str | None) -> bool:
"""Inverse of is_trusted_source: third-party vuln-scanner / unrecognized
output that prove-or-kill gates unless an oracle confirms it."""
Import
from engine.tool_trust import is_trusted_source, needs_proof
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| tool_source | None | Yes | The tool_source field from a finding dict |
Outputs
| Name | Type | Description |
|---|---|---|
| is_trusted_source returns | bool | True if native/recon, False if third-party |
| needs_proof returns | bool | True if third-party/unrecognized, False if native/recon |
Usage Examples
Prove-or-Kill in the Orchestrator
from engine.tool_trust import needs_proof
# After verification, suppress unverified third-party scanner output
for f in findings:
if needs_proof(f.get("tool_source")) and f["id"] not in verified_ids:
await db.update_finding_verdict(f["id"], "unverified")
# The finding row is kept (retrievable) but not surfaced
Checking Trust Status
from engine.tool_trust import is_trusted_source
# Native probes are trusted
assert is_trusted_source("") # True — native probe
assert is_trusted_source("builtin_http_headers") # True — builtin
assert is_trusted_source("nuclei") # False — third-party scanner
assert is_trusted_source("gobuster") # True — recon enumeration