为AI支付协议x402设计隐私保护中间件,自动清除敏感信息
Hardening x402: PII-Safe Agentic Payments via Pre-Execution Metadata Filtering
- 在支付请求发送前拦截并过滤元数据中的个人身份信息
- 在2000条合成数据上实现0.894的F1值和97.2%精度
- 适合关注隐私安全的AI支付系统开发者使用
通过x402协议支付资源的AI代理会在每个HTTP支付请求中嵌入支付元数据——资源链接、描述和原因字符串。这些元数据在链上结算前被发送至支付服务器和中心化协调器API,双方通常无数据处理协议约束。本文提出presidio-hardened-x402,首个开源中间件,在传输前拦截x402支付请求,检测并擦除个人身份信息(PII),执行声明式支出策略,并阻止重复重放攻击。为评估PII过滤器,构建了一个包含2000个元数据三元组的标注合成语料库,覆盖七类使用场景,并在两种检测模式(正则、NLP)与五个置信度阈值下进行42种配置的精确率/召回率测试。推荐配置(模式=NLP,最小得分=0.4,所有实体类型)达到微平均F1值0.894,精确率0.972,99%分位延迟5.73毫秒,远低于50毫秒开销预算。中间件、语料库及全部实验代码已公开于https://github.com/presidio-v/presidio-hardened-x402。
原文摘要 · Abstract (English)
AI agents that pay for resources via the x402 protocol embed payment metadata - resource URLs, descriptions, and reason strings - in every HTTP payment request. This metadata is transmitted to the payment server and to the centralised facilitator API before any on-chain settlement occurs; neither party is typically bound by a data processing agreement. We present presidio-hardened-x402, the first open-source middleware that intercepts x402 payment requests before transmission to detect and redact personally identifiable information (PII), enforce declarative spending policies, and block duplicate replay attempts. To evaluate the PII filter, we construct a labeled synthetic corpus of 2,000 x402 metadata triples spanning seven use-case categories, and run a 42-configuration precision/recall sweep across two detection modes (regex, NLP) and five confidence thresholds. The recommended configuration (mode=nlp, min_score=0.4, all entity types) achieves micro-F1 = 0.894 with precision 0.972, at a p99 latency of 5.73ms - well within the 50ms overhead budget. The middleware, corpus, and all experiment code are publicly available at https://github.com/presidio-v/presidio-hardened-x402.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。