@sedata-ai/mcp exposes two layers for keeping sensitive data out of spans:
enableArgumentCollection: false(the default) — tool arguments are never written to span attributes.dataProcessors— full control over every attribute set before export.
The default is safe
Turning on argument collection
If you really want to see arguments in traces (e.g. for an internal tool chain), turn it on explicitly:mcp.request.argument.<key> attribute.
Custom redaction with dataProcessors
Data processors run on every attribute set before export. They’re the right
hook for “scrub anything that looks like email/phone/card.”
What about the safety check?
safetyCheck writes the original content under
mcp.safety_check.content so analysts can debug what was flagged. If you’d
rather hash it:
Verify your redaction
Easiest way: switch to console exporter and run a few representative calls.What enablePIISanitization does today
config.enablePIISanitization defaults to true and is reserved as a hook
for built-in sanitization patterns. The current build leaves the actual
matching to your own dataProcessors — keep yours wired even if you set
enablePIISanitization: true.
Next
Data processors
The full processor API and ordering rules.
Tracing reference
Every attribute the package writes.