DOUBTPILOT

Files theroutine.Holdsthe rest.

The only AI that raises its hand when it doubts.

DoubtPilot reads your card alerts, invoices and insurance claims, checks each one against your history and against hostile text, and stamps HOLD on whatever it is not sure about. It has no tool to move money.

Python standard library only. No keys. No network. MIT license.
Built by Septian Panjaya.

Boarding pass / documentFlight DP-001
Passenger
Invoice 4471Northwind Supplies

Seatbelt: GO
Doubt check: sure
Money tools: none

HOLDPAYEE ACCOUNT CHANGED

Real output of the agent on 7 sample files from the repo (site/samples), captured when this page was built. Nothing runs in your browser. Nothing is paid or sent.

01 / Evidence

The attack is not exotic. It is a polite email asking you to pay somewhere else.

Form DP-1FBI IC3
Read directly
$2.77billion

Business email compromise losses reported to the FBI in 2024, from 21,442 complaints. Only investment fraud ($6.57B) cost more; tech support was third ($1.46B).

FBI IC3, 2024 Internet Crime Report
ic3.gov/AnnualReport
Form DP-2FBI PSA
Read directly
$55.5billion

BEC exposed dollar loss, domestic and international, Oct 2013 to Dec 2023: $55,499,915,582 across 305,033 incidents. Built from IC3 complaints, law enforcement reports and financial institution filings.

FBI IC3 PSA I-091124, Sept 2024
ic3.gov/PSA/2024/PSA240911
Form DP-3AFP survey
Read directly
74%

Share of surveyed US organizations affected by BEC in 2025 (465 treasury practitioners, January 2026). AFP calls it a significant increase from 2023 and 2024. Nacha's write-up puts 2024 at 63%.

AFP press release, April 2026
63%: Nacha (secondary)
Form DP-4OWASP / MSRC
Part secondary
LLM01

Prompt injection is entry LLM01 in the OWASP Top 10 for LLM applications (2025). Inputs, even ones a human cannot see, can change what a model does. A real case: CVE-2025-32711 in Microsoft 365 Copilot, rated Critical by Microsoft (CVSS 9.3, no user interaction). Researchers called it zero-click. Microsoft fixed it on its side.

OWASP LLM01 (read directly)
Microsoft MSRC (via search excerpt; page needs JavaScript)
"zero-click": BleepingComputer (secondary)

Caveats: the FBI figures count what victims and institutions reported, so they are a floor, not a census. The AFP figure is a survey of 465 treasury practitioners, not all companies. The Copilot flaw leaked data; it is not a dollar loss, and NVD's own score for it is 7.5 High against Microsoft's 9.3 Critical. We found no reliable dollar figure for prompt injection losses, so we do not quote one.

02 / The problem

Most fake invoices contain no suspicious words.

From: accounts@northwind-supplies.example
Subject: Re: Invoice 4471
Hi, thanks for your patience on the last payment.
Attached is the corrected invoice for this month.

Amount due: 1,840.00
Pay to account: **** 9021

Kind regards, Accounts team

No urgency, no link, no "ignore previous instructions". It passes a spam filter. Last quarter the same vendor was paid into account **** 4417. The mail above is made up for illustration.

Two tricks. One inbox.

The money trick. The attacker does not need to break anything. They ask to be paid to a different account. The words are normal. Only the history gives it away.

The text trick. The document itself can carry instructions aimed at the agent: hidden text, a fake "CEO" voice, an encoded payload. An agent that obeys what it reads will obey the attacker too.

So the useful agent is not the one that does the most. It is the one that files the routine, holds what it doubts for a human, and never has the power to pay.

03 / Flight manifest

Twelve guards. Every one has a test.

Status: Online = the guard is built in and tested. Different = a guard most agents do not have (the highlighted rows). None = the capability does not exist.

No.
System
What it does
Status
01

Payee trail

Learns which bank account belongs to which party. Holds a document if a known vendor asks for a new account (changed), or if one account sits behind two names (shared). Accounts show masked, last 4 digits only.

Different
02

Three detectors

Cards, invoices, claims. One pipeline, one ledger, one policy. Card-testing and duplicates; new vendors and amount spikes; phantom providers and upcoding (claims run on synthetic data).

Online
03

Hostile-text scanner

Every message is data, never orders. Finds hidden text, instructions aimed at an agent, fake authority, encoded payloads, exfiltration lures and broken data. The scanner has no send, fetch, run or delete power.

Online
04

Doubt check

Says "I am not sure". Re-reads each document in 12 harmless rewrites. If the decision or its reading changes, it holds the item for a human even when the rules said file. It can only make the agent more careful.

Different
05

Seatbelt

Tests its own guards first. Before each run it plants nine dummy attacks (injection, payee switch, new-vendor and card caps, duplicate, quoted order, disguise, STOP file, tampered audit log) and checks that every guard reacts. A guard that fails means no takeoff, and the refusal is written to the audit log.

Different
06

Red-team

doubtpilot redteam attacks the scanner: 6 hostile sentences disguised 17 ways, with the blind spots listed. The first run caught 62%. After the disguise fixes: 89%, then tuned to 102 of 102. A fresh round of 8 new disguises got 24 of 48 on its first run, so treat the tuned score as a floor, not proof.

Different
07

Kill switch

One file stops it. Create a STOP file and the loop lands at the next safe point. Remove it and the agent resumes without processing anything twice.

Online
08

Audit log

Every decision goes into a keyed hash-chained log with a signed head. replay verifies the chain and replays each decision. An edited line, a deleted last line or a forged new line breaks it. The key sits next to the log, so it shows tampering but cannot stop someone who also holds the key.

Online
09

Hold for yes

A human approval queue. Flagged items wait while the agent keeps working. Approve or reject records your decision. It moves no money either way.

Online
10

Self-recovery

A supervisor retries flaky steps, quarantines a poisoned file, and resumes after a crash. A budget guard pauses the run at its cap.

Online
11

Evidence cards

A digest, a live dashboard and one card for each flagged item, plus links between documents that share a party. Optional read-only IMAP, and an optional LLM layer that is off by default.

Online
12

Wallet access

There is no payment, transfer or send tool in the agent to call. A perfect attack on the text still has nowhere to go.

None
04 / Pre-flight checklist

Three commands. No keys, no network.

python3 -m doubtpilot seed

Builds a demo inbox with clean and hostile documents.

python3 -m doubtpilot run --mock

One full pass: seatbelt test, scan, decide, file, hold, report. Read the result in traces/latest/digest.md or open dashboard.html.

python3 -m doubtpilot replay

Verifies the audit chain and replays every decision. Then try ./demo_story.sh to watch a fake follow-up invoice with no warning words get held because the bank account changed.

Needs Python 3.10+. Public repo: github.com/dannytungadi5/doubtpilot.

Demo inbox / real output, replayedNo. 0001
05 / How to use it

Use it yourself, or put it behind your agent.

Seven steps from zero to a decision. Every command below exists in the repo today. Needs Python 3.10+ and nothing else.

  1. InstallClone the repo or unzip the source. There is nothing to install: no packages, no keys.

    cd doubtpilot

  2. Point it at your documentsA folder of .eml .txt .md .html .csv .pdf files, or a read-only mailbox.

    python3 -m doubtpilot run --inbox ~/money-docs

    Mailbox: set IMAP_HOST, IMAP_USER, IMAP_PASSWORD_FILE, then run --imap. It can only read, never send, move or delete mail.

  3. Run itOne pass now, or keep watching and restart itself if it crashes.

    run --inbox ~/money-docs --loop --supervise

    It tests its own guards first and refuses to start if one is broken.

  4. Read the evidence cardsOpen traces/latest/digest.md for the summary, dashboard.html for the live view, and traces/latest/cards/ for one page per flagged document: what it saw, which check fired, why.

    Unsure about one file? python3 -m doubtpilot doubt file.txt re-reads it 12 ways and shows if the answer wobbles.

  5. Approve or rejectRisky items wait. Everything else keeps flowing.

    python3 -m doubtpilot approvals
    python3 -m doubtpilot approve 12-card-micro --note "checked with bank"
    python3 -m doubtpilot reject 06-spoofed-spike

    No answer in 24 hours counts as a no. Approving only changes the record. It cannot pay anything.

  6. Stop it any timeCreate one empty file, or send SIGTERM. It stops before the next document and writes the stop to the audit log.

    touch traces/latest/STOP

  7. Check it afterwardspython3 -m doubtpilot replay verifies the tamper-evident audit chain and replays every decision. python3 -m doubtpilot health exits 0 or 1 for cron.

Behind another AI agent

Use DoubtPilot as the gate between the documents and the agent that acts on them. The other agent never reads raw mail. It only sees what DoubtPilot has already checked.

mail / files
   |
   v
DoubtPilot (read-only)
   |-- FILED --> your agent acts
   `-- HOLD ---> a human decides
1. Let your agent drop incoming documents into one inbox folder (or give DoubtPilot the read-only mailbox). The agent does not open them itself.
2. Run DoubtPilot on that folder with --loop --supervise.
3. Tell your agent to read only traces/latest/digest.md and the cards. Anything under "needs you" is off limits until a person runs approve.
4. Wire python3 -m doubtpilot health into your monitor. If it fails, pause your agent. Pull the plug with touch traces/latest/STOP.

Honest note: this is a file-based pattern, not a packaged plug-in or API. A hostile document cannot make DoubtPilot act, because it has no tool to act with. Your own agent still needs the same discipline.

Watch it work (2:38)

One realistic day, the seatbelt, and the honest scorecard. Real output, no mock-ups.

06 / Ticket stub

The real numbers, first run first.

We wrote each test set by hand, ran it once, published the score, then fixed what failed. The solid bar is the first run, the only honest measure of how well the rules generalize. The hatched bar is after fixes. It proves the fix worked on that set, nothing more.

first run, before fixesafter fixes (tuned on, not a generalization score)
Locked set v334 new cases, run once, never tuned on
29 / 34
Set v426 cases, red-team of the payee trail
14 / 26 then 26 / 26
Set v5, rules alone25 messy documents, written first
13 / 25 then 24 / 25
Set v5, with doubt checksame 25 documents, 0 false alarms
16 / 25 first run
Red-team self-test6 hostile sentences x 17 disguises
first run 63/102, then 102/102 after tuning
Red-team round 484 new disguises, run once, never tuned on
38 / 84 first run
Official Trap Pack20 files; scanner tuned after seeing them
12/20 first run ยท 20/20 after fixing, tuned on the pack (regression check)

What this does not prove. These are small, hand-written sets by the author, so none of it is production accuracy. The doubt check does not catch a document that all 12 rewrites misread the same way. The Trap Pack was tuned on, so it is a regression check. Tests: 101, all passing (97 run on any clone, 4 more run when the official Trap Pack is present). Each safety claim has a test. The full history of misses and fixes is in the repo under tests/benchmark/.

07 / Not in the bag

What it will not do. On purpose, or not yet.

Cleared for takeoff

Give it the paperwork. Keep the wallet.

An agent you can leave running because it cannot spend your money, tests itself before each flight, and proves what it did.