ClawRouter icon indicating copy to clipboard operation
ClawRouter copied to clipboard

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

Open teodorofodocrispin-cmyk opened this issue 6 months ago • 1 comments

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 [email protected]"}'

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

teodorofodocrispin-cmyk avatar May 29 '26 16:05 teodorofodocrispin-cmyk

Closing — thanks for the detailed writeup. PII sanitization ahead of routing isn't something we're taking on: ClawRouter is a routing and payment layer and doesn't inspect or rewrite prompt content by design, and putting a redaction pass in that path would make us a processor of the very data we're trying not to hold. EU AI Act compliance for prompt content is better handled in the client before it reaches the router. Not ruling it out forever, but it's not on the roadmap.

VickyXAI avatar Aug 04 '26 04:08 VickyXAI