Domain Trust & Provenance
Relevant source files
The following files were used as context for generating this wiki page:
The Domain Trust & Provenance system is a critical component of the TrueLens platform designed to verify the credibility of digital content by analyzing the infrastructure of the hosting domain and the historical record of specific claims or URLs. This system operates as part of a multi-signal machine learning pipeline, contributing significantly to the final "Trust Score" assigned to any analyzed content.
The system is divided into two primary disciplines: Domain Analysis, which assesses technical signals like SSL validity, WHOIS registration age, and TLD reputation, and Provenance Analysis, which queries historical archives (Wayback Machine) and fact-checking databases (Google Fact Check, Wikipedia) to determine if content has been previously flagged or verified.
Sources: truelens-backend/app/tasks/ml_pipeline.py:28-40, truelens-app/src/lib/analysis.ts:133-138
Domain Trust Analysis
Domain Trust Analysis evaluates the technical and administrative reputation of a website's domain name. It identifies high-risk indicators such as extremely new registrations, suspicious Top-Level Domains (TLDs), and presence on malware blocklists.
Key Components of Domain Analysis
- TLD Reputation: The system maintains lists of trusted TLDs (e.g.,
.gov,.edu) and suspicious TLDs frequently used for spam or phishing (e.g.,.xyz,.top,.click). - WHOIS Age Check: It retrieves the creation date of a domain. Domains less than 30 days old receive a high suspicious score penalty, while those older than 5 years receive a trust bonus.
- SSL/TLS Verification: Checks for the presence and validity of SSL certificates. Insecure domains (no HTTPS) or certificates expiring within 14 days increase the suspicion level.
- Blocklist Integration: Queries the Abuse.ch URLhaus API to determine if a domain is associated with known malware distribution.
Sources: truelens-backend/app/services/domain_analysis.py:22-42, truelens-backend/app/services/domain_analysis.py:118-175
Domain Analysis Logic Flow
The following diagram illustrates the sequence of checks performed during a domain analysis request.
The diagram shows how the system prioritizes a global trusted list before proceeding to technical checks.
Sources: truelens-backend/app/services/domain_analysis.py:108-185
Provenance Analysis
Provenance Analysis tracks the history and factual accuracy of content. It determines if a URL has a historical footprint and if the claims within the text have been verified by independent journalistic organizations.
Fact-Checking and History Verification
- Internet Archive (Wayback Machine): The system queries the Internet Archive Availability API to find the oldest and closest snapshots of a URL. A lack of historical record for an established-looking site is treated as a suspicious signal.
- Google Fact Check Tools: It extracts core claims from text content and queries the Google Fact Check API. It specifically looks for ratings such as "False," "Fake," or "Misleading" from verified publishers.
- Live AI Fact-Checking: For real-time verification, the system uses the
live_fact_checkerservice, which searches Wikipedia for snippets related to a claim and uses an LLM (Gemini) to provide a verdict.
Sources: truelens-backend/app/services/provenance.py:23-55, truelens-backend/app/services/provenance.py:108-144, truelens-backend/app/services/live_fact_checker.py:61-125
Provenance Scoring Impact
| Signal Source | Condition | Score Impact |
|---|---|---|
| Wayback Machine | Historical record found | -10 (More Trusted) |
| Wayback Machine | No historical record | +10 (More Suspicious) |
| Fact Check API | "False" / "Fake" rating | +30 (Highly Suspicious) |
| Fact Check API | "True" / "Accurate" rating | -20 (Verified Trusted) |
Sources: truelens-backend/app/services/provenance.py:118-141
Integration in the ML Pipeline
The outputs from Domain Analysis and Provenance are treated as individual "signals" that are fed into an ensemble scoring function. The process_scan_task orchestrates these calls asynchronously using Celery.
This diagram shows the asynchronous processing of metadata signals within the backend pipeline.
Sources: truelens-backend/app/tasks/ml_pipeline.py:155-185
Weight Distribution
Within the ensemble, "metadata" signals (which include domain analysis) and "provenance" signals contribute specific weights to the final score calculation:
- Metadata (Domain/EXIF): 0.25 (25%)
- Provenance: 0.05 (5%)
Sources: truelens-backend/app/tasks/ml_pipeline.py:43-51
Technical Implementation Details
Domain Reputation Constants
The system relies on predefined lists to optimize performance for well-known entities.
# Known highly trusted TLDs
TRUSTED_TLDS = {'.gov', '.edu', '.mil'}
# Known highly abused TLDs
SUSPICIOUS_TLDS = {
'.xyz', '.top', '.pw', '.tk', '.ml', '.ga', '.cf', '.gq',
'.club', '.online', '.site', '.click', '.link', '.vip',
}
# Known trusted domains
TRUSTED_DOMAINS = {
'google.com', 'microsoft.com', 'apple.com', 'amazon.com',
'github.com', 'wikipedia.org', 'nytimes.com', 'bbc.com',
}
Sources: truelens-backend/app/services/domain_analysis.py:22-42
Provenance Analysis Function
The analyze_provenance function serves as the primary entry point for history-based checks.
def analyze_provenance(url: Optional[str] = None, text: Optional[str] = None) -> Dict[str, Any]:
highlights = []
evidence = {}
score = 50
if url:
wayback = check_wayback_machine(url)
evidence["wayback"] = wayback
if wayback.get("has_history"):
score -= 10
highlights.append(f"Content provenance verified: {wayback.get('message')}")
if text and len(text) > 50:
claim_query = text.split('.')[0][:100]
fact_check = check_google_fact_check(claim_query)
# ... logic for handling ratings ...
Sources: truelens-backend/app/services/provenance.py:108-144
Summary
The Domain Trust & Provenance system provides the "contextual layer" of the TrueLens analysis suite. By combining technical infrastructure verification with historical fact-checking, it allows the platform to detect not just AI-generated patterns in content, but also the reliability of the source hosting that content. This prevents sophisticated AI-generated content on trusted domains from being unfairly penalized while flagging low-quality content on suspicious, newly created domains.