agentscope-ai / agentscope-ai/agentscope

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

Open
#1,712 1 comment 0 reactions 0 assignees View on GitHub
stale-issue
Dominant language
Python
Stars
31.5k
Forks
3.5k
Avg merge
1d 23h
Merged PRs (30d)
95

Description

Context

AgentScope 2.0 processes user-generated text and passes it directly to LLMs via tool calls, memory, and multi-agent message hubs. That text frequently contains PII — emails, phone numbers, national IDs, API keys, financial data — traveling unsanitized through the pipeline.
With EU AI Act enforcement on August 2, 2026 (65 days), Articles 12, 13, and 26 require audit trails for automated decision-making. Agents processing personal data without a verifiable sanitization layer create compliance liability for every developer using AgentScope in production.
Proposed solution
A pre-LLM sanitization hook in the agent message pipeline — one integration point that covers all LLM calls across the framework:
pythonfrom agentscope.agent import Agent

class PrivacyAgent(Agent):
async def before_llm_call(self, text: str) -> str:
response = await httpx.AsyncClient().post(
"https://api.trustboost.dev/sanitize",
json={
"text": text,
"tx_hash": "TRIAL",
"wallet_address": "agentscope-agent",
"context": "general" # or legal/financial/medical/code
},
timeout=30
)
return response.json()["data"]["sanitized_content"]
TrustBoost implements this layer and is architecturally compatible with AgentScope:

MCP native: https://api.trustboost.dev/mcp — already integrates with AgentScope's MCP support
A2A conformant: conformance: true at a2aregistry.org
8 languages: EN, ES-LATAM (RFC/CUIT), PT-BR (CPF/CNPJ), DE (Personalausweis), JA (マイナンバー), FR (NIR), IT (Codice Fiscale), KO (RRN)
5 context modes: general / legal / financial / medical / code
F1=1.000 across all 8 languages
Proof of Sanitization anchored on Solana — verifiable audit trail for EU AI Act
50 free sanitizations with tx_hash=TRIAL

Why this matters for AgentScope specifically

AgentScope's multi-agent message hub passes messages between agents in plaintext. Each hop is a potential PII leak — especially in pipelines processing user data across jurisdictions (GDPR, LGPD, APPI, CCPA).
The integration point is minimal — a single hook before every LLM call. The audit trail it generates covers the compliance requirements that enforcement begins enforcing in 65 days.
API: https://api.trustboost.dev
Source: https://github.com/teodorofodocrispin-cmyk/trustboost-api
Agent Card: https://api.trustboost.dev/.well-known/agent-card.json

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.