Truth Protocol Enforcement Guide
The Problem
Section titled “The Problem”The Truth Protocol as implemented is just documentation - it has no enforcement mechanism. Agents can claim anything without verification, and there’s no automatic way to check their claims.
Why It Fails
Section titled “Why It Fails”- Isolated Agent Context: Task agents operate in their own context without access to verification tools
- Text-Only Responses: Agents return unstructured text, not verifiable claims
- No Verification Loop: Claude Code doesn’t automatically verify agent claims
- Missing Integration: The TruthVerifier class exists but isn’t used anywhere
Immediate Solution: Manual Verification Pattern
Section titled “Immediate Solution: Manual Verification Pattern”Until we have automated enforcement, Claude Code must follow this pattern:
After Every Task Agent Call
Section titled “After Every Task Agent Call”// 1. Call the Task agentconst agentResponse = await Task({ subagent_type: "some-agent", prompt: "Create a file at /path/to/file.ts",});
// 2. NEVER trust the response - always verifyconst verification = await Read({ file_path: "/path/to/file.ts",});
// 3. Report based on verification, not claimsif (verification.exists) { console.log("✅ Verified: File created at /path/to/file.ts");} else { console.log("❌ Failed: Agent claimed to create file but it doesn't exist");}Short-Term Solution: Verification Commands
Section titled “Short-Term Solution: Verification Commands”Modify agent templates to include verification commands in their responses:
## Truth Protocol Response Format
When completing any file operation, end your response with:
```verificationVERIFY_COMMANDS:- ls -la /path/to/file- head -n 10 /path/to/file- git status --short```This allows Claude Code to:
- Parse the verification commands
- Execute them automatically
- Report actual results
## Medium-Term Solution: Structured Agent Responses
Modify the Task agent system to return structured data:
```typescriptinterface TaskAgentResponse { // Human-readable message message: string;
// Claims about what was done claims: Array<{ type: "file_created" | "file_modified" | "file_deleted"; path: string; size?: number; checksum?: string; }>;
// Verification commands to run verifications: string[];
// Confidence level confidence: "verified" | "claimed" | "attempted";}Long-Term Solution: MCP Server for Truth
Section titled “Long-Term Solution: MCP Server for Truth”Create an MCP server that enforces the Truth Protocol:
class TruthEnforcerServer { async handleAgentResponse(response: unknown) { const claims = this.extractClaims(response); const verifications = await this.verifyClaims(claims);
return { original: response, verified: verifications, trustScore: this.calculateTrustScore(verifications), }; }
private async verifyClaims(claims: Claim[]) { const results = []; for (const claim of claims) { if (claim.type === "file_created") { const exists = await fs.exists(claim.path); results.push({ claim, verified: exists, evidence: exists ? await fs.stat(claim.path) : null, }); } } return results; }}Implementation Checklist
Section titled “Implementation Checklist”For Claude Code (Immediate)
Section titled “For Claude Code (Immediate)”- Never report agent claims without verification
- Always use Read tool after file creation claims
- Always use Bash tool to verify state changes
- Report verification failures to users
For Agent Templates (This Week)
Section titled “For Agent Templates (This Week)”- Add verification command sections to all agents
- Include file size and checksum in creation claims
- Add confidence levels to all claims
- Document verification patterns in each agent
For Aichaku System (This Month)
Section titled “For Aichaku System (This Month)”- Integrate TruthVerifier class into CLI
- Add verification hooks to agent communication
- Create MCP server for truth enforcement
- Add metrics for truth protocol compliance
Verification Patterns by Operation
Section titled “Verification Patterns by Operation”File Creation
Section titled “File Creation”# After claimed file creationls -la /path/to/filefile /path/to/filehead -n 20 /path/to/fileFile Modification
Section titled “File Modification”# After claimed file modificationgit diff /path/to/filediff /path/to/file.backup /path/to/filemd5sum /path/to/fileTest Execution
Section titled “Test Execution”# After claimed test runnpm test -- --listTestsnpm test -- --verbose 2>&1 | tail -50echo "Exit code: $?"Build/Compile
Section titled “Build/Compile”# After claimed buildls -la dist/find . -name "*.js" -newer timestampecho "Build artifacts: $(find dist -type f | wc -l)"Metrics for Success
Section titled “Metrics for Success”Track these metrics to ensure Truth Protocol effectiveness:
- Claim Verification Rate: % of agent claims that are verified
- False Claim Rate: % of claims that fail verification
- Verification Time: Average time to verify claims
- User Trust Score: Survey of user confidence in agent claims
Conclusion
Section titled “Conclusion”The Truth Protocol requires enforcement, not just documentation. Until automated enforcement is built, manual verification is mandatory. Every claim must be verified before reporting to users.
Remember: Trust is earned through verification, not promised through protocols.