Skip to content

Shield API

The Shield API lets you manage verified facts (truth nuggets), monitor detected hallucinations, and manage fact-checking alerts.

Overview

Shield provides:

  • Truth Nuggets — Curated verified facts
  • Alerts — Hallucination and accuracy warnings
  • Corrections — Deployed fact corrections

Truth Nuggets

Create Truth Nugget

POST /api/v1/nuggets

A truth nugget is a verified fact about your domain:

Terminal window
curl -X POST https://api.truthvouch.com/api/v1/nuggets \
-H "Authorization: Bearer tv_live_..." \
-H "Content-Type: application/json" \
-d '{
"fact": "Our API handles 1 million requests per second",
"context": "Product specifications",
"sources": [
{
"title": "Performance Benchmark",
"url": "https://blog.company.com/benchmarks/2024"
}
],
"tags": ["product", "performance"],
"verified": true
}'

List Truth Nuggets

GET /api/v1/nuggets

Terminal window
curl "https://api.truthvouch.com/api/v1/nuggets?tag=product&page=1" \
-H "Authorization: Bearer tv_live_..."

Get Nugget

GET /api/v1/nuggets/{nuggetId}

Terminal window
curl https://api.truthvouch.com/api/v1/nuggets/nugget_abc123 \
-H "Authorization: Bearer tv_live_..."

Alerts

Get Alerts

GET /api/v1/alerts

Terminal window
curl "https://api.truthvouch.com/api/v1/alerts?severity=high&status=open" \
-H "Authorization: Bearer tv_live_..."

Response:

{
"data": [
{
"id": "alert_123",
"severity": "high",
"type": "hallucination",
"message": "Response contains unverified claim about product specifications",
"fact": "Our API handles 100M requests per second",
"actualFact": "Our API handles 1M requests per second",
"confidenceScore": 0.92,
"status": "open",
"createdAt": "2024-03-15T10:30:00Z"
}
],
"meta": {
"page": 1,
"pageSize": 25,
"total": 42
}
}

Resolve Alert

PATCH /api/v1/alerts/{alertId}

Terminal window
curl -X PATCH https://api.truthvouch.com/api/v1/alerts/alert_123 \
-H "Authorization: Bearer tv_live_..." \
-d '{
"status": "resolved",
"resolution": "Hallucination - LLM was hallucinating, corrected model version"
}'

Corrections

Corrections are fact updates deployed after hallucinations are detected.

Create Correction

POST /api/v1/corrections

Terminal window
curl -X POST https://api.truthvouch.com/api/v1/corrections \
-H "Authorization: Bearer tv_live_..." \
-d '{
"alertId": "alert_123",
"correctFact": "Our API handles 1 million requests per second",
"reason": "LLM was hallucinating higher numbers",
"source": "Product documentation, verified by engineering team"
}'

Deploy Correction

Once a correction is reviewed, deploy it:

PATCH /api/v1/corrections/{correctionId}

Terminal window
curl -X PATCH https://api.truthvouch.com/api/v1/corrections/correction_xyz \
-H "Authorization: Bearer tv_live_..." \
-d '{
"status": "deployed"
}'

Alert Types

TypeDescription
hallucinationClaim contradicts known facts
unverified_claimNo sources found to verify
source_conflictSources disagree on fact
outdated_infoFact is outdated
contextual_errorCorrect fact, wrong context

Alert Severity

SeverityImpactRecommended Action
criticalHigh confidence hallucinationImmediate correction needed
highStrong evidence of errorReview and correct promptly
mediumModerate confidence issueReview when possible
lowPotential issue, needs reviewInvestigate if recurring

Severity thresholds are configurable in Settings → Alert Rules.


Next Steps