Card Data and AI Models: What Should Never Reach the Model

Card Data and AI Models: What Should Never Reach the Model

Which card and payment data must never reach an AI model, and how to hand billing to a payment provider so the agent never sees sensitive details.

•

Want to apply this in your company?

Book a call with Juan →

Full card numbers, security codes, passwords and authentication data should never be sent to an AI model, whether it is a support assistant, an agent on WhatsApp or an analytics system. The practical rule is to separate the conversation about billing from the processing of the payment: the agent handles the dialogue, while a specialized provider receives and processes the data and returns to your system only a status or a link. This separation applies to any model, including those running inside your own company.

Key takeaways

  • Full card number, security code and expiry date never enter a prompt, log, spreadsheet or conversation history.
  • Passwords, PINs, confirmation codes and provider API keys stay out of any context the agent can access.
  • The agent receives only the billing status, such as paid, pending, overdue or declined, along with an order identifier.
  • The charge is created and paid in the provider's environment, and confirmation arrives through a signed webhook that you verify.
  • Refunds, cancellations and exceptions require recorded human approval, never a free decision by the model.

What should never reach a model

It helps to separate three groups of information. The first is what PCI DSS, the security standard for the card industry, restricts from being stored after authorization, such as the security code and magnetic stripe data. The second is what your company does not need in order to bill, such as the full card number and any combination of data that would allow it to be rebuilt. The third is access credentials, which give power over systems, not just information about a customer.

In practice, the list includes:

  • Full card number, including when it appears in a photo of a receipt, a screenshot or an exported file.
  • Security code (CVV or CVC) and any expiry date tied to the card number.
  • Passwords, PINs, answers to authentication challenges and confirmation codes sent to the customer.
  • API keys, webhook secrets and access tokens for the payment gateway.
  • Complete bank details of third parties, such as branch and account numbers, when the case does not require them.
  • Raw payment notification payloads saved in logs or conversation databases.

Why the model does not need this data

A language model is not a payment processor. Anything that enters its context can be repeated in a reply, copied into logs, stored in observability tools or exposed through malicious instructions hidden inside another message. OWASP, in its list of risks for applications built on LLMs, treats sensitive information disclosure and prompt injection as separate problems, and both show up often in support flows.

So the useful question is not whether the model is safe, but whether that piece of data must be in context for the agent to complete the task. Usually the answer is no. The necessity principle in Brazil's LGPD points the same way: collect and use only what is indispensable for the purpose. If the difference between what a model does and what people expect from it still feels abstract, see ChatGPT Superintelligence? What It Is and What It Is Not.

How to delegate billing without exposing the data

The safest pattern is to let the payment provider handle everything sensitive while the agent handles the conversation. The steps usually look like this:

  • The system asks the gateway to create a charge with an amount, a description and an order identifier, and receives back a payment link or a hosted checkout.
  • The agent sends the customer only that link, with no card data or credentials in the text.
  • The customer enters card details on the provider's page, outside the conversation.
  • Confirmation arrives by webhook, and the system verifies the notification signature before updating the order.
  • The agent has read-only access to the order status, never to the full transaction content.
  • Charge creation calls use an idempotency key, so a rerun of the flow does not generate duplicate charges.

Stripe's documentation describes two of these mechanisms, webhook signature verification and idempotency, as standard integration practices. The same reasoning applies to other gateways used in Brazil, as long as they offer equivalent features. With Pix, the agent can tell the customer that the charge was generated and deliver the code or link the provider produced, without assembling the receiving key by hand in free text.

Checklist before connecting an agent to billing

Before opening the flow to customers, confirm the points below with the people who run operations and with whoever is accountable for finance:

  • Prompts, examples and the knowledge base have been reviewed and contain no real card data.
  • Logs, transcripts and metrics are configured to mask sensitive fields.
  • The billing lookup tool returns only status and identifier, never the full payload.
  • Refunds, discounts and cancellations require human approval, with a record of who approved and when.
  • A prompt injection test tries to extract payment data from the conversation, and the test fails as expected.
  • The procedure for a customer who sends card data in the chat is written down and has been tested.
  • Internal policy defines who can access conversation logs and how long they are kept.

The AI tool usage policy is usually the document that gathers these points. A practical guide is Company Policy for Employee ChatGPT Use: What to Allow and Ban.

Illustrative scenario: monthly fee collection on WhatsApp

Illustrative scenario: a recurring services company wants the agent to remind a customer about an overdue monthly fee and resend the payment link. The agent identifies the customer by the registered phone number, checks the invoice status in the billing system, sends the link generated by the provider and logs the conversation. If the customer asks for a discount or an extension, the agent does not decide. It opens a request for the finance team and tells the customer when to expect an answer.

If the customer types a card number into the chat, the agent does not repeat the digits, does not confirm anything based on them, and guides the customer not to send payment details there. The conversation goes to human review, and the log records only the fact that a sensitive message was received, without its content. Active messages such as a due-date reminder depend on approved templates and prior customer permission, as covered in WhatsApp Outbound Messages: Templates, Opt-In and Best Practices.

How we apply the method in this kind of project

In our method, the work starts by mapping the current process and a baseline. In billing, that means finding where payment data enters today: forms, screenshots sent to the service group, reconciliation spreadsheets and system exports. This survey often reveals exposure points the team does not remember.

Then we limit data and actions to the minimum required, pilot a single real flow with logs and a success metric agreed in advance, and transfer the operation with a clear decision: expand, adjust or stop. Once the operation is running, periodic review of logs, permissions and flows becomes part of routine work, not a one-time event.

If an automated decision affects the customer, for example by denying a discount or a refund, also check the review rights set out in the LGPD, explained in LGPD Automated Decision-Making: The Right to Review (Art. 20).

Frequently asked questions

Can the agent confirm a purchase using the card details? No. Confirmation should come from the provider through a verified webhook, and the agent should receive only the final order status. That way the model never needs any card data to tell the customer the payment was approved.

Does showing only the last digits of the card solve the problem? It reduces exposure, but the model does not need those digits to complete the task. If the customer needs to recognize the card, that happens on the provider's page, and the agent should work with the order status and identifier only.

Does a model installed inside the company eliminate this risk? It reduces exposure to third parties, but it does not remove leaks through badly configured logs, prompt injection or improper employee access. The rule of minimizing data in context still applies, wherever the model runs.

Does the LGPD require something specific for payments made with AI? The LGPD requires purpose, necessity and security in processing personal data, and it provides for review of automated decisions that affect the data subject. The details depend on each operation, so confirm your reading with the company's legal counsel and follow guidance from the ANPD.

Sources

AI agentspayment securityPCI DSSWhatsApp billingLGPD