Evalgent
Back to Blog
Voice AI Testing

Voice Agent PII Redaction in Logs and Traces: Where to Mask

Deepesh Jayal
11 min read
Voice Agent PII Redaction in Logs and Traces: Where to Mask
On this page
A trace log line where a caller's spoken details are masked but the call ID and turn number stay readable, so the line can still be joined

A caller says their name, street and card number out loud. Your agent hears it, thinks about it and answers. Meanwhile your telemetry quietly writes it into a transcript, a span attribute, a debug log and a tool-call argument. Weeks later someone opens a trace to debug a slow turn and finds the card number.

Voice agent PII redaction is the work of stopping that copy from landing in the systems your engineers use every day. This post is about where in the pipeline to do it, and how to redact PII voice agent logs and traces without losing the data you debug with. It covers four places to mask, the trade-offs of each, and how to keep the data useful for debugging. It ends with a six-step rollout and a way to test it.

One scope note. Our guide to detecting PII leakage in voice agents is about the agent itself: what it says back, what speech-to-text hears and what it passes to tools. This post is about the telemetry and log copy. It assumes you already know which fields you log on each call and asks what to do to those fields before they are stored. It is written for the team that built and runs its own voice agent and now owns the logs.

PII in transcripts and other voice data

PII in transcripts looks like PII in a web form, plus extras. The difference is that the data arrives as speech, then moves through several text forms.

Kind of dataWhere it lands in telemetryWhy voice makes it harder
NamesTranscripts, span attributes, tool argumentsSpelled out letter by letter, or misheard as a common word
Phone numbers and account numbersTranscripts, room or session names, logsSpoken in chunks across several turns
AddressesTranscripts, tool argumentsFree-form, with no fixed shape to match
Card numbers read aloudTranscripts, tool arguments, TTS input logsDigits split across turns, or confirmed back by the agent
Health detailsTranscripts, summaries, LLM contextSaid in ordinary sentences, so nothing looks like an ID
Voice itselfRecordingsCannot be masked out of the audio by hiding a few words

Typed data is usually a field with a name. You can mask a field called email. Spoken data is a sentence. "My number is four one five, then two two two" is not a field. It has to be recognised as a number first, and only then masked.

Spoken digits and spelled-out values are the hard cases. A caller says "double seven" or reads a name letter by letter. The speech-to-text system may write words, digits, or a mix. A mask that only knows one written form misses the others. We do not publish pattern lists here, because they are the wrong thing to copy. The point is to treat spoken forms as a first-class test case, not an afterthought.

The same value also shows up more than once. The transcript has it. The language model context has it. A tool call has it in a clean, tidy argument. A summary written after the call may have it too. Redaction that fixes one copy and leaves the rest is the most common failure. Our tool-calling test cases cover the argument side of that problem.

Four places to mask, and what each one costs

There are four points where you can act. They run in order from the agent outward.

Four masking points on the path from the voice agent to the person reading a trace: source, collector, storage and viewer, with exposure shrinking at each step
WhereWhat it protectsMain strengthMain weakness
At the source (in the agent)Everything downstream, including vendorsRaw PII never leaves the processYou must change agent code, and one missed path leaks
In a collector or processorEverything after the collectorOne place to enforce policy across servicesData has already left the agent and crossed your network
At the storage layerData at rest and its exportsCentral, and auditableThe raw value was already ingested
At the viewerWhat a person sees on screenEasy to roll out, supports role-based viewsThe raw value still sits in the database

At the source

Masking in the agent is the strongest option. If the value is never emitted, no later layer can leak it. You choose what goes onto a span, what goes into a log line and what goes into a tool-call record.

The cost is effort and coverage. Voice agent PII redaction at the source means changing agent code. Every code path that writes telemetry needs the same rule. A new framework version may add new attributes you did not review. A fallback speech-to-text path may log differently from the main one. One missed path is enough.

Tracing tools sometimes give you a hook for this. Langfuse documents a masking function that runs in the SDK to redact data before it is sent. Its docs also note that masking affects only spans exported by that client, and that collector-side masking "happens after telemetry leaves the application." That is the trade-off in one sentence.

In a collector or processor

A collector sits between your agents and your backends. It is a good place to enforce a policy once, for every service that sends it data. It is also a safety net for the source layer, because it catches what a developer forgot.

OpenTelemetry's Collector documentation describes processors this way: they "take the data collected by receivers and modify or transform it before sending it to the exporters," and that can include "filtering, dropping, renaming, or recalculating telemetry" (Collector configuration). Order matters. The page says the order of processors in a pipeline "determines the order of the processing operations." Configuring a processor does not enable it either. You must list it in a pipeline.

The weakness is timing. By the time data reaches the collector, it has already left the agent. It crossed a network and may have been logged on the way. Treat the collector as the second line, not the first.

At the storage layer

Masking when data is written, or when it is exported, helps you control the stored copy. It suits cases where you cannot change the senders, such as a vendor that pushes data to you. It also suits audit needs, because one place applies one policy.

The weakness is that the raw value has already arrived. Anything between the sender and the store, such as queues, buffers and error logs, saw it. Storage controls also need their own care: who can read the original, and how backups and exports behave.

At the viewer

Masking in the interface decides what a person sees. A support engineer sees a masked value. A small group sees more, and their access is logged. This is the easiest layer to roll out and the weakest on its own. The raw value still exists in the database. Anyone who can query it directly, export it or read a backup bypasses the viewer.

Use the viewer for role-based access and audit trails. Do not use it as your only control.

Redaction in the OpenTelemetry Collector: what the docs say

Two Collector processors matter when you mask PII in traces and logs. We cite only what their pages state, as read on November 19, 2026. Check the current docs before you depend on them.

The redaction processor works on span, log and metric datapoint attributes. Its README describes an allowed-keys list: only attributes on the list are retained. It also describes blocked values, where regex matches in values are masked. And it describes an option to turn the allow list off. The README lists its stability as beta for traces and alpha for logs and metrics.

That "allow list" design is a useful idea in its own right. Instead of hunting for bad values, you decide which attributes are allowed at all. Everything else is dropped. For voice data, that is a safer default than trying to list everything sensitive.

The transform processor modifies telemetry using the OpenTelemetry Transformation Language. You give it statements per signal, and it runs them in order. Its README lists traces, metrics and logs as beta. Its basic example masks a password in a command-line attribute. That shows the idea: you can rewrite or remove a value you know is risky, as long as you know where it sits.

OpenTelemetry's own guidance on handling sensitive data adds two limits. First, OpenTelemetry "can't determine what data is sensitive in your specific context on its own." You decide. Second, it tells you to follow data minimisation when you collect telemetry. A processor cannot fix a decision to log everything.

Two cautions follow from the docs, not from us. A pattern-based mask only catches what its patterns describe, which is a problem for spoken forms. And a processor only sees what you send it. Free text in a log message or a span name may need its own handling, so test it rather than assume.

Masking vs tokenising vs dropping

You have three tools. Choose per field, not per system. Tokenisation needs the most care.

ToolWhat it doesUse it whenCost
MaskReplaces the value with a placeholderA human reads the line and needs the shapeLoses the value for matching
TokeniseReplaces the value with a stable stand-inYou need to link events about the same person or valueThe token map is itself sensitive, so protect it
DropRemoves the field entirelyNothing downstream needs itLoses debugging detail
The same spoken name shown after masking, tokenising and dropping, with a note on which treatment still lets you link calls from the same person

The principle behind all three is data minimisation. GDPR Article 5(1)(c) says personal data must be "adequate, relevant and limited to what is necessary in relation to the purposes for which they are processed" (GDPR Art. 5). Article 5(1)(e) adds that data should be kept in identifiable form "for no longer than is necessary." Article 32(1)(a) names "the pseudonymisation and encryption of personal data" as an example of a security measure (GDPR Art. 32). This is not legal advice. Whether and how these rules apply to your calls is a question for your counsel.

NIST's guide on protecting PII makes a similar point in plain language. If PII "serves no current business purpose, then the PII should no longer be used or collected" (NIST SP 800-122, section 4.2.1). It also notes that partial identifiers, such as a few digits of a longer number, can still count as PII. So a "last four" is not automatically safe in every context.

A practical rule: drop first, tokenise second, mask third. If a debugging question never needs the value, drop it. If it needs to know "same person, different call," tokenise. If a human needs to see that something was there, mask.

Keep the call ID when masking

Redaction can wreck debugging if it removes the join key that ties your data together. A trace is useful because the telemetry record, the log lines, the tool calls and the recording share one call ID. Our observability primer calls this the join. Mask the caller, not the call.

Good join keys are internal identifiers that carry no personal meaning: call ID, turn number, span ID, agent version, tenant ID. Keep them in the clear.

Watch the identifiers that look harmless but are not. Room names, session names and file names are common leaks. If a name is built from a caller's phone number, every log line about that session contains PII. Fix the naming scheme at the source. Use a random call ID instead.

For people-level analysis, such as "does this caller keep failing at the same step," use a token. A stable stand-in lets you count repeat callers without storing who they are. Keep the mapping in a separate, tightly controlled place. Our span model post shows where these IDs sit in a trace.

How to roll out voice agent PII redaction in six steps

This voice agent PII redaction rollout works for a small team. Do the steps in order.

1. Inventory every copy — List each place a call's data is written: speech-to-text output, language model context, tool-call arguments, span attributes, app logs, summaries, recordings and vendor dashboards. Include the vendors you send data to. You cannot protect a copy you have not found.

2. Classify fields by need — For each field, decide if debugging needs it, needs a token, needs only its shape, or does not need it at all. Write the decision down. Most fields end up as drop or mask.

3. Fix identifiers first — Replace phone-number-based room and session names with random call IDs. Keep a clean set of join keys. This is cheap and removes a whole class of leaks.

4. Redact at the source — Apply drop, tokenise or mask rules in the agent where telemetry is written. Prefer an allow list of fields over a block list of values. Cover spoken forms, not just typed ones.

5. Add a collector safety net — Put a processor in front of your backends that enforces the same allow list. Check its order in the pipeline. Treat anything it catches as a bug to fix at the source.

6. Lock down storage and viewers — Restrict who can read raw data, log every access, set a retention period you can defend and review it on a schedule. Then test the whole chain, as the next section shows.

If you are short on time, steps 3 and 4 give the most protection per hour.

Test that redaction holds: seeded canary calls

Do not trust a redaction rule because it looks right. Test it with a method, not a guess.

The method is simple. Create fake personal data, a set of "canary" values that mean nothing and cannot belong to a real person. Run test calls where a simulated caller says them. Then search every place data is stored and assert that no canary appears.

Choose canary values that are awkward on purpose. Include a name, an address, a phone number and a card-like number, each unique enough to search for. Have the caller say each one several ways: plainly, in chunks across turns, spelled out, and corrected mid-sentence. Include one the agent will read back. Add a health detail in an ordinary sentence.

Seeded canary call test flow: seed fake PII, place test calls, sweep every stored surface, then pass if no canary is found and the call ID remains

Then sweep every surface from your inventory in step 1. Check transcripts, span attributes, log lines, tool-call records, summaries, vendor dashboards and any export. Search for the plain value and its spoken and chunked forms.

# Simplified sketch. You supply the surfaces and variant generator.
def assert_no_canary_in_storage(call_id, canaries, surfaces):
    leaks = []
    for surface in surfaces:                 # e.g. traces, logs, transcripts
        text = surface.fetch(call_id)        # everything stored for this call
        for label, value in canaries.items():
            for variant in spoken_and_written_forms(value):
                if variant in normalise(text):
                    leaks.append((surface.name, label))
    assert not leaks, f"PII reached storage: {leaks}"

Two details make this useful. First, run it after every framework upgrade, prompt change and new instrumentation. Redaction rots when code changes. Second, assert the positive too: confirm the call ID and turn numbers are still present. Redaction that deletes your join keys is also a failure.

This is a test method, not a benchmark. It tells you whether your own pipeline leaks, not how any tool performs in general. For recordings, the same idea applies: seed the audio, run your process, then check the output.

Where Evalgent fits

Evalgent's Observe and Monitor products take call data from your stack in OpenTelemetry format and an upload path. They never sit in the media path, so nothing touches live audio. On privacy, the headline is this: personal data is masked on arrival, there is a metrics-only mode, access is logged, you control retention, and you choose the data region.

That does not replace redaction at your source. We would still tell a team to drop what it does not need before sending anything anywhere. Evalgent's production monitoring also flags PII leakage in calls, which is the agent-side problem covered in the leak detection guide. Evalgent works with teams to set this up for their first agent.

For consent and recording rules that sit beside this topic, see our post on recording consent for AI voice agents. For the wider picture, read the observability buyer's checklist and the guide to OpenTelemetry for voice agents. For what to do when redaction misses, see voice agent alerting.

Frequently asked questions

Where to redact PII in voice agent logs?

Redact at the source first, because a value never emitted cannot leak. Add a collector or processor as a second line, then restrict storage and viewers. No single layer is enough. Each later layer catches what an earlier one missed, and each adds access control and audit rather than replacing the earlier masking.

Can I mask PII in OpenTelemetry traces with the Collector?

Yes. The Collector's redaction and transform processors can drop, mask or rewrite attributes before export, per their READMEs. They only act on data you send them, and patterns only catch what they describe. Treat the Collector as a safety net behind source-level masking, and test it with seeded values.

How do I redact PII from call transcripts?

Treat spoken forms as the main case. Digits may be written as words, digits or a mix, and names may be spelled out. Redact before the transcript is stored or copied, and check every copy, including model context and summaries. Verify with fake values said several ways.

What is the difference between masking, tokenising and dropping?

Masking replaces a value with a placeholder. Tokenising replaces it with a stable stand-in so you can link events. Dropping removes the field. Drop what debugging does not need, tokenise what you must join on, and mask what a person must see exists. A token map needs its own protection.

Should I keep the call ID when I mask PII?

Yes. Keep internal identifiers with no personal meaning, such as call ID, turn number and span ID. They let you join traces, logs and recordings. Remove identifiers built from personal data, like session names that contain a phone number, and replace them with random IDs.

How do I test that PII redaction works?

Use seeded canary calls. Make up fake personal values, have a test caller say them in several ways, then search every stored surface for any trace of them. Run the check after each upgrade or prompt change. Also confirm the join keys survive, since over-redaction breaks debugging.

Is a last-four digits mask safe?

Not always. NIST's PII guide notes that partial identifiers, such as the first or last few digits of a number, are often still considered PII. Whether a partial value is acceptable depends on the rule that applies to you and the purpose. Ask counsel, and drop it if nothing needs it.

Does redacting text also redact the recording?

No. Text redaction changes transcripts and logs, not the audio. A recording keeps the caller's voice and any spoken details unless you handle it separately. Treat recordings as their own surface with their own access, retention and testing, and do not assume the transcript rule covers them.

The bottom line

Voice agent PII redaction works when you mask early, add a safety net later, and test the whole chain with fake data. Keep the call ID, drop what nobody needs, and treat every copy of a spoken value as a leak until a seeded call proves otherwise.

Related Articles