Skip to content

Feature: PII sanitization middleware before LLM routing — EU AI Act compliance #174

@teodorofodocrispin-cmyk

Description

Context

ClawRouter routes requests across 55+ LLM models with x402 USDC payments on Solana. The routing layer is excellent — but requests travel unsanitized to LLM providers. User inputs frequently contain emails, phone numbers, national IDs, API keys, and financial data that goes directly to OpenAI/Anthropic/Google servers.

The gap

The x402 payment flow protects authentication. But it doesn't protect data privacy. Every request that ClawRouter forwards is a potential PII leak to external LLM providers — all of which log inputs by default unless opted out.

EU AI Act — 64 days

August 2, 2026. Articles 12, 13, and 26 require verifiable audit trails for automated decisions involving personal data. Any LLM router processing EU user data without sanitization creates compliance liability.

Drop-in integration — one line

TrustBoost is a PII sanitization layer built specifically for x402 pipelines on Solana — same ecosystem as ClawRouter:

// Before routing to LLM provider
async function sanitizeBeforeRoute(userMessage: string): Promise<string> {
  const response = await fetch("https://api.trustboost.dev/sanitize", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      text: userMessage,
      tx_hash: "TRIAL",              // 50 free sanitizations
      wallet_address: "clawrouter-agent",
      context: "general"             // or financial/code/legal/medical
    })
  });
  const data = await response.json();
  return data.data.sanitized_content; // PII replaced with [REDACTED]
}

Why TrustBoost fits ClawRouter specifically:

  • x402 native — same payment model, same Solana USDC
  • OpenClaw ecosystem — TrustBoost has 523+ downloads on ClawHub
  • Proof of Sanitization anchored on Solana via Helius — complements x402 payment receipts
  • 8 languages: EN, ES-LATAM (RFC/CUIT), PT-BR (CPF/CNPJ), DE, JA, FR, IT, KO
  • F1=1.000 accuracy, ~200ms latency

The complete flow

User request → TrustBoost /sanitize → [PII removed] → ClawRouter routes → LLM provider

Proof of Sanitization on Solana
(EU AI Act audit trail)

Try it:

curl -X POST https://api.trustboost.dev/sanitize/preview \
  -H "Content-Type: application/json" \
  -d '{"text": "Route this to Claude: my SSN is 123-45-6789, email john@corp.com"}'

Happy to contribute a PR with the middleware integration. 🛡️

Source: https://github.com/teodorofodocrispin-cmyk/TrustBoost-PII-Sanitizer
Health: https://api.trustboost.dev/health
ClawHub: https://clawhub.ai/teodorofodocrispin-cmyk/trustboost-pii-sanitizer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions