Skip to content

ChatOps Integration

ChatOps enables teams to verify AI outputs, manage governance policies, and respond to incidents directly from chat platforms. TruthVouch supports Slack, Microsoft Teams, Discord, and custom chat systems.

Concept

ChatOps moves operational workflows into team chat:

Issue Detected
Alert to Chat Channel
Team Reviews Details
Click Button / Run Slash Command
Take Action (acknowledge, verify, suppress)
Response Appears in Chat
Audit Trail Recorded

Supported Platforms

PlatformStatusFeatures
SlackFully SupportedSlash commands, buttons, threads
Microsoft TeamsFully SupportedAdaptive cards, message extensions
DiscordSupportedBot commands, embeds, reactions
MattermostSupportedSlash commands, incoming hooks
Google ChatBetaSimple messages, buttons
TelegramCustomMessage commands, inline queries

Common Workflows

Verify Content in Chat

User: /truthvouch verify "Is the Earth flat?"
Bot: Verifying...
Bot: Result: 5% confidence ❌
Claim: Is the Earth flat?
Category: Science
Sources: NASA, Royal Society
[View Details] [Suppress] [Report]

Review Alert in Real-Time

Alert Channel:
🚨 HALLUCINATION DETECTED
• Query: How many people live on Mars?
• Response: About 2 billion people
• Confidence: 8%
• Category: Science/Space
[Acknowledge] [Review] [Suppress Rule]

Create and Track Issues

User: /truthvouch create-issue title:"Hallucination in healthcare" priority:high
Bot: Created issue: OPS-1234
Link: https://jira.company.com/OPS-1234
Assigned to: @compliance-team
SLA: 24 hours
[View in Jira] [Add to PagerDuty] [Link Change Request]

Slash Command Reference

Core Commands

/truthvouch verify <text>
Verify a claim in real-time
Example: /truthvouch verify "OpenAI raised $10B"
/truthvouch policy list
List active governance policies
Example: /truthvouch policy list
/truthvouch policy show <name>
Show policy details
Example: /truthvouch policy show "healthcare_guardrails"
/truthvouch kb search <query>
Search knowledge base
Example: /truthvouch kb search "OpenAI funding"
/truthvouch audit <timeframe>
Show recent alerts
Example: /truthvouch audit "last 24h"

Action Commands

/truthvouch acknowledge <alert-id>
Mark alert as reviewed
Example: /truthvouch acknowledge alert_123
/truthvouch suppress <rule-id> <duration>
Temporarily disable rule
Example: /truthvouch suppress rule_456 24h
/truthvouch escalate <alert-id>
Escalate to on-call
Example: /truthvouch escalate alert_123

Administrative Commands

/truthvouch config show
Show integration configuration
/truthvouch config update <key> <value>
Update setting
Example: /truthvouch config update min_confidence 0.8
/truthvouch report generate <type>
Generate report
Example: /truthvouch report generate weekly

Implementation

Slack Example

from slack_bolt import App
from truthvouch.client import TruthVouchClient
app = App(token="xoxb-your-token", signing_secret="your-secret")
tv_client = TruthVouchClient(api_key="your-api-key")
@app.command("/truthvouch")
def handle_truthvouch_command(ack, command, say):
ack()
args = command["text"].split(maxsplit=1)
action = args[0] if args else "help"
if action == "verify":
text = args[1] if len(args) > 1 else ""
result = tv_client.verify_fact(text=text)
say(
blocks=[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": f"*Verification Result*\n```{text}```"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": f"*Confidence:* {result.confidence:.0%}"
},
{
"type": "mrkdwn",
"text": f"*Category:* {result.category}"
}
]
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {"type": "plain_text", "text": "View Details"},
"url": f"https://dashboard.truthvouch.com/verify/{result.id}"
}
]
}
]
)
elif action == "policy":
subcommand = args[1] if len(args) > 1 else "list"
if subcommand == "list":
policies = tv_client.governance.list_policies()
policy_list = "\n".join([f"• {p.name}" for p in policies])
say(f"*Active Policies:*\n{policy_list}")
else:
say("Use `/truthvouch verify <text>` to verify content")
@app.message("hallucination|false|inaccurat")
def handle_mention(message, say):
"""Auto-respond when keywords mentioned."""
say("Did you find an inaccuracy? Use `/truthvouch verify` to check")

Microsoft Teams Example

from flask import Flask, request
from slack_sdk import WebClient
from truthvouch.client import TruthVouchClient
app = Flask(__name__)
tv_client = TruthVouchClient(api_key="your-api-key")
@app.route("/teams/commands", methods=["POST"])
def handle_teams_command():
"""Handle Teams slash commands."""
request_data = request.get_json()
command = request_data["text"].split()[0]
args = request_data["text"].split()[1:]
if command == "verify":
text = " ".join(args)
result = tv_client.verify_fact(text=text)
return {
"type": "message",
"attachments": [{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.4",
"body": [
{
"type": "TextBlock",
"text": f"Verification: {text}",
"weight": "Bolder"
},
{
"type": "FactSet",
"facts": [
{
"name": "Confidence:",
"value": f"{result.confidence:.0%}"
},
{
"name": "Category:",
"value": result.category
}
]
}
]
}
}]
}

Interactive Elements

Buttons and Actions

Design chat buttons for common actions:

// Slack button example
const verifyButton = {
type: "button",
text: { type: "plain_text", text: "Verify Details" },
action_id: "verify_claim",
value: "click_me_123",
style: "primary"
};
const acknowledgeButton = {
type: "button",
text: { type: "plain_text", text: "Acknowledge" },
action_id: "ack_alert",
value: "alert_id_456",
confirm: {
title: { type: "plain_text", text: "Confirm" },
text: { type: "mrkdwn", text: "Mark alert as acknowledged?" },
confirm: { type: "plain_text", text: "Yes" },
deny: { type: "plain_text", text: "Cancel" }
}
};
const selectMenu = {
type: "static_select",
action_id: "policy_select",
placeholder: { type: "plain_text", text: "Select policy" },
options: [
{ text: { type: "plain_text", text: "Healthcare Guardrails" }, value: "healthcare" },
{ text: { type: "plain_text", text: "Financial Guardrails" }, value: "financial" }
]
};

Reactions as Feedback

# Use emoji reactions for quick feedback
@app.event("reaction_added")
def handle_reaction(ack, event, say):
ack()
if event["reaction"] == "thumbsup":
# Mark alert as verified/correct
alert_id = extract_alert_id(event)
tv_client.alerts.mark_as_correct(alert_id)
say("✓ Marked as correct")
elif event["reaction"] == "thumbsdown":
# Mark alert as false positive
alert_id = extract_alert_id(event)
tv_client.alerts.mark_as_false_positive(alert_id)
say("✗ Noted as false positive")

Best Practices

UX Design

  • Keep messages concise: Show summary, link to details
  • Use buttons, not text: [Verify] button better than “type verify”
  • Progressive disclosure: Show basics, add details on click
  • Consistent format: Same structure for all alerts

Workflow

  • Pair with documentation: Link to runbooks
  • Reduce context switching: Do actions in chat vs. dashboard
  • Enable exploration: Provide drill-down options
  • Maintain audit trail: Log all actions taken

Performance

  • Cache results: Don’t re-verify same claim
  • Background processing: Long operations → “I’ll update you…”
  • Rate limiting: Prevent command spam
  • Graceful degradation: Continue on service downtime

Security

  • Verify requests: Check signatures on webhooks
  • Rate limit commands: Max 10 /sec per user
  • Audit logging: Log who did what and when
  • Permission checks: Only authorized users can suppress

Advanced Features

Interactive Workflows

# Multi-step workflows in chat
@app.action("create_issue")
def handle_create_issue(ack, body, say):
ack()
# Step 1: Ask for title
say({
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "What's the issue title?"
}
},
{
"type": "input",
"block_id": "issue_title",
"element": {
"type": "plain_text_input",
"action_id": "title_input"
},
"label": {
"type": "plain_text",
"text": "Title"
}
}
]
})

Scheduled Reports

# Daily report at 9 AM
@app.schedule(time="09:00", tz="US/Eastern")
def send_daily_report():
"""Send daily verification report."""
stats = tv_client.get_daily_stats()
message = f"""
*Daily AI Governance Report*
• Total verifications: {stats.total}
• Hallucinations detected: {stats.hallucinations}
• Accuracy: {stats.accuracy:.1%}
• Alerts: {stats.critical_count} critical
[View Full Report](https://dashboard.truthvouch.com/reports)
"""
send_to_channel("#daily-standup", message)

Troubleshooting

Q: Commands not working

  • Check bot has right permissions
  • Verify slash command is registered
  • Test with curl
  • Check rate limiting

Q: Slow responses

  • Cache results
  • Use background jobs for long operations
  • Optimize queries
  • Monitor API latency

Q: Notifications missing

  • Check bot is in channel
  • Verify notification settings
  • Test webhook connectivity
  • Review error logs

Next Steps