← Lab /AI/ML

PII filter for x402 payments achieves 0.894 F1 with 5.73 ms latency

The middleware can detect and redact PII in x402 payment metadata with micro-F1 0.894 and sub-6 ms overhead

AI/ML arXiv 13 Apr 2026 Method Prototype evidence

Published as “Hardening x402: PII-Safe Agentic Payments via Pre-Execution Metadata Filtering”

Why it matters

Deployers can achieve GDPR-compliant PII filtering with low latency, but must accept that about half of name data may still be exposed and that some benign fields will be redacted.

Summary

The recommended NLP configuration (mode=nlp, all entities, min_score=0.4) achieves micro-F1 = 0.894 with precision 0.972 and a p99 latency of 5.73 ms, comfortably under the 50 ms budget, and is the only setting that detects PERSON entities (recall 0.551). Regex mode has perfect precision on structural types but zero PERSON recall. The system is evaluated on a synthetic 2,000-sample corpus, and both latency and accuracy are reported across 42 configurations.

What they found 2

  1. NLP mode with all entities and min_score=0.4 yields micro-F1 0.894, precision 0.972, and p99 latency 5.73 ms.

    “micro-F1 = 0.894 with precision 0.972, at a p99 latency of 5.73 ms”

  2. PERSON entity recall is 0.000 for regex and 0.551 for NLP.

    “PERSON recall is 0.000 in regex mode and 0.551 in NLP mode.”

Caveats 3

  • PERSON recall of only 0.551 means roughly half of name-bearing tokens remain unredacted even with the best NLP configuration.
  • The NLP configuration produces 21 PERSON false positives, yielding precision 0.894 for PERSON entities.
  • The result is a recall ceiling of roughly 50% for PERSON in x402 metadata, where names disproportionately appear as URL path components.

What’s new here 3

  • First open-source middleware that intercepts x402 payment requests to filter PII, enforce spending policies, and block replay before on-chain settlement.
  • Provides a publicly released synthetic corpus of 2,000 labeled x402 metadata triples covering seven use-case categories.
  • Comprehensive 42-configuration sweep comparing regex and spaCy-based NLP detection across confidence thresholds, with latency characterization.