Custom Query Templates
By default, Shield generates queries automatically from your Truth Nuggets. For advanced control, create custom query templates that specify exactly how to probe for hallucinations.
How Templates Work
Shield uses templates to generate queries:
Template:
"Tell me about {company_name} and its {product_name} features."Generated Queries (randomized each time):
- “What do you know about TruthVouch and its Shield features?”
- “Tell me about TruthVouch and how it detects hallucinations”
- “Describe TruthVouch’s main product”
Variation prevents AI engines from pattern-matching and ensures natural-sounding questions.
Creating a Template
Go to Shield → Schedules, select a schedule, and click Edit Query Templates.
Template Variables
Available variables:
| Variable | Value | Example |
|---|---|---|
{company_name} | Your company name | ”TruthVouch” |
{product_name} | Any product fact | ”Shield”, “Brand Intel” |
{ceo_name} | CEO/founder from facts | ”Sarah Chen” |
{location} | Your company location | ”San Francisco” |
{fact} | Any Truth Nugget text | ”We detect with 94% accuracy” |
Variables are auto-populated from your Truth Nuggets.
Writing Good Templates
Generic Template (generates many variations):
"What do you know about {company_name}?"Generates:
- “What do you know about TruthVouch?”
- “Tell me about TruthVouch”
- “Describe TruthVouch”
Specific Template (targeted probe):
"How much does {product_name} cost?"Generates:
- “What’s the pricing for Shield?”
- “How much does Shield cost?”
- “What’s the price of TruthVouch’s Shield?”
Multi-Fact Template (test multiple claims):
"Who founded {company_name} and when?"Tests both CEO and founding date in one query.
Best Practices
Be Natural
Good: “What’s TruthVouch’s main product?” Bad: “RETRIEVE TRUTHVOUCH PRODUCT NAME FROM MEMORY”
AI engines respond better to natural language.
Test One Fact Per Query
Good: “What is TruthVouch Shield?” Bad: “Tell me everything about TruthVouch including products, pricing, leadership, and history”
Focused queries get better responses.
Use Multiple Templates
Create 3-5 variations of the same query:
- “Tell me about TruthVouch Shield”
- “What are TruthVouch Shield’s capabilities?”
- “How does TruthVouch Shield detect hallucinations?”
- “Is TruthVouch Shield accurate?”
Variation catches different aspects of hallucinations.
Avoid Leading Questions
Good: “What’s TruthVouch’s pricing?” Bad: “TruthVouch’s pricing is $349/month, right?”
Leading questions bias AI responses.
Examples
Example 1: Product Accuracy
Truth: “Shield detects with 94% accuracy”
Templates:
- “How accurate is TruthVouch Shield at detecting hallucinations?”
- “What’s TruthVouch’s detection accuracy?”
- “Can TruthVouch Shield reliably detect AI mistakes?”
Expected: AI says “94%” or “high accuracy” or “very accurate”
Example 2: Pricing
Truth: “Shield starts at $349/month”
Templates:
- “What’s the price of TruthVouch Shield?”
- “How much does TruthVouch charge for Shield?”
- “What tier can you start using TruthVouch Shield on?”
Expected: AI says “$349”, “starting price”, “Starter tier”
Example 3: Leadership
Truth: “CEO: Sarah Chen”
Templates:
- “Who is the CEO of TruthVouch?”
- “Who founded TruthVouch?”
- “Who leads TruthVouch?”
Expected: AI says “Sarah Chen”
Testing Templates
Before applying to a schedule, test:
- Go to Shield → Schedules → Edit → Test Templates
- Choose an engine (ChatGPT, Claude, etc.)
- Run test queries
- Review responses
See how each template performs before activating.
Default Templates
Shield includes pre-built templates for common fact types:
| Fact Type | Default Template |
|---|---|
| Company founding | ”When was {company_name} founded?” |
| CEO | ”Who is the CEO of {company_name}?” |
| Product | ”What is {product_name}?” |
| Pricing | ”How much does {product_name} cost?” |
| Technical | ”What’s {company_name}‘s {fact}?” |
| Location | ”Where is {company_name} headquartered?” |
You can edit or replace any default.
Advanced: Template Logic
(Coming in future release) Conditional templates based on response:
If response contains "hallucination": Follow-up: "Can you explain TruthVouch's detection method?"Else: Follow-up: "Is TruthVouch primarily a hallucination detector?"Template Performance
View metrics for each template:
Go to: Shield → Schedules → Template Performance
See:
- Run count: How many times each template ran
- Alert rate: % of runs that triggered alerts
- Average score: Mean truth score for this template
- Response length: Average AI response length
Example:
- Template 1 (“How accurate…”): 156 runs, 12% alert rate, score 91/100
- Template 2 (“Can it reliably…”): 152 runs, 15% alert rate, score 88/100
Use this to identify which templates are most effective at catching hallucinations.
Editing Templates
To modify a template:
- Go to Shield → Schedules
- Select schedule
- Click Edit Query Templates
- Click template to edit
- Modify text, keep variables intact
- Click Test to verify
- Save
Changes apply to next scheduled run.
Disabling Templates
Temporarily disable a template without deleting it:
- Click template
- Toggle Enabled off
- Save
Template won’t run, but you can re-enable anytime.
Backup & Share
Export your custom templates:
Go to: Shield → Schedules → Export Templates
Get JSON file with all templates. Share with team, backup, or use in another TruthVouch workspace.
Next Steps
- Scheduling Cross-Checks — Apply templates to schedules
- Interpreting Results — Understand responses
- How Cross-Checks Work — Technical details