Trace Masking Functions
Users can mask keywords and regex patterns using custom Python functions
While RagaAI Catalyst sits on-prem for complete data security, enterprises might want to redact certain information, keywords, or patterns from their traces logged on the system. This can be done using custom Python functions as follows:
Prerequisites
Users need to define the relevant platform keys and Tracer object as usual:
Defining Custom Masking Functions
Users can define their custom Python logic to replace certain keywords with a redaction phrase as shown below:
Enabling Masking Function
Lastly, users can pass the desired masking function (limited to one) to the initialized Tracer object using the
register_masking_function
method as follows:
Running Your Application
Your RAG application can be defined further as usual. Any LLM calls should be traced with the above masking logic applied.
Last updated
Was this helpful?