Skip to main content

Open source AI content verification

Project description

TruthCheck ๐Ÿ”

Open source AI content verification. Score claims 0-100 and trace their origins.

PyPI License: MIT Publishers

The Problem

AI chatbots retrieve content from the web and present it as fact. Bad actors exploit this by creating fake articles designed to fool AI systems โ€” effectively laundering misinformation through "trusted" AI interfaces.

Example: BBC journalist Thomas Germain demonstrated he could make ChatGPT and Google's AI tell users he's "the best tech journalist at eating hot dogs" โ€” by publishing a single fake article on his personal website.

The Solution

TruthCheck provides two powerful tools:

1. verify โ€” Score claims 0-100

$ truthcheck verify "Thomas Germain is the best tech journalist at eating hot dogs" --llm gemini --deep

Claim: Thomas Germain is the best tech journalist at eating hot dogs
TruthScore: 0/100 (FALSE)

Score Breakdown:
  Publisher Credibility: 41/100 (30%)
  Content Analysis:      2/100 (30%)
  Corroboration:         0/100 (20%)
  Fact-Check:            20/100 (20%)

โš ๏ธ ZERO FLAG: Content identified as satire

Evidence:
  โ€ข ๐Ÿšจ Content identified as satire
  โ€ข โš ๏ธ Self-published: tomgermain.com publishes claims about its own subject
  โ€ข ๐ŸŽญ Satire detected: tomgermain.com

2. trace โ€” Find the origin and propagation

$ truthcheck trace "Thomas Germain is the best tech journalist at eating hot dogs"

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘ CLAIM TRACE RESULT                                         โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘ Thomas Germain is the best tech journalist at eating ho... โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐ŸŽฏ ORIGIN (First Source)
   Domain: tomgermain.com
   Date:   2026-02-05
   URL:    https://tomgermain.com/hotdogs.html...

๐Ÿ“… TIMELINE
  ๐Ÿฅ‡ [2026-02-05] tomgermain.com
     โ””โ”€ The Best Tech Journalists at Eating Hot Dogs...
  ๐Ÿฅˆ [2026-02-18] bbc.com
     โ””โ”€ I hacked ChatGPT and Google's AI...
  ๐Ÿฅ‰ [2026-02-18] gizmodo.com
     โ””โ”€ You Can Hack ChatGPT to Become the World's Best...

๐Ÿ”— PROPAGATION
  tomgermain.com         โ”€โ”€โ–ถ bbc.com
                         [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘] 85%
  tomgermain.com         โ”€โ”€โ–ถ gizmodo.com
                         [โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘] 72%

๐Ÿ“Š STATS
   Sources found: 14
   With dates:    8
   Date range:    2026-02-05 โ†’ 2026-02-19
   Top domains:   tomgermain.com, bbc.com, gizmodo.com

Features

  • ๐ŸŽฏ TruthScore 0-100 โ€” Clear, weighted credibility score
  • ๐Ÿ” Origin Tracing โ€” Find where a claim started and how it spread
  • ๐Ÿ“Š 8,974 Publishers โ€” Auto-synced from Media Bias/Fact Check
  • ๐Ÿšจ Zero Flags โ€” Auto-detect satire, fake experiments, self-published
  • ๐Ÿฆ† Free Search โ€” DuckDuckGo by default (no API key needed)
  • ๐Ÿ”Œ MCP Server โ€” Works with Claude Desktop, Cursor
  • ๐Ÿ’ฐ Low Cost โ€” MinHash similarity (no PyTorch), LLM optional

Quick Start

Installation

pip install truthcheck

That's it! All features included. (~15MB, no heavy dependencies)

CLI Usage

# Verify a claim (TruthScore 0-100)
truthcheck verify "Some claim" --llm gemini --deep

# Trace claim origin (no LLM needed)
truthcheck trace "Some claim"
truthcheck trace "Some claim" --quick    # Fast (5 sources)
truthcheck trace "Some claim" --deep     # Thorough (30 sources)

# Check a URL
truthcheck check https://example.com/article

# Look up publisher reputation
truthcheck lookup breitbart.com

Python API

from truthcheck import verify_claim, trace_claim
from truthcheck.search import DuckDuckGoProvider

# Verify a claim (TruthScore 0-100)
result = verify_claim(
    "Earth is flat",
    search_provider=DuckDuckGoProvider(),
    deep_analysis=True
)
print(f"TruthScore: {result.truthscore}/100")
print(f"Evidence: {result.evidence}")

# Trace a claim (find origin)
result = trace_claim("Some viral claim")
print(f"Origin: {result['origin']['domain']} ({result['origin']['date']})")
print(f"Timeline: {len(result['timeline'])} sources")

How TruthScore Works

Scoring Formula (0-100)

Factor Weight What It Measures
Publisher Credibility 30% Is the source in MBFC? Trust rating?
Content Analysis 30% Does it make sense? Red flags?
Corroboration 20% Do reputable sources confirm?
Fact-Check 20% What do fact-checkers say?

Zero Flags (Automatic Score = 0)

These patterns force TruthScore to 0:

Flag Meaning
๐ŸŽญ Satire Content is humor/parody
๐Ÿงช Fake Experiment Deliberately fake to test AI
๐ŸŽฌ Entertainment Not meant as fact
๐Ÿค– AI-Generated Synthetic misinformation
โš ๏ธ Self-Published Subject publishes own claims

Score Interpretation

Score Label Meaning
0 FALSE Zero flag triggered
1-24 LIKELY FALSE Strong evidence against
25-49 UNCERTAIN Mixed evidence
50-74 POSSIBLY TRUE Some support
75-100 LIKELY TRUE Strong support

URL Verification

from truthcheck import verify

result = verify("https://reuters.com/article/...")
print(result.trust_score)      # 0.85
print(result.recommendation)   # TRUST / CAUTION / REJECT

Publisher Database

Includes 8,974 publishers from Media Bias/Fact Check:

$ truthcheck lookup reuters.com

Publisher Found:
  Name: Reuters
  Trust Score: 0.85
  Bias: center
  Fact Check Rating: very-high

Configuration

TruthCheck uses environment variables for API keys. No config file needed.

LLM Providers (for --llm option)

Provider Environment Variables (in priority order)
Gemini TRUTHSCORE_GEMINI_KEY or GEMINI_API_KEY or GOOGLE_API_KEY
OpenAI TRUTHSCORE_OPENAI_KEY or OPENAI_API_KEY
Anthropic TRUTHSCORE_ANTHROPIC_KEY or ANTHROPIC_API_KEY
Ollama No key needed (local)

Example setup (add to ~/.bashrc or ~/.zshrc):

# Pick one LLM provider
export GOOGLE_API_KEY=AIza...           # Gemini (recommended, free tier)
export OPENAI_API_KEY=sk-...            # OpenAI
export ANTHROPIC_API_KEY=sk-ant-...     # Anthropic

# Then use it
truthcheck verify "some claim" --llm gemini --deep

Or inline:

GOOGLE_API_KEY=AIza... truthcheck verify "claim" --llm gemini --deep

Search Providers

Provider Environment Variable Notes
DuckDuckGo None needed Default, free
Brave TRUTHSCORE_SEARCH_KEY Get free key
SearXNG SEARXNG_URL Self-hosted, default: http://localhost:8080
# Optional: Brave Search for better results
export TRUTHSCORE_SEARCH_KEY=BSA...
truthcheck verify "claim" --search brave

MCP Server (Claude Desktop, Cursor)

truthcheck-mcp
{
  "mcpServers": {
    "truthcheck": {
      "command": "truthcheck-mcp"
    }
  }
}

Project Structure

truthcheck/
โ”œโ”€โ”€ src/truthcheck/
โ”‚   โ”œโ”€โ”€ verify.py          # URL verification
โ”‚   โ”œโ”€โ”€ trace.py           # verify_claim() and trace_claim()
โ”‚   โ”œโ”€โ”€ similarity.py      # Local embeddings for trace
โ”‚   โ”œโ”€โ”€ propagation.py     # Build propagation tree
โ”‚   โ”œโ”€โ”€ visualize.py       # ASCII visualization
โ”‚   โ”œโ”€โ”€ publisher_db.py    # 8,974 publishers from MBFC
โ”‚   โ”œโ”€โ”€ search.py          # DuckDuckGo, Brave, SearXNG
โ”‚   โ”œโ”€โ”€ llm.py             # Gemini, OpenAI, Anthropic, Ollama
โ”‚   โ””โ”€โ”€ cli.py             # Command-line interface
โ””โ”€โ”€ tests/

Philosophy

  1. Scores over verdicts โ€” 0-100 is clearer than TRUE/FALSE
  2. Trace over trust โ€” Show the origin, not just a verdict
  3. Evidence over summaries โ€” Show why, not just what
  4. Open over proprietary โ€” Verification is a public good

License

MIT License.

Acknowledgments


Questions? Open an issue

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

truthcheck-0.3.1.tar.gz (288.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

truthcheck-0.3.1-py3-none-any.whl (284.0 kB view details)

Uploaded Python 3

File details

Details for the file truthcheck-0.3.1.tar.gz.

File metadata

  • Download URL: truthcheck-0.3.1.tar.gz
  • Upload date:
  • Size: 288.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for truthcheck-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3a46443b43fb02ccae5b8f6fcab85ce5d8422eb5027e8113133e8059bbe31529
MD5 c178d92f3ea7b5071f2ee7d9e48a0df3
BLAKE2b-256 297a6aff8a2bf7161582d86ddc0217df776ae9c987d61f9a3c7c6641410aad78

See more details on using hashes here.

File details

Details for the file truthcheck-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: truthcheck-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 284.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for truthcheck-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f025e6d7de2c353acd63281ebcc4e9f6918d73a7eea97d38254ef2a97e2ec4b7
MD5 c5d8d6de0c92f2d2d2cfa8b06f53e7a0
BLAKE2b-256 feb60f9e08a6c409a142007080cf1a8024d6e8ac4b7bce35a3535534fb315a74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page