@juspay/neurolink
Version:
Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio
26 lines (25 loc) • 860 B
JavaScript
/**
* Safe metadata filtering for observability exporters.
*
* Only these attribute keys are forwarded to third-party backends as trace
* metadata. User prompts (input), LLM responses (output), error stacks, and
* any other potentially sensitive data are excluded to prevent PII leaks.
*/
// Only ai.* keys are forwarded as metadata. Stream metrics (chunk_count,
// content_length) should be accessed via span attributes directly, not via
// metadata sent to third-party backends.
export const SAFE_METADATA_KEYS = new Set([
"ai.provider",
"ai.model",
"ai.temperature",
"ai.max_tokens",
]);
export function filterSafeMetadata(attributes) {
const filtered = {};
for (const key of SAFE_METADATA_KEYS) {
if (attributes[key] !== undefined) {
filtered[key] = attributes[key];
}
}
return filtered;
}