Skip to main content

Bonafide

A calibrated, provenance-first framework for detecting AI-generated media — honest about what it knows, and about what it doesn't.

In an age of deepfakes and synthetic everything, the question "was this made by a human or by AI?" matters more each day. The existing detectors answer it with confident binaries that are wrong often enough — and in biased enough ways — that their own customers are turning them off.

Bonafide takes a different bet. It treats detection as evidence aggregation under uncertainty: it fuses hard provenance (C2PA / Content Credentials), watermarks (SynthID), and an ensemble of ML detectors into one calibrated probability with a confidence interval and a readable evidence report — and it abstains when the evidence doesn't support a confident call. Evidence, never an accusation.

  • The moat: a Bayesian evidence-fusion + calibration engine that combines cryptographic proof and noisy ML scores into one honest, auditable verdict.
  • The architecture: ports-and-adapters, so any detector for any medium plugs in — text and images first, audio and video as drop-in adapters later, with zero core changes.
  • The wedge: the only detector you can actually trust — plus a regulatory tailwind (EU AI Act Article 50, effective 2 Aug 2026).

See DESIGN.md for the full technical design.

Status: M2a — a real, trust-verified C2PA / Content Credentials signal for images (M1), plus a real calibration + conformal-abstention core with an evaluation harness and bonafide fit / bonafide eval (M2a). The neural text ensemble lands in M2b, so text still uses a placeholder heuristic and mostly returns abstain. See ROADMAP.md for the plan.


Run it

Prerequisites: Python ≥ 3.11 and uv (check: python --version, uv --version).

uv venv                                     # create .venv
uv pip install -e ".[dev,provenance]"       # install (core is pure-Python; ML is an extra)

# CLI — analyze an image's Content Credentials, or some text
uv run bonafide detect ./photo.jpg
uv run bonafide detect --text "The quick brown fox jumps over the lazy dog near the bridge."
uv run bonafide detect ./photo.jpg --json

# API — starts on http://localhost:8000 (interactive docs at /docs)
uv run uvicorn bonafide.service.app:app --reload

A C2PA-signed image gives a real, explained verdict:

Bonafide verdict: 100% AI-generated (CI 99-100%)  |  decision: AI
modality: image  |  engine: bonafide/0.0.1+fuse-logodds-v0  |  coverage: 95%

Evidence:
  [+] c2pa.manifest        conclusive llr +6.00  x0.95  -> +5.70   (basis=digitalSourceType:
      trainedAlgorithmicMedia, validation_state=Trusted, signer=Adobe Inc., ...)

Conflicts: none

Everything else still answers honestly: an unsigned image, a self-signed "a camera took this" spoof, and ordinary text all return abstain, because Bonafide refuses to guess. The text ensemble and real calibration arrive in M2.

Commands

Command What it does
uv run bonafide detect <src> Run a detection and print the evidence report
uv run bonafide fit <corpus.jsonl> -o cal.json Fit a calibration + abstention artifact from labeled data
uv run bonafide eval <corpus.jsonl> -c cal.json Evaluate calibration + decisions (ECE, FPR, coverage)
uv run bonafide detect <src> -c cal.json Detect using a fitted calibration artifact
uv run uvicorn bonafide.service.app:app --reload Run the HTTP API
uv run pytest Run the tests
uv run ruff check . && uv run mypy src tests Lint + typecheck
uv build Build the wheel/sdist

Optional extras (installed per milestone)

Extra Adds Milestone
.[provenance] C2PA / Content Credentials verification (c2pa-python) M1
.[calibrate] isotonic calibration + conformal abstention M2
.[text] zero-shot text detectors + SynthID-Text (torch, transformers) M2
.[image] image forensic detectors M3
.[explain] Claude-rendered evidence reports M4
.[all] everything above —

Project docs

Doc What's in it
DESIGN.md The full design and rationale — the single source of truth.
ROADMAP.md The milestone checklist (the plan + what's done).
docs/adr/ Architecture Decision Records.

Tech stack

Python 3.11+ · Pydantic v2 · FastAPI + Uvicorn · Typer CLI · uv + hatchling. ML/provenance (c2pa-python, transformers, torch, scikit-learn, conformal) load as optional extras.

License

MIT — see LICENSE.

Metadata

Release files for bonafide 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bonafide 0.0.2
File Size Uploaded
bonafide-0.0.2.tar.gz 275.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bonafide 0.0.2
File Interpreter ABI Platform
bonafide-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 360.4 kB

Release files / bonafide-0.0.2.tar.gz

Download URL bonafide-0.0.2.tar.gz
Size 275.8 kB
Tags Source
SHA-256 checksum
How to use checksums
64d8a3810b63c7e122db7e4f08338da0db20e0cc45756379a58155a4c1cfea9b
BLAKE2b-256 checksum
How to use checksums
45a5cfff0bf460cdb7ed45a79284f829dff7f69f6c3e0e867f8d9df39a1f16b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / bonafide-0.0.2-py3-none-any.whl

Download URL bonafide-0.0.2-py3-none-any.whl
Size 84.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fadc72cd1a4a2a17674a0166b3b317dabe7e657ccd5f5c7929fe5c66ee3fbbf0
BLAKE2b-256 checksum
How to use checksums
b142ff5c15e58677a21a9166068b15f6798b132f4e179eaff6cd3385eff6e68d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page