Skip to content

[FEATURE] Add Masking Function for Sensitive Data Before set_attribute #1033

@jjayp4rk

Description

@jjayp4rk

Problem Statement

Currently, when using set_attribute with Langfuse integration in strands-agent, there's no built-in mechanism to mask sensitive data before it's logged or traced. This creates potential security and privacy concerns when dealing with:

  • API keys and credentials
  • PII (Personally Identifiable Information)
  • Customer data
  • Internal system information
  • Other sensitive attributes

Proposed Solution

Add a mask() function (or similar masking utility) that can be called before set_attribute() to automatically mask or redact sensitive information. This would provide a standardized, secure way to handle sensitive data in agent attributes.

Use Case

  1. Langfuse Tracing: Mask sensitive data before it's sent to Langfuse for observability
  2. Debugging: Allow developers to debug with realistic data shapes without exposing actual values
  3. Compliance: Meet security and privacy requirements (GDPR, SOC2, etc.)

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions