How Companies Like Shopify Protect Sensitive Customer Data at Scale
As applications grow, customer data moves across APIs, microservices, analytics platforms, logs, third-party services, and AI systems. Learn how principles like tokenization, data vaulting, and data minimization can help reduce the spread of sensitive data and protect customer information at scale.
By Securelytix

At small scale, protecting customer data can seem simple: secure the database, restrict access, encrypt sensitive information, and monitor your APIs.
At scale, it becomes a very different problem.
Customer data can move through APIs, microservices, payment systems, analytics platforms, logs, third-party services, and increasingly, AI systems. The more systems involved, the harder it becomes to control where sensitive data goes and who actually needs access to it.
That raises a more important question than “Is our database secure?”
It is: “Which systems actually need access to the real customer data?”
When applications operate at high volume, protecting the database alone isn't enough. Sensitive data needs protection throughout its journey, not just while it is stored.
An email address or phone number is a simple example. One service may need the actual value, while another may only need a reference to the customer. Giving both systems the raw value creates unnecessary exposure.
A stronger approach is to minimize where sensitive data exists in the first place.
Techniques such as tokenization, data vaulting, access controls, and runtime protection allow applications to work with protected references instead of raw sensitive values.
This becomes even more important as AI enters the application stack. Customer data can now flow through LLM prompts, agent context, tool calls, RAG pipelines, and third-party AI services.
The goal isn't to stop data from moving. It's to make sure sensitive data only reaches the systems that actually need it.
So, what can modern applications learn from companies operating at Shopify's scale, and how can these principles be applied without building an enormous security infrastructure from scratch?

The Real Challenge: Data Doesn't Stay in One Place
The biggest challenge isn't storing sensitive data. It's everything that happens after the data enters the application.
A modern application rarely operates as a single system. Customer information can pass between services for authentication, payments, order processing, notifications, analytics, customer support, and reporting.
Each service may have a legitimate reason to process the request. But that doesn't mean each service needs access to the original sensitive value.
This distinction matters.
An application may need a customer's email address to send a notification. An analytics service may only need to know that an email was associated with the transaction. A logging system may need the request for debugging, but it shouldn't need the customer's actual email address or phone number.
Yet without data-level controls, the same raw payload can end up flowing through all of them.
That creates what we can think of as a data exposure chain.
The database may be properly encrypted. APIs may use authentication. Infrastructure may be protected. But sensitive information can still appear in application logs, traces, analytics systems, debugging tools, third-party services, or downstream APIs.
And once the data has been copied into multiple systems, protecting it becomes considerably harder.
This is why large-scale data security isn't only about controlling who can access a system. It is also about controlling what data that system receives in the first place.
The principle is simple:
If a service doesn't need the real value, don't give it the real value.
Instead, sensitive information can be replaced with a token or other safe reference before it moves downstream. Authorized systems can work with the reference, while the original value remains protected in a dedicated vault.
This approach reduces the number of places where raw sensitive data exists—and therefore reduces the number of places that need to be trusted with it.
That becomes especially important when applications start connecting to AI models and external tools, where sensitive data can otherwise leave the application's immediate security boundary.

Tokenization: Protect the Data Without Breaking the Application
So, what do you do when an application needs to use sensitive data, but every service doesn't need to see the real value?
One common answer is tokenization.
The idea is pretty simple.
Instead of sending the actual customer email, phone number, or other sensitive value through every part of the application, the sensitive value is replaced with a token.
For example:

The application can continue passing that token around. The original value stays protected in a secure vault.
This doesn't mean the application suddenly has to be rewritten from scratch.
A payment service, for example, might receive a token instead of the customer's actual card or personal information. A downstream service can use the token to refer to the customer without needing access to the underlying value.
When the real value is genuinely required, an authorized service can request it from the vault.
That creates an important separation:
The application can work with the reference without constantly carrying the sensitive data.
This becomes particularly useful in large systems where the same data can otherwise end up in multiple places.
Think about everything that can touch a customer request: application services, logs, analytics, background jobs, support systems, and external APIs. The fewer of those systems that receive the original value, the smaller the exposure surface becomes.
There is another advantage that often gets overlooked.
Tokenization doesn't just protect data at rest. It can help reduce exposure while data is moving through the application.
That matters because some of the most difficult data leaks aren't caused by someone breaking into the primary database. They happen because sensitive information was copied somewhere it shouldn't have been a log file, a debugging trace, an API request, or a third-party service.
The important part is getting the protection in place before the data starts spreading.
And this is where modern data vaults fit into the architecture. Instead of asking every application and service to independently protect sensitive values, a dedicated vault can handle the mapping between the original value and its token.
The rest of the application can continue doing what it already does.
Same workflows. Less raw data moving around. Fewer systems that need to be trusted with it.
What Changes When AI Enters the Data Flow?
The data security problem gets more complicated once AI becomes part of the application.
A traditional application might send customer data from one service to another. An AI-powered application can send that same data into prompts, context windows, RAG pipelines, agent workflows, tool calls, logs, and external AI services.
And unlike a normal API call, an AI workflow can involve several steps before a task is completed.
For example, imagine a support agent that needs to answer a customer's question. It may retrieve the customer's account details, look up an order, check an internal knowledge base, and then send the relevant information to an LLM to generate a response.
The agent may only need a few pieces of information to complete the task.
But if the entire customer record is passed into the model's context, the application has already exposed more data than necessary.
This is where the principle of data minimization becomes important.
Don't give an AI system access to everything simply because it might be useful.
Give it what it needs for the specific task.
The same idea applies to AI tools and external APIs. If an agent needs to call a service, there is a big difference between giving that service a customer's real phone number and giving it a protected reference that can be resolved only when there is a legitimate reason to do so.
This also changes how developers need to think about logs.
AI systems generate plenty of operational data prompts, responses, traces, tool calls, and debugging information. If raw PII is present in those flows, it can quickly become difficult to know where copies of that information exist.
That's why protecting sensitive data before it enters the AI workflow is becoming an important architectural pattern.
The model can still perform its job.
The agent can still call tools.
The application can still retrieve information.
But sensitive values don't have to travel through every part of that workflow in their original form.
For teams building AI applications, this is an important shift in thinking:
Don't just ask what the AI is allowed to do. Ask what data the AI actually needs to see.
That distinction can make a significant difference as AI moves from simple chat interfaces into production systems that interact with real customer data.

Building a Data Protection Layer
Tokenization works best when it is treated as part of the application architecture rather than another security tool sitting on the side.
The basic flow is straightforward.
A request enters the application with sensitive information. Before that information is passed to downstream systems, the sensitive fields are identified and replaced with tokens. The application then continues working with those tokens.
When an authorized operation actually needs the original value, the application can request it from the vault.
In simple terms:
Raw data → Tokenize → Application / APIs / AI → Detokenize when authorized
The important part is that the vault doesn't need to become the application's database. Its job is to protect the relationship between the token and the original value.
For example, an application may receive:
Email: john@example.comPhone: +91 9876543210
After tokenization, downstream services could receive:
Email: tok_email_82f91Phone: tok_phone_41ac7
Those services can continue processing the request without carrying the original values.
The vault keeps the mapping securely and controls when the original value can be returned.
This also gives teams a cleaner way to think about authorization.
Not every service that can access a token should automatically be able to retrieve the underlying data. Access to the original value can be limited to specific operations and trusted parts of the application.
That creates another useful boundary:
Access to the application doesn't automatically mean access to the data.
For larger systems, this separation becomes even more important. Different teams and services may have different responsibilities, but they don't necessarily need the same level of access to customer information.
There is also an operational side to this architecture.
A protection layer needs to provide visibility into what is happening—what operations are being performed, what types of sensitive data are being protected, whether requests are succeeding, and whether the protection service is healthy.
This is where analytics and telemetry become useful. The goal isn't to expose the underlying customer information. It is to give teams enough visibility to understand whether protection is actually working.
A well-designed data protection layer therefore has three jobs:
- Protect sensitive values before they spread.
- Return original values only when an authorized operation requires them.
- Provide visibility into protection activity without exposing the protected data.
The architecture is simple by design.
The application keeps doing its job. The protection layer simply makes sure sensitive data doesn't have to follow the application everywhere it goes.
That becomes especially valuable as the number of APIs, services, AI workflows, and third-party integrations continues to grow.
Why This Matters More as a Company Grows
At a small scale, having a few services handle customer data may not seem like a major problem.
At enterprise scale, the numbers change quickly.
More customers mean more requests. More requests mean more services, integrations, logs, background jobs, and data pipelines. Every new connection creates another potential place where sensitive information can appear.
This is why reducing the spread of raw data becomes increasingly important as a company grows.
You don't necessarily need to prevent every system from accessing customer information. You need to be deliberate about which systems receive the real value and which systems can work with a protected reference instead.
That distinction can make security easier to manage.
Imagine an application with 20 internal services. If all 20 services receive raw customer information, every one of those services becomes part of the sensitive-data security boundary.
If only a few trusted services can access the original values while the rest work with tokens, the boundary becomes much smaller.
That can simplify several areas at once:
- Security: fewer systems need access to raw PII.
- Compliance: fewer locations contain sensitive information.
- Development: downstream services can work with tokens without handling customer data directly.
- Monitoring: teams have a clearer picture of where sensitive data can appear.
- Incident response: there are fewer places to investigate when something goes wrong.
It also changes the way teams approach new integrations.
When a new analytics platform, SaaS tool, API, or AI service is introduced, the question shouldn't simply be, “Can we securely connect it?”
A better question is:
“Does this system actually need the customer's real data?”
If the answer is no, there is little reason to send it.
This becomes particularly useful for AI applications. An agent may need to know that a customer exists, retrieve an order, or perform an operation without needing unrestricted access to the customer's underlying identity information.
The same principle works whether the destination is an internal microservice, an external API, or an AI model.
Protect the data first. Then decide where it needs to go.
That is the real advantage of a data-centric security approach. Instead of trying to build a perfect security boundary around every application component, organizations can reduce the amount of sensitive information moving through those components in the first place.
At scale, that difference matters.
Because securing fewer copies of sensitive data is usually easier than trying to secure every copy after it has already been created.
Conclusion
Protecting customer data at scale isn't about building walls around a single database. It's about controlling where sensitive data goes throughout the application.
Tokenization, data vaulting, least-privilege access, and runtime controls all help reduce unnecessary exposure while allowing applications to keep working normally.
The goal is simple: keep sensitive data protected by default, and only expose the real value when there is a clear reason to do so.
As applications become more distributed and AI becomes part of the stack, that principle will only become more important. The fewer systems that need to see raw customer data, the easier it becomes to secure, monitor, and protect it.
FAQ
Want to tokenize sensitive data before it reaches your AI stack?
Talk to Securelytix →