Calendar Icon White
June 29, 2023
Clock Icon
 min read

Data security in Large Language Models

Learn how to protect LLMs PII and Privacy Risks

Data security in Large Language Models
Calendar Icon White
June 29, 2023
Clock Icon
 min read

Data security in Large Language Models

Learn how to protect LLMs PII and Privacy Risks


As we venture deeper into the age of digital transformation, artificial intelligence (AI) systems, particularly Large Language Models (LLMs), have carved out a crucial role in various sectors, ranging from customer service to decision-making processes. However, amidst the excitement of such progress, security and privacy challenges come to the fore. As software engineers and application developers, how can we leverage the power of LLMs while also ensuring the protection of sensitive information?

Data Loss prevention for LLM: Redacting Sensitive Data

At Strac, we are at the forefront of creating secure interactions with AI systems. We offer a cutting-edge solution to safeguard data, a vital aspect when working with any AI models, including LLMs. Our APIs have been crafted to detect and replace sensitive information within any text or attachments, thus providing an extra layer of security. This includes a nifty tool that functions as an outbound proxy with redaction capabilities.

Our solution is engineered to send any HTTP request (POST, PUT, PATCH, GET, DELETE, and OPTIONS) to a third-party service with sensitive data replaced by redacted, non-sensitive equivalents. This allows the seamless usage of third-party services like LLMs without compromising the original information's security and privacy.

An Overview of Redaction Process: How Does It Work?

Let's take a closer look at how this process functions. As developers, it's vital to comprehend the underlying mechanics of the technologies we employ. Here is a sample code snippet that illustrates the redaction process:

curl --location --request <your verb> '' \
   --header 'X-Api-Key: <your API key>' \
   --header 'Content-Type: application/json' \
   --header 'Target-Url: <third-party endpoint>'
   --data-raw '{
       "bankdata": {
           "ip_address": ""
       "citizenship": "US",
           "date_of_birth": "1980-02-22",
           "email_address": "",
           "first_name": "George",
           "last_name": "Washington",
           "phone_number": "2025551111",
           "physical_address": {
           "street_line_1": "1600 Pennsylvania Ave",
               "city": "Washington",
               "state": "DC",
               "postal_code": "20500"
       "tin": "153-23-4323"

This request involves replacing sensitive data with redacted, non-sensitive equivalents before sending it to the third-party service. The sensitive fields in this example, such as "emailaddress", "firstname", and "last_name", will be replaced with redacted information, thus securing the original data. You can replace with any of the below options:

1. Tokenization

Tokenization is a security strategy that substitutes sensitive information with an arbitrary and unique reference known as a token. For example, consider a Social Security Number (SSN) like "123-45-6789". In a tokenized system, this could be replaced with a token, such as "tkn_S7aDg65KjS", that has no intrinsic value or relevance outside the specific security ecosystem.

2. Format-Preserving Pseudonyms

This refers to the creation of fictitious identifiers that, while originating from sensitive data, uphold the original data's format and length. To illustrate, the phone number "555-123-4567" might be changed to "555-987-6543", or a postal code "90210" can be substituted with "10011".

3. Masking

Masking is a technique that discloses only certain parts of data, replacing the rest with characters such as '*' or 'X'. For instance, a bank account number "1234567890" could be masked as "XXXXXX7890" or "12XXXXXX90", keeping only certain digits visible.

Benefits of Using DLP for LLM: Putting Security First

As we navigate through the intricacies of AI systems, the security of sensitive information is paramount. Employing a security-first approach comes with an array of benefits.

1. Prevention of Data Leaks

With sensitive information replaced by redacted equivalents, the possibility of data leaks is drastically reduced. This ensures that your data remains secure throughout its journey.

2. Compliance with Regulations

Our redaction process assists in complying with various data protection regulations, including GDPR, HIPAA, and CCPA. This secures your data and saves you from potential legal complications.

3. Maintaining User Trust

By securing user data, you uphold users' trust in your services. This can enhance your reputation and ultimately improve customer retention and loyalty.

Closing Thoughts

With the ever-growing influence of AI, particularly Large Language Models, it's crucial to secure and protect sensitive data. Our cutting-edge solution for redacting sensitive data before an LLM processes it does just that, providing an excellent means to secure your application without compromising the functionality these advanced models offer.

In the digital age, privacy and security are not just essential but indispensable. As developers, let's stride towards building applications that not only deliver remarkable features but also uphold the security and trust of our users.

For more details on how you can integrate our APIs into your software applications, feel free to book a meeting or explore our comprehensive developer documentation. Let's build a more secure future together, one application at a time!

Founder, Strac. ex-Amazon Payments Infrastructure (Widget, API, Security) Builder for 11 years.

Latest articles

Browse all