How do I keep card numbers away from the LLM in a voice agent?
Take card capture out of the conversation. Detect the moment with a small classifier, capture the digits with deterministic code or keypad entry, send them straight to the payment system, and give the language model only a placeholder. Then redact every transcript line as a second net, pause the recording, and keep the value out of logs and after-call processing.
- PCI guidance: sensitive authentication data must not be stored after authorization, even if encrypted.
- PCI DSS Requirement 3.3.1 covers card security codes in audio recordings, per the council's FAQ.
- A voice agent can leak a card in six places: transcript, prompt, tool calls, logs, recording and after-call work.
- The language model only needs a placeholder such as the last four digits.
- Test by searching every store for a test card number after a call.
This post describes engineering practice. It is not legal or compliance advice. Your PCI obligations are decided with your acquirer and your assessor.
What counts as card data?
The PCI Security Standards Council splits payment card account data into two groups in its guidance on protecting telephone-based payment card data.
| Group | What it includes | Rule in short |
|---|---|---|
| Cardholder data | The card number, cardholder name, expiration date, service code | May be stored only if protected |
| Sensitive authentication data | The card security code, full track data, PINs | Must not be stored after authorization, even if encrypted |
A caller who reads out a card number and then the three digits on the back has just spoken both kinds.
What does PCI say about phone calls and recordings?
The same guidance is direct about recordings. Sensitive authentication data "must not be stored after authorization, even if encrypted." The council's FAQ on audio recordings says that keeping a card security code in any digital audio recording after authorization violates PCI DSS Requirement 3.3.1, that every effort must be made to prevent the data from being recorded, and that where technology exists to suppress or redact audio during data entry, it should be enabled.
Two more points from the guidance matter for a voice agent.
- Recordings that hold a spoken card number are in scope. A recording of a verbal transmission of cardholder data must be stored and secured in line with PCI DSS.
- Logs count too. The guidance tells teams to ensure that systems such as an IVR do not output cardholder data in any logs.
The guidance was written in 2018 for call centers with human agents and IVRs. It does not mention language models. The principles carry over anyway: an AI agent is one more system that hears the card.
Where does a card number leak in a voice agent?
A human agent has two places to leak a number: the recording and the notepad. A voice agent has more.
- The live transcript. Speech to text turns the spoken digits into text within a second.
- The prompt. The transcript is appended to the conversation and sent to the language model on every later turn.
- Tool calls. If the model is asked to pass the number to a payment tool, the number is now in the model's output as well.
- Logs and traces. Request logs, debug lines and tracing systems copy prompts and tool arguments by default.
- The recording. The caller's audio channel holds the digits as speech, or as keypad tones.
- After-call work. The recording is transcribed a second time and the text is sent to another model for a summary.
Each of these is a separate system, often run by a separate vendor. Removing the number from one does nothing for the others.
How do I keep the number away from the model?
The reliable pattern is to take card capture out of the conversation entirely. The model runs the call up to the moment of payment, a narrow component captures the card, and the model resumes with a placeholder.
- Detect the moment. Use a small classifier, not the language model, to answer one question about each thing the caller says: is this a card number being read? A classifier runs on the transcript before it joins the conversation.
- Capture with code, not with a prompt. Parse the digits with deterministic code that can repair split groups, run a checksum and identify the card brand. Keypad entry avoids speech altogether, and the PCI guidance discusses masking or suppressing keypad tones so they are not heard or recorded downstream.
- Send the number straight to the payment system. The component that captured it calls the processor. The language model never needs it.
- Give the model a placeholder. What joins the conversation is a token such as "card number, ending 4417, verified". The model can confirm the last four digits with the caller without ever holding the full number.
- Redact before the prompt, as a second net. A redaction pass on every transcript line catches numbers spoken outside the capture step, such as a caller who starts reading a card unprompted.
- Pause or mute the recording. Stop recording the caller's channel while the card is spoken and resume after. The PCI guidance notes that a properly implemented pause-and-resume solution could take the recording and storage systems out of scope, though not the other systems on the call.
- Keep it out of logs. Log the fact that a card was captured, never the value. Check your tracing system as well as your application logs.
- Repeat it after the call. The second transcription and the summary need the same redaction as the live path.
How do I know it works?
Test it the way an attacker or an auditor would.
- Make test calls that read a card at the expected moment, at an unexpected moment, slowly, in two halves, and with a correction in the middle.
- Search every store for the test number afterwards: the prompt log, the trace system, the transcript table, the recording and the after-call summary.
- Count what the classifier missed and what it flagged wrongly. A missed card is a leak. A false alarm is a caller interrupted for nothing. Track both.
- Run the search on a schedule, not once. A new log line added next month can undo all of it.
Does this take my systems out of PCI scope?
Not by itself. Which systems are in scope depends on where account data is stored, processed or transmitted in your environment, and that is settled with your acquirer and assessor. What this design does is shrink the list of systems that ever touch a card number, which is the outcome the guidance asks for: every possible effort to eliminate sensitive authentication data from the telephone environment.
Where does Agent Operators fit?
Agent Operators puts every request through a gateway that redacts card and account numbers before any model, caps spend and records each request, and it serves small decision models for questions such as whether a caller is reading a card. It is in invite-only early access, built and run by Nanobots Inc., which is SOC 2 compliant.
Questions
Does PCI DSS apply to an AI voice agent?
If the agent's systems store, process or transmit card data, they are in the same position as any other telephone payment system. Confirm your scope with your acquirer and assessor. This is not compliance advice.
Can I just tell the model not to repeat card numbers?
No. An instruction does not remove the number from the prompt, the provider's request, your logs or the recording. The number has to be kept out before the model is called.
Is pausing the call recording enough?
It protects the recording only. The PCI guidance notes that pause-and-resume can take recording and storage systems out of scope but not the other systems on the call.
Should callers type the card on the keypad instead?
Keypad entry avoids speech to text entirely. The tones still need masking or suppression so they are not recorded or passed downstream.
Sources
Reading this with an AI assistant? The same post as plain text: /blog/keep-card-numbers-away-from-llm.md