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 โ€” Local embeddings for similarity, LLM optional

Quick Start

Installation

pip install truthcheck

For trace functionality (local similarity):

pip install truthcheck[trace]

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

# LLM for deep analysis (pick one)
GEMINI_API_KEY=...              # Google Gemini (recommended)
OPENAI_API_KEY=sk-...           # OpenAI
ANTHROPIC_API_KEY=...           # Anthropic Claude

# Search (optional - DuckDuckGo works without key)
BRAVE_API_KEY=...               # Brave Search
SEARXNG_URL=http://localhost:8080  # Self-hosted

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.2.1.tar.gz (287.6 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.2.1-py3-none-any.whl (283.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for truthcheck-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d804f070bd98265909518b8c7d88e05295d32cc2e7d72aaff72276986795ddce
MD5 13bc3ab79cff7d9317f6d22b06c9fffb
BLAKE2b-256 e17c4844f8e15768213548177fceed2889130e94a85d3e818a3cfdfa22e7142d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: truthcheck-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 283.5 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 597e3c7322e67fe27f2e5e254eb5f3b872f431d25f25bd78de9e6c6a93817057
MD5 667176e88d85c20906023b54231a8bef
BLAKE2b-256 a444e3f032a3a508a04985ecaff5546953cf04fdf7b3a2e7e3c0699b98e1ed13

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