<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sean Falconer</title>
    <description>The latest articles on DEV Community by Sean Falconer (@seanfalconer).</description>
    <link>https://dev.to/seanfalconer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1150362%2F92cc6f5c-896c-41dc-a30c-27cd908f0fcf.jpg</url>
      <title>DEV Community: Sean Falconer</title>
      <link>https://dev.to/seanfalconer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/seanfalconer"/>
    <language>en</language>
    <item>
      <title>Solving The Austin Problem with a Data Privacy Vault</title>
      <dc:creator>Sean Falconer</dc:creator>
      <pubDate>Thu, 01 Feb 2024 00:26:20 +0000</pubDate>
      <link>https://dev.to/aws-builders/solving-the-austin-problem-with-a-data-privacy-vault-4d1g</link>
      <guid>https://dev.to/aws-builders/solving-the-austin-problem-with-a-data-privacy-vault-4d1g</guid>
      <description>&lt;p&gt;Data anonymization and tokenization play a crucial role in safeguarding sensitive information. Traditional tokenization systems, however, encounter significant limitations that hinder their effectiveness, breaking certain workflows and complicating security. This blog post delves into the "Austin Problem" – a challenge arising from traditional tokenization systems – and explores how Skyflow's data privacy vault addresses these issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Data Anonymization and Tokenization
&lt;/h2&gt;

&lt;p&gt;Tokenization is a non-algorithmic approach to data anonymization that swaps sensitive data for tokens. For example, if you tokenize a customer’s name, like “John”, it gets replaced by an obfuscated (or tokenized) string like “A12KTX”. Because there’s no mathematical relationship between “John” and “A12KTX”, even if someone has the tokenized data, they can’t get the original data from tokenized data without access to the tokenization process. &lt;/p&gt;

&lt;p&gt;A common form of tokenization is PCI tokenization, whereby credit card data is replaced with randomly generated tokens. &lt;/p&gt;

&lt;p&gt;As an example, when integrating with a payment service provider (PSP) like Stripe, Adyen, or Braintree, your card acceptance flow will look something like what’s shown below. &lt;/p&gt;

&lt;p&gt;The front end SDK will collect the credit card information and pass that along to the issuing bank. Once the card is validated and authorized, the gateway or PSP will store the card and pass back a token as a stand-in for the card. You can safely store the token in your backend and be free from PCI compliance. The only thing you care about is the token and that’s enough for you to do everything you need to do with the credit card when relying on the PSP’s SDKs and APIs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcsc5s8n6ex9d75og1jco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcsc5s8n6ex9d75og1jco.png" width="800" height="89"&gt;&lt;/a&gt;&lt;br&gt;PCI Tokenization for card acceptance.
  &lt;/p&gt;

&lt;p&gt;But tokenization isn’t limited to credit card data; it can anonymize various types of sensitive information, such as names, addresses, social security numbers, and more. The inverse process of tokenization, called detokenization, retrieves the original data from tokens using a token map.&lt;/p&gt;

&lt;p&gt;Before we get into the limitations of this approach, let’s take a look at how traditional tokenization systems work.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Traditional Tokenization Works
&lt;/h2&gt;

&lt;p&gt;Conceptually, tokenization is fairly simple, swap sensitive data for a non-sensitive randomly generated value and keep track of the mapping from sensitive to non-sensitive values and vice versa. From an implementation standpoint, here's how these systems typically work:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Generation&lt;/strong&gt;: When sensitive data needs to be protected, such as a customer's name, a tokenization system generates a random or pseudo-random token, which is a unique alphanumeric string like "A12KTX."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Map&lt;/strong&gt;: The system maintains a token map or token dictionary, functioning similarly to a hash table. This map associates each original data value (e.g., "John") with its corresponding token (e.g., "A12KTX"). This mapping is stored securely.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Replacement&lt;/strong&gt;: The sensitive data, such as "John," is replaced with its corresponding token, "A12KTX," before it is stored or transmitted. This tokenized data is what gets used in databases, applications, or during data exchanges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Detokenization&lt;/strong&gt;: When the original data needs to be retrieved, a process called detokenization is used. To detokenize data, the system looks up the token in the token map and retrieves the corresponding original value. Only authorized users or processes with access to the tokenization system can perform detokenization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;: Traditional tokenization systems emphasize the absence of a mathematical relationship between the original data and the token. This means that even if someone gains access to the tokenized data, they cannot reverse-engineer it to obtain the original information without the tokenization process and access to the token map.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Protection of Original Data&lt;/strong&gt;: Since the original data is never stored alongside the tokenized data and is only retrievable through the token map, even if the environment containing the tokenized data is breached, the original data remains secure and uncompromised.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp51getdum75fqnopsl45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp51getdum75fqnopsl45.png" width="800" height="323"&gt;&lt;/a&gt;&lt;br&gt;Example of a traditional tokenization system&lt;br&gt;
.
  &lt;/p&gt;

&lt;p&gt;AWS has a &lt;a href="https://aws.amazon.com/blogs/compute/building-a-serverless-tokenization-solution-to-mask-sensitive-data/"&gt;great article&lt;/a&gt; going through in detail how to create such a system. But even a seemingly simple system has a lot going on under the covers that you would need to build and maintain as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos2xp286b033u2bmjg32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fos2xp286b033u2bmjg32.png" width="800" height="410"&gt;&lt;/a&gt;&lt;br&gt;AWS serverless tokenization solution.
  &lt;/p&gt;

&lt;h3&gt;
  
  
  Limitations of Traditional Tokenization Systems
&lt;/h3&gt;

&lt;p&gt;Traditional tokenization systems suffer from three major limitations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Overload&lt;/strong&gt;: In these systems, mapping a given input string to a token can lead to issues, as it may result in token collisions. This can break analytics and clean room workflows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Limited Security Model for Detokenization&lt;/strong&gt;: Users or processes often have broad permissions for detokenization, which poses security risks and lacks granularity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Choice Between Tokenization and Encryption&lt;/strong&gt;: Traditional tokenization systems typically do not integrate encryption, limiting their security capabilities.&lt;/p&gt;

&lt;p&gt;Let’s take a closer look at each of these problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Austin Problem: Token Overload
&lt;/h3&gt;

&lt;p&gt;To support analytics use cases with tokenization, the same input value needs to generate the same tokenized output value. This is known as consistent or deterministic tokenization. With consistent tokenization, I will always know that the city “San Francisco” will be tokenized the same way. This approach keeps query operations like &lt;code&gt;counts&lt;/code&gt;, &lt;code&gt;group bys&lt;/code&gt;, and &lt;code&gt;joins&lt;/code&gt; intact.&lt;/p&gt;

&lt;p&gt;However, with traditional tokenization, there’s no disambiguation between different types of input. The token map doesn’t know that a particular string represents a city, state, name or any other information. This naive approach can lead to undesirable effects and is the manifestation of what I call The Austin Problem.&lt;/p&gt;

&lt;p&gt;The Austin Problem occurs when the same input string generates the same token value for two different distinct types of data For instance, if a customer's first name is "Austin" and another customer lives in the city of Austin, Texas, their name and city would yield the same token (see the image below).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg89hezqcyeba7f6t5r8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg89hezqcyeba7f6t5r8x.png" width="800" height="292"&gt;&lt;/a&gt;&lt;br&gt;Pictural representation of the Austin Problem.
  &lt;/p&gt;

&lt;p&gt;Not being able to disambiguate the data type when going from token to original value can cause incorrect analytical calculations and confusion depending on the design of your analytics store.&lt;/p&gt;

&lt;p&gt;Additionally, this simplistic approach complicates adhering to privacy requirements like data subject requests (DSAR) and the right to be forgotten (RTBF) that are a feature of many privacy regulations like GDPR and CCPA.&lt;/p&gt;

&lt;p&gt;For example, let’s say you get a RTBF from a customer named ‘Austin’. If you have only one customer named 'Austin.', ideally, you would delete the mapping from 'Austin' to the token value in the Token Store, rendering any tokens stored in your downstream services invalid. However, this becomes challenging if you also need to retain the token mapping for customers residing in the city of Austin, Texas. Consequently, what initially appeared as a straightforward compliance action turns into a manual project to ensure analytics continuity for customers in that city.&lt;/p&gt;

&lt;p&gt;Similar to the challenges with analytics, clean rooms where the data has been tokenized by both parties can also be problematic. A clean room depends on being able to perform join operation between two or more parties within a secure isolated environment. Depending on how the data is stored by the businesses, not being able to know the difference between something like a person’s name and a person’s city could lead to miscalculations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limited Security Model for Detokenization
&lt;/h3&gt;

&lt;p&gt;Traditional tokenization systems lack fine-grained access control over detokenization permissions and output. This makes it challenging to cater to various use cases and data types. &lt;/p&gt;

&lt;p&gt;For example, a marketer might only need partial access to a customer's date of birth, while the customer should see their full date of birth.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2lk4q23vl1vre79o1nd3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2lk4q23vl1vre79o1nd3.png" width="800" height="249"&gt;&lt;/a&gt;&lt;br&gt;Detokenization Based on the Identity of the Requestor.
  &lt;/p&gt;

&lt;p&gt;Even if you can add some additional magic to control access to who can detokenize data based on their identity, since the token map has no knowledge of the datatype, they’re all just strings, applying data masking based on identity gets complicated.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Choice Between Tokenization and Encryption
&lt;/h3&gt;

&lt;p&gt;Tokenization offers a unique advantage to encryption: it severs any mathematical link between the original data and the generated tokens. In contrast, encryption processes can potentially be reverse-engineered. Additionally, tokens provide practical benefits when it comes to searchability and analytics, as they don't require decryption for use. However, what we really need is a combination of these techniques.&lt;/p&gt;

&lt;p&gt;In traditional tokenization, data encryption operates as a distinct system, and the process of detokenization involves bringing the data back to its original plaintext form. If data masking is necessary, it is applied in real-time to the plaintext data. The separation of encryption, detokenization, and masking within traditional tokenization systems introduces potential vulnerabilities at each integration point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solving the Austin Problem
&lt;/h2&gt;

&lt;p&gt;The key to solving the Austin Problem requires a more sophisticated approach that brings what has been historically siloed and independent systems together like tokenization, access control, data masking, and encryption. Additionally, we need to re-think traditional tokenization to expand its functionality to address some of the outlined limitations.&lt;/p&gt;

&lt;p&gt;Skyflow is a &lt;a href="https://www.skyflow.com/post/what-is-a-data-privacy-vault"&gt;data privacy vault&lt;/a&gt; that isolates, protects, and governs sensitive customer data. With Skyflow, the vault supports a new more advanced tokenization called schema-based tokenization. &lt;/p&gt;

&lt;p&gt;With schema-based tokenization, instead of relying on a single token map where tokens regardless of data type get intermixed, we can define a schema the same way we would for a database, and each column has its own self-contained tokenization map and tokenization scheme.&lt;/p&gt;

&lt;p&gt;Each column within the schema can define its own custom format rules, allowing you to generate any kind of token. In the example image below, you can see the settings for a format-preserving consistently generated token for a credit card number, and also a consistently generated token in the form of a UUID for a cardholder name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhxp3uisx6mz0hw04kog8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhxp3uisx6mz0hw04kog8.png" width="800" height="442"&gt;&lt;/a&gt;&lt;br&gt;Configuring token types in Skyflow.
  &lt;/p&gt;

&lt;p&gt;Skyflow supports a variety of sophisticated tokenization techniques, like transient tokenization for temporary storage. These are essentially self-destructing tokens for ephemeral data.&lt;/p&gt;

&lt;p&gt;Additional enhancements include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Type Awareness&lt;/strong&gt;: Skyflow's system understands the data type of input, allowing for customized tokenization. Each column within the schema can define its tokenization rules, accommodating various data types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Column Groups&lt;/strong&gt;: To prevent token overload, Skyflow supports column groups, similar to namespaces in programming. This feature restricts deterministic tokenization to specific columns, ensuring tokens remain unique even when dealing with similar input values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fine-Grained Access Control&lt;/strong&gt;: Skyflow's data governance engine offers fine-grained policy-based access control, extending to the detokenization process. This enables control over who can access what data, how it's accessed, and its format.&lt;/p&gt;

&lt;p&gt;For example, in the image below, the same data is shown in two different ways depending on the role of the viewer. The Customer Support role not only has restrictions on the columns, but also for specific rows.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbvk6mldpnv3rgbem2i9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbvk6mldpnv3rgbem2i9.png" width="800" height="279"&gt;&lt;/a&gt;&lt;br&gt;Example of two different views of vault data based on different policies.
  &lt;/p&gt;

&lt;p&gt;An example policy for customer support is shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ALLOW READ ON payments.name, payments.state WITH REDACTION = PLAIN_TEXT WHERE payments.state = Arizona

ALLOW READ ON payments.ssn WITH REDACTION = MASKED WHERE payments.state = Arizona
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple policies control how data can be viewed and by whom, making tokenization and access control not isolated disconnected features, but all part of the same system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integration of Tokenization and Encryption&lt;/strong&gt;: Even with the enhancements available through schema-based tokenization, there are still workflows that can’t be fully supported. Similarly, encryption is great, but typically requires decrypting the data in order to perform operations like search. &lt;/p&gt;

&lt;p&gt;Skyflow solves this with &lt;a href="https://www.skyflow.com/post/a-look-at-polymorphic-encryption-the-new-paradigm-of-data-privacy"&gt;polymorphic data encryption&lt;/a&gt;, a unique approach that fully supports operations on encrypted data. For example you could query your vault to calculate the total number of customers that are over the age of 21 in the state of California without ever decrypting the data.&lt;/p&gt;

&lt;p&gt;Skyflow seamlessly integrates tokenization, encryption, data masking, and access control, enhancing security while preserving data usability. This combination ensures data remains protected throughout its lifecycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;The Austin Problem highlights one of several limitations with traditional tokenization systems, which hampers analytics workflows and makes adhering to certain privacy requirements like DSARs and RTBF extremely difficult. &lt;/p&gt;

&lt;p&gt;Skyflow’s data privacy vault technology addresses these challenges by providing data type awareness, column groups, fine-grained access control, and integrated advanced tokenization and encryption. This approach not only enhances security but also preserves data usability, a tradeoff that companies have historically had to make. Polymorphic data encryption balances the need for security while keeping the data usable for any workflow you might perform with sensitive customer data.&lt;/p&gt;

</description>
      <category>tokenization</category>
      <category>data</category>
      <category>privacy</category>
      <category>compliance</category>
    </item>
    <item>
      <title>Adding a Privacy Layer to AWS PartyRock</title>
      <dc:creator>Sean Falconer</dc:creator>
      <pubDate>Tue, 28 Nov 2023 19:03:08 +0000</pubDate>
      <link>https://dev.to/aws-builders/adding-a-privacy-layer-to-aws-partyrock-ici</link>
      <guid>https://dev.to/aws-builders/adding-a-privacy-layer-to-aws-partyrock-ici</guid>
      <description>&lt;p&gt;AWS recently unveiled &lt;a href="https://partyrock.aws/" rel="noopener noreferrer"&gt;PartyRock&lt;/a&gt; – an Amazon Bedrock Playground. PartyRock lets users leverage foundation models from Amazon and other leading AI companies in an intuitive and code-free playground to quickly create AI-powered applications that can handle an array of specialized tasks. &lt;/p&gt;

&lt;p&gt;Whether you need to orchestrate your &lt;a href="https://partyrock.aws/u/lockhead/rpZ8z9kG5/re%3AInvent-2023-DevTools-and-CICD-Attendees-Guide" rel="noopener noreferrer"&gt;re:Invent schedule&lt;/a&gt;, optimize &lt;a href="https://partyrock.aws/u/unicorn/bja6APUEF/Sparkle-Launch%3A-Your-Magical-Marketing-Assistant" rel="noopener noreferrer"&gt;marketing strategies&lt;/a&gt;, or develop a &lt;a href="https://partyrock.aws/u/AM/6JY3bch4s/Diabetes-Diet-Assistant" rel="noopener noreferrer"&gt;diabetes-management diet planner&lt;/a&gt;, PartyRock is an amazing tool for transforming ideas into applications with minimal effort.&lt;/p&gt;

&lt;p&gt;However, while the excitement surrounding PartyRock and the capabilities of generative AI is well-founded, it’s important to be mindful of data privacy concerns. The lack of a “delete” button for AI models raises substantial &lt;a href="https://stackoverflow.blog/2023/10/23/privacy-in-the-age-of-generative-ai/" rel="noopener noreferrer"&gt;privacy and security concerns&lt;/a&gt;, because if users reveal sensitive data to an AI model, it can’t be deleted the same way you can delete a row from a relational database. &lt;/p&gt;

&lt;p&gt;Consider, for example, a &lt;a href="https://partyrock.aws/u/amruta/4XriZ0yTU/Contracts-assistant" rel="noopener noreferrer"&gt;contract analysis assistant&lt;/a&gt; application operating on PartyRock. While this application proves invaluable in parsing complex contracts and extracting pertinent information, you need to put privacy measures in place to use this application because many contracts inevitably contain confidential data. Sharing such sensitive information with the underlying AI model presents a significant privacy risk.&lt;/p&gt;

&lt;p&gt;So, how can you use Personally Identifiable Information (PII) in AI-driven applications?&lt;/p&gt;

&lt;p&gt;To navigate the potential privacy limitations of any AI-based application it’s imperative that we add a data privacy layer to limit PII exposure. To demonstrate this, we built a Chrome Extension to protect unintended PII sharing with apps built on PartyRock. The data privacy layer leverages &lt;a href="https://www.skyflow.com/product/llm-privacy-vault" rel="noopener noreferrer"&gt;Skyflow LLM Privacy Vault&lt;/a&gt;. Using Skyflow, the extension detects and de-identifies PII so that PartyRock's models remain fully functional without compromising the privacy of sensitive details. The video below shows the complete functionality.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/WANLP5bq4QI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In this blog post, I’ll show how to create a privacy-preserving Chrome Extension. I’ll also share insights on how you can leverage the functionality offered by PartyRock, or any other AI model, while using a data privacy vault to protect sensitive data and safeguard user data privacy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Skyflow LLM Privacy Vault?
&lt;/h2&gt;

&lt;p&gt;Skyflow LLM Privacy Vault is a technology that’s purpose-built to isolate, protect, and govern sensitive customer data seamlessly throughout the lifecycle of LLMs. It’s not limited to working strictly with Amazon Bedrock – you can use Skyflow LLM Privacy Vault with any LLM, including a public model, a fine-tuned foundation model like those provided by PartyRock, or your own custom model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Privacy During Model Training
&lt;/h3&gt;

&lt;p&gt;Whether you’re constructing foundation models, fine-tuning models, or developing Retrieval Augmented Generation (RAG) models, the privacy vault works like a privacy firewall or a data transformation layer. It &lt;a href="https://www.skyflow.com/post/generative-ai-data-privacy-skyflow-llm-privacy-vault" rel="noopener noreferrer"&gt;detects and de-identifies sensitive data&lt;/a&gt; during collection and processing, regardless of whether the source data originates from a single source, or is compiled from multiple sources.&lt;/p&gt;

&lt;p&gt;The plaintext sensitive data that’s detected by Skyflow is stored in the vault and replaced by de-identified data. Then, LLM training can proceed as normal, with a de-identified and privacy-safe dataset.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70d11ey5lz1w9kad22g3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70d11ey5lz1w9kad22g3.png"&gt;&lt;/a&gt;&lt;br&gt;Using a privacy vault for privacy-preserving model training.
  &lt;/p&gt;

&lt;h3&gt;
  
  
  Privacy in Inference
&lt;/h3&gt;

&lt;p&gt;Users interact with AI models in a variety of different ways, with the most popular one being a front-end UI like the ones used by PartyRock applications. Users can also upload files to AI models. In both cases, these models use inference to collect data that users provide to them, including sensitive data – unless that data is first de-identified.&lt;/p&gt;

&lt;p&gt;Using a privacy vault, sensitive data isn’t just de-identified; it's securely stored. All sensitive customer data (and even core IP) is kept out of LLMs entirely. This data can only be re-identified by authorized users. This approach preserves data privacy during inference when AI models provide responses because PII is protected by fine-grained access controls. These controls restrict who can see what data, when, where, and for how long.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzawnvyv73i7477rzcdz3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzawnvyv73i7477rzcdz3.png"&gt;&lt;/a&gt;&lt;br&gt;Using a privacy vault for privacy-preserving inference.
  &lt;/p&gt;

&lt;h3&gt;
  
  
  Detect and De-identify PII
&lt;/h3&gt;

&lt;p&gt;So, how does this work, and how can you add a privacy vault to any PartyRock application? &lt;/p&gt;

&lt;p&gt;The first step is to detect sensitive data, including PII, from a dataset. The same approach is applied to model training datasets, and to any data supplied by a user during inference.&lt;/p&gt;

&lt;p&gt;To detect PII, Skyflow provides a detect API endpoint that can accept text or files. This endpoint automatically identifies hundreds of forms of PII, and returns a privacy-safe version of the input where each piece of detected PII is replaced by vault-generated tokens. Note that vault-generated tokens are distinct from the LLM-generated tokens that are used to chunk and process information within AI models.&lt;/p&gt;

&lt;p&gt;In the sample API call below, I’m calling the detect API with a sentence containing a name and phone number. When working with an LLM, either in training or inference, I typically don’t want to share these details or any other PII.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -s -X POST "https://manage.skyflowapis.com/v1/detect" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{
    "vault_id": "t6dadfbc3f4d4cdfbf12bb38b694b144",
    "data": {
        "blob": "Hi, my name is Sean Falconer and my phone number is 123-456-7890.",
        "send_back_entities": true
     }
}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This API call returns a response like the following example, where name and phone number are detected and replaced by vault-generated tokens. The context of each of these entities –  my name and my phone number – remains intact, which is all the LLM needs to draw context for training and inference.&lt;/p&gt;

&lt;p&gt;In this example, the name is replaced by a token formatted as a UUID while the phone number is replaced by a format-preserving token that still resembles a phone number. You can generate tokens in a variety of formats depending on your use case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "processed_text": "Hi, my name is NAME:576a5b26-5cca-4cdc-b409-ea2c39b53f21 and my phone number is PHONE:(765) 978-2342."
    "entities": [
        {
            "processed_text": "NAME:576a5b26-5cca-4cdc-b409-ea2c39b53f21",
            "text": "Sean Falconer",
            "location": {
                "stt_idx": "16",
                "end_idx": "28",
                "stt_idx_processed": "16",
                "end_idx_processed": "56"
            }
        },
        {
            "processed_text": "PHONE:(765) 978-2342",
            "text": "123-456-7890",
            "location": {
                "stt_idx": "53",
                "end_idx": "64",
                "stt_idx_processed": "81",
                "end_idx_processed": "100"    
            }
        }
    ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For end-to-end LLM data protection when creating or fine-tuning your own AI models, you would use the Skyflow detect API during both training and inference. For PartyRock applications, we can’t control the training process because we don’t have access to the backend service. However, we do have control over what gets shared during inference.&lt;/p&gt;

&lt;p&gt;In the following sections, we dive into how to build a Chrome Extension that uses Skyflow LLM Privacy Vault to carefully monitor what’s shared with PartyRock and filter out PII.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating a Chrome Extension
&lt;/h2&gt;

&lt;p&gt;Chrome Extensions are custom-built programs that enable users to customize the Chrome browsing experience. They are relatively simple to create.&lt;/p&gt;

&lt;p&gt;They consist of a &lt;a href="https://developer.chrome.com/docs/extensions/mv3/getstarted/development-basics/" rel="noopener noreferrer"&gt;manifest.json&lt;/a&gt; file that describes the extension’s capabilities and configuration. The manifest I created for my Skyflow extension is shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
 "manifest_version": 3,
 "name": "Skyflow",
 "version": "1.0",
 "description": "Prevent PII sharing with AWS PartyRock Apps",
 "icons": {
   "16": "images/skyflow-16.png",
   "32": "images/skyflow-32.png",
   "48": "images/skyflow-48.png",
   "128": "images/skyflow-128.png"
 },
 "content_scripts": [
   {
     "js": ["scripts/jquery-3.7.1.min.js", "scripts/detect-and-tokenize.js"],
     "run_at": "document_end",
     "matches": [
       "https://partyrock.aws/u/*"
     ]
   }
 ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The extension runs on any website matching the &lt;a href="https://partyrock.aws" rel="noopener noreferrer"&gt;https://partyrock.aws&lt;/a&gt; domain and u (i.e. user) route. It imports two Javascript files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;jQuery&lt;/code&gt;, which I’m using to help provide shorthand for some of the DOM manipulation and matching I need to monitor input and output from a PartyRock app&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;detect-and-tokenize.js&lt;/code&gt;, the main program that integrates with Skyflow to monitor inference data for PII&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Monitor, Detect, and De-identify PII
&lt;/h3&gt;

&lt;p&gt;To prevent potential sharing of PII with the model, we need to monitor an app’s input fields, capture the user input, and then use Skyflow to detect and remove PII. The de-identified version is then swapped into the user input fields and passed along to the model for inference.&lt;/p&gt;

&lt;p&gt;For example, in the image below, both areas that are boxed in red represent user input fields where PII might be intentionally or accidentally shared.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxonmi8qrk9u4rjg3ivt9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxonmi8qrk9u4rjg3ivt9.png"&gt;&lt;/a&gt;&lt;br&gt;Example PartyRock app highlighting the areas in red where a user might share PII.
  &lt;/p&gt;

&lt;p&gt;PartyRock apps load dynamically, so the input fields aren’t rendered until after the page loads. This means that in order to monitor user input, we need to wait for the page to load before attaching an input listener to the &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; element where users interact with an app.&lt;/p&gt;

&lt;p&gt;Once the page loads, for each &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt; input, we attach an input listener which is executed as a user types input. To avoid calling the Skyflow API on every keystroke, the &lt;code&gt;setTimeout&lt;/code&gt; function is used to delay each call by 500 milliseconds. If there’s new input by the user, the delayed call is cleared and a new one starts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;textarea&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;input&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tokenizePii&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;tokenizePii&lt;/code&gt; function takes the input field’s text value and calls an AWS Lambda function, which in turn calls the Skyflow detect endpoint, as shown in steps &lt;strong&gt;1&lt;/strong&gt; and &lt;strong&gt;2&lt;/strong&gt; below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5jeg3igapnhatd315cd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc5jeg3igapnhatd315cd.png"&gt;&lt;/a&gt;&lt;br&gt;Using a Chrome extension and Skyflow to provide end-to-end AI data privacy for PII.
  &lt;/p&gt;

&lt;p&gt;When we use an app like Contract Assistant with this Chrome Extension, PII contained within a contract is replaced by de-identified vault-tokenized values, as shown on the right side of the following illustration:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl6g8dmruek1zdbvhjhp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkl6g8dmruek1zdbvhjhp.png"&gt;&lt;/a&gt;&lt;br&gt;Plaintext PII in a contract is replaced with vault-tokenized values.
  &lt;/p&gt;

&lt;h3&gt;
  
  
  Monitor, Detect, and Re-identify PII
&lt;/h3&gt;

&lt;p&gt;Now that the ingress messages to the PartyRock backend are free of PII, responses coming back from the LLM may contain de-identified values, which is ideal for data privacy but could be puzzling for app users. So, the next step is to re-identify these de-identified values to provide authorized users with PII from the vault, subject to fine-grained access controls.&lt;/p&gt;

&lt;p&gt;To do this, we need our Chrome Extension to monitor the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element where responses are generated and automatically restore the de-identified values to the original values to give the user a readable, truly usable contract analysis application.&lt;/p&gt;

&lt;p&gt;I used the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver" rel="noopener noreferrer"&gt;MutationObserver&lt;/a&gt; interface to look for new child nodes being added to the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;, indicating the presence of new response data. Similar to the ingress logic shown above, I’m applying a delay of 500ms so that I can avoid excessive processing and only re-identify the response after it fully loads.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;childList&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Callback function to execute when mutations are observed&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;mutationCallback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mutationsList&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;mutation&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;mutationsList&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mutation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;childList&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nf"&gt;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="nx"&gt;responseText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;responseArea&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

      &lt;span class="nx"&gt;callback&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reIdentifyData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Create an observer instance linked to the callback function&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;observer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MutationObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mutationCallback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To re-identify any vault-tokenized values, we could use the Skyflow API to return these tokens with the original plaintext PII values, subject to fine-grained access controls. However, because this is an example application and this particular use case likely doesn’t require a very large amount of PII information, I’m caching the tokens and original values in this example Chrome Extension. &lt;/p&gt;

&lt;p&gt;This way re-identification is completely done client side, as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;reIdentifyData&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;originalString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;responseText&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
 &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;referenceObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;responseArea&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

 &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalString&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pii&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;tokenMap&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalString&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;modifiedString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;originalString&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;RegExp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gi&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;pii&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

       &lt;span class="nx"&gt;originalString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;modifiedString&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

       &lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;referenceObject&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;html&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
 &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course, caching PII in a Chrome Extension wouldn’t work for an industrial-grade version of this application. For that, we’d need to enhance this Chrome Extension to call Skyflow’s &lt;a href="https://docs.skyflow.com/record/#RecordService_Detokenize" rel="noopener noreferrer"&gt;detokenize API endpoint&lt;/a&gt;, allowing it to de-tokenize vault-generated tokens in contract assistant responses for multiple users – as governed by strict &lt;a href="https://www.skyflow.com/post/fine-grained-access-control-for-sensitive-data" rel="noopener noreferrer"&gt;fine-grained access controls&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;AWS PartyRock provides an exciting set of capabilities for anyone who wants to explore the world of AI application development. It’s exciting to see such a broad range of applications available to run on PartyRock less than two weeks after its release!&lt;/p&gt;

&lt;p&gt;But, to move AI applications that handle PII or other sensitive data beyond the proof–of-concept phase, it’s critically important to get a handle on data privacy. Using a Chrome Extension like the one shown here along with Skyflow LLM Privacy Vault enhances the privacy of PartyRock applications so you can harness the potential of Amazon Bedrock, or any LLM, without impacting data privacy. &lt;/p&gt;

&lt;p&gt;The best part is, this approach doesn’t impact the usefulness of PartyRock applications because PII de-identification is reversible – so the user experience is unaffected by keeping PII out of AI models.&lt;/p&gt;

&lt;p&gt;I hope you have a great time building privacy-preserving applications with PartyRock!&lt;/p&gt;

</description>
      <category>partyrock</category>
      <category>privacy</category>
      <category>security</category>
      <category>llms</category>
    </item>
    <item>
      <title>De-scoping Your AWS Services from Data Residency Requirements</title>
      <dc:creator>Sean Falconer</dc:creator>
      <pubDate>Mon, 25 Sep 2023 16:04:33 +0000</pubDate>
      <link>https://dev.to/aws-builders/de-scoping-your-aws-services-from-data-residency-requirements-7o</link>
      <guid>https://dev.to/aws-builders/de-scoping-your-aws-services-from-data-residency-requirements-7o</guid>
      <description>&lt;p&gt;From the widely recognized GDPR in Europe to Brazil's LGPD regulations, and the more recent introduction of India's DPDP law, over 100 countries now have some form of privacy regulation in place. What's common among many of these regulations is the concept of data residency – the physical location of your data. However, each region's requirements bring their own unique nuances, encompassing restrictions on data transfer, data storage locations, and individual data rights.&lt;/p&gt;

&lt;p&gt;Navigating this complex sphere of privacy regulations is a huge burden for many companies born in the cloud. Their data simply ends up everywhere, and tracking down the locations, adhering to local laws, and even storing and using it locally is enormously complex and expensive.&lt;/p&gt;

&lt;p&gt;Over the past year, I've engaged with numerous companies eager to expand their businesses into new markets, such as Europe and Australia. However, they've encountered a significant roadblock – the absence of a robust technology solution to address the data residency requirements of these regions. As a result, they face the expensive and nightmarish scenario of duplicating their cloud infrastructure for each new region, which not only hampers operational efficiency but also limits their data analyst and scientists from running analytics globally.&lt;/p&gt;

&lt;p&gt;In this blog post, I offer a solution to this pressing technology and business challenge by introducing a PII data privacy vault. This architectural approach to data privacy effectively removes the burden of data residency, compliance, and data security responsibilities from your infrastructure, providing a seamless path for global expansion and data management.&lt;/p&gt;

&lt;p&gt;Let’s dive in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Residency and Barriers to Expansion
&lt;/h2&gt;

&lt;p&gt;To grasp the intricacies of regulatory compliance in the context of global expansion, it’s important to understand a few key concepts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compliance
&lt;/h3&gt;

&lt;p&gt;Compliance denotes a business's adherence to the laws and regulations governing data privacy and protection. These regulations are contingent on the geographic location of the customer whose data is being collected. Ensuring compliance is imperative for legal reasons as it shields businesses from financial penalties, license revocations, and the erosion of customer trust.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Residency
&lt;/h3&gt;

&lt;p&gt;Data residency pertains to the physical location where customer data is stored. For instance, a website may serve customers in the EU, but their data could be hosted on a server located in Chicago. Different countries and regions have precise laws dictating how customer data should be handled, processed, stored, and safeguarded, making data residency a critical consideration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Varying Regulations
&lt;/h3&gt;

&lt;p&gt;The complexity surrounding data residency and compliance obligations primarily arises from the diversity of regulations worldwide. For instance, the European Union (EU) has &lt;a href="https://gdpr-info.eu/"&gt;GDPR&lt;/a&gt;, Brazil follows &lt;a href="https://www.dlapiperdataprotection.com/index.html?t=law&amp;amp;c=BR"&gt;LGPD&lt;/a&gt;, and the United States enforces a patchwork of state-specific laws like &lt;a href="https://oag.ca.gov/privacy/ccpa"&gt;CCPA&lt;/a&gt; in California and &lt;a href="https://portal.ct.gov/AG/Sections/Privacy/The-Connecticut-Data-Privacy-Act"&gt;CTDPA&lt;/a&gt; in Connecticut. These regulations diverge significantly in terms of their stipulations and penalties.&lt;/p&gt;

&lt;h3&gt;
  
  
  Barriers to Global Expansion
&lt;/h3&gt;

&lt;p&gt;The disparities in regulations and compliance requirements often pose formidable obstacles for companies striving to attain a global presence. Navigating diverse regulatory frameworks demands significant time, resources, and expertise. The resulting complexity frequently dissuades businesses from venturing into new markets, thereby constraining opportunities for global expansion.&lt;/p&gt;

&lt;p&gt;We’ve looked at the problem, now, let’s explore an approach to addressing these challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Data Privacy Vault?
&lt;/h2&gt;

&lt;p&gt;A &lt;a href="https://www.skyflow.com/post/what-is-a-data-privacy-vault"&gt;data privacy vault&lt;/a&gt; isolates, protects, and governs access to sensitive customer data. Within the vault, confidential information is securely stored, while abstract and non-sensitive tokens, serving as references, are retained in conventional cloud storage. This means that only non-sensitive tokenized data is accessible to other systems, ensuring the utmost protection and compliance.&lt;/p&gt;

&lt;p&gt;In a recent &lt;a href="https://www.computer.org/csdl/magazine/co/2022/10/09903879/1H0G8Iq3qDu"&gt;IEEE article&lt;/a&gt;, the authors made a case that this architectural approach to data privacy is the future of privacy engineering. Just as any modern system likely contains back end services, a database, and a warehouse, all modern systems need a data privacy vault to safely store, handle, and use of sensitive customer PII.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--u52ndrX6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzblx5jeeeeksf4isvwy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--u52ndrX6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzblx5jeeeeksf4isvwy.png" width="800" height="501"&gt;&lt;/a&gt;&lt;br&gt;Traditional PII management versus a data privacy vault (source: &lt;a href="https://www.computer.org/csdl/magazine/co/2022/10/09903879/1H0G8Iq3qDu"&gt;IEEE&lt;/a&gt;).
  &lt;/p&gt;

&lt;p&gt;Let's take a look at a specific example for a simple web application. In the image below, a phone number is being collected by a front-end application. For effective de-scoping, it’s ideal to initiate the de-identification process at the earliest stage in the data lifecycle. In this scenario, the phone number is stored directly within the vault during collection at the front end.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lqMUQq4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gz9hlm5wab48b82nwba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lqMUQq4a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gz9hlm5wab48b82nwba.png" width="800" height="231"&gt;&lt;/a&gt;&lt;br&gt;Example of vault architecture for collecting sensitive customer PII.
  &lt;/p&gt;

&lt;p&gt;Within the vault, the phone number, alongside any other personally identifiable information (PII), is stored within a robust and isolated environment, segregated from your organization's existing infrastructure. All downstream services, ranging from application databases to data warehouses, analytics platforms, and logging systems, interact solely with tokenized (de-identified) representations of the data. Queries against the PII for specialized operations or algorithmic operations against PII execute directly within the vault.&lt;/p&gt;

&lt;p&gt;Access to de-tokenize or re-identify data is controlled through a zero trust model. Policy-based rules control who sees what, when, where, and for how long on a row and column level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zTLfPLv6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0md5ni2i5mkbex583kas.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zTLfPLv6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0md5ni2i5mkbex583kas.png" width="800" height="242"&gt;&lt;/a&gt;&lt;br&gt;Controlling access to vault data based on who is requesting the data.
  &lt;/p&gt;

&lt;p&gt;The vault combines the principle of isolation, zero trust, privacy-enhancing technologies, and governance controls to insulate your systems from ever having to touch PII directly. This places your AWS components beyond the scope of regulatory compliance, assuring a higher level of data protection and adherence to data residency requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your AWS Services Handle Only De-identified Data
&lt;/h2&gt;

&lt;p&gt;Let’s assume we have a simple application infrastructure as shown below with AWS Amplify providing the web server infrastructure, DynamoDB for application storage, and Redshift for warehousing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uuQCnvic--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7sbn94fbxb4ow2vsm4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uuQCnvic--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7sbn94fbxb4ow2vsm4a.png" width="800" height="297"&gt;&lt;/a&gt;&lt;br&gt;Example web application infrastructure running on AWS.
  &lt;/p&gt;

&lt;p&gt;Without a vault in place, everything within our AWS account is under compliance and security scope. &lt;/p&gt;

&lt;p&gt;By introducing the vault as shown below (in this example, the collection of PII is handled directly from the vault), we de-scope all our AWS services. The services are only ever handling de-identified data, including the warehouse.&lt;/p&gt;

&lt;p&gt;Many analytical operations can be performed with de-identified data provided the data is consistently generated. A warehouse doesn’t need to have access to someone’s name, it only needs a consistently generated representation of the name in order to execute counts, group bys, and joins.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Duwn3fkU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7mwcyuejqelzlfhw1ok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Duwn3fkU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7mwcyuejqelzlfhw1ok.png" width="800" height="487"&gt;&lt;/a&gt;&lt;br&gt;Example of de-scoping AWS services with a data privacy vault.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Storing PII to Different Regionalized Vaults
&lt;/h2&gt;

&lt;p&gt;With Skyflow, a data privacy vault company, you can host vaults in various global regions and route sensitive data to a specific regional vault for storage and use. For instance, consider how the following application architecture meets data residency requirements across multiple regions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tzf-4H6K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/56yqh4iio5tlj31qlwg4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tzf-4H6K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/56yqh4iio5tlj31qlwg4.png" width="800" height="392"&gt;&lt;/a&gt;&lt;br&gt;Using regional multiple vaults to comply with data residency requirements.
  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your company’s site collects customer PII during account creation.&lt;/li&gt;
&lt;li&gt;On the client side, the website detects the customer’s location.&lt;/li&gt;
&lt;li&gt;Detecting that the customer is in the EU, the client-side code uses Skyflow’s SDK to collect the PII data and store it in your company’s data privacy vault in Frankfurt, Germany.
Note: For customers based in the US, the PII data is instead routed to the data privacy vault in the US (in this case, Virginia).&lt;/li&gt;
&lt;li&gt;The EU-based customer’s sensitive PII is stored in the EU-based data privacy vault, and Skyflow responds with de-identified data.&lt;/li&gt;
&lt;li&gt;The client-side code sends the account request, now with de-identified data, to the server.&lt;/li&gt;
&lt;li&gt;The server processes the request, storing the data (now de-identified and tokenized) in cloud storage in the “Oregon, US” region.&lt;/li&gt;
&lt;li&gt;At the end of the week, your company’s Redshift instance in Tokyo, Japan, loads the data (already de-identified and tokenized) from cloud storage to perform analytics.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Deploying multiple vaults situated in different regions streamlines the management of your sensitive data, ensuring compliance with data residency requirements across all your markets.&lt;/p&gt;

&lt;p&gt;The data privacy vault architecture significantly simplifies the complexities associated with data residency and compliance. Furthermore, by exempting Redshift (or any warehouse) from the compliance responsibilities tied to data residency, global analytics operations continue seamlessly within a single warehouse instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Compliance regulations, with their stringent data residency stipulations, necessitate businesses to maintain rigorous standards for data localization, protection, privacy, and security. Adhering to these regulations is essential to mitigating the risks associated with breaches, penalties, and potential damage to reputation. However, enterprises operating in various global regions, serving diverse customer bases, are left to deal with the complex task of navigating multiple regulatory landscapes.&lt;/p&gt;

&lt;p&gt;Using data privacy vaults as your core infrastructure for customer PII offers a streamlined solution to simplify global compliance, particularly concerning AWS services and cloud storage.&lt;/p&gt;

&lt;p&gt;With a data privacy vault, organizations gain the ability to centralize the security of all sensitive data, effectively removing AWS and cloud storage from their compliance scope. By deploying data privacy vaults in various regions, companies can ensure that sensitive data storage and transmission align with the specific laws and regulations of each operational jurisdiction, thereby enhancing their overall compliance and security posture.&lt;/p&gt;

&lt;p&gt;If you have thoughts on this or questions about this approach, please reach out to me on &lt;a href="https://www.linkedin.com/in/seanf/"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>compliance</category>
      <category>dataresidency</category>
    </item>
    <item>
      <title>The Data Cloud’s Cheese and Diamond Problem</title>
      <dc:creator>Sean Falconer</dc:creator>
      <pubDate>Mon, 18 Sep 2023 10:51:49 +0000</pubDate>
      <link>https://dev.to/aws-builders/the-data-clouds-cheese-and-diamond-problem-1ehm</link>
      <guid>https://dev.to/aws-builders/the-data-clouds-cheese-and-diamond-problem-1ehm</guid>
      <description>&lt;p&gt;In any given week, if you search the news for “data breach”, you’ll see headlines like the ones below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1k1qaplm3nxg9gp7kds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1k1qaplm3nxg9gp7kds.png" alt="Data breach headlines"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Companies like &lt;a href="https://techcrunch.com/2023/09/14/caesars-entertainment-data-breach-cyberattack" rel="noopener noreferrer"&gt;MGM and Caesars&lt;/a&gt; spend millions of dollars on firewalls, SIEMs, HSMs, and a whole smorgasbord of cybersecurity tools and yet, they can’t protect your social security number.&lt;/p&gt;

&lt;p&gt;From hotels and casinos to some of the most innovative technology companies in the world, why is it that companies with seemingly endless financial and talent resources can’t get a handle on their data security challenges?&lt;/p&gt;

&lt;p&gt;I believe this is due to a fundamental misunderstanding about the nature of data that started over 40 years ago.&lt;/p&gt;

&lt;p&gt;Back in the 1980s, as computers found their way more and more into businesses, we lived in a disconnected world. To steal someone’s data, you had to physically steal the box the data lived on. As a consequence, we assumed that all data is created equal, that all data is simply ones and zeros, but this is wrong. All data isn’t created equal, some data is special, and needs to be treated that way.&lt;/p&gt;

&lt;p&gt;In this blog post, I share my thoughts on what I refer to as the “Cheese and Diamond Problem” and how this has led to the data security challenges companies face today. I also explore an alternative approach, a new way of thinking, a privacy by engineering approach that helps us move towards a world where security is the default, and not bolted on.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Cheese and Diamond Problem
&lt;/h2&gt;

&lt;p&gt;Imagine that in my house I have cheese and I have diamonds. As a gracious host, I want guests of my home to be able to access my cheese. They should be able to freely go into the refrigerator and help themselves to some delicious cheese and perhaps a cracker.&lt;/p&gt;

&lt;p&gt;However, I don’t want just anyone to touch my diamonds. Perhaps my diamonds even have sentimental value because it’s a diamond ring that’s been passed down through many generations in my family. Clearly the diamond is special.&lt;/p&gt;

&lt;p&gt;Yet, if I store my diamonds in the refrigerator next to my cheese, it makes controlling access to the diamonds much more challenging. By co-locating these very different objects, my refrigerator alone isn’t enough to make sure my wife has access to the diamonds and cheese, but my guests only have access to my cheese.&lt;/p&gt;

&lt;p&gt;The rules of engagement for something like diamonds are completely different than the rules of engagement for cheese. We all understand this distinction when it comes to physical objects. &lt;/p&gt;

&lt;p&gt;This is exactly why my passport and my children’s birth certificates aren’t in the junk drawer in my kitchen with my batteries and my flashlights. If someone breaks into my home and steals my batteries, it's not that big a deal, but if someone steals my daughter’s birth certificate, then I not only feel like I’ve failed as a parent, but the information on her birth certificate is also now compromised forever. I can’t simply replace her date of birth.&lt;/p&gt;

&lt;p&gt;Despite all of us intuitively understanding that some physical objects are different, that they’re special, we somehow miss this point when we work with data. We don’t apply this thinking to Personally Identifiable Information (PII). We treat it like any other form of transactional or application data. We stuff it in a database, pass it around, make a million copies, and this leads to a whole host of problems.&lt;/p&gt;

&lt;h2&gt;
  
  
  The PII Replication Problem
&lt;/h2&gt;

&lt;p&gt;Let’s consider a simple example.&lt;/p&gt;

&lt;p&gt;In the diagram below, which represents an abstraction of a modern system, a phone number is being collected in the front end of the application, perhaps during account creation. That phone number ends up being passed downstream through each node and edge of the graph and at each node, we potentially end up with a copy of the phone number.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc2xsxhnfbwqfaywecyu0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc2xsxhnfbwqfaywecyu0.png"&gt;&lt;/a&gt;&lt;br&gt;The PII replication problem.
  &lt;/p&gt;

&lt;p&gt;We store it in our database, in the warehouse, but we may also end up with a copy in our log files and the backups of all these systems. Instead of just having one copy of the phone number, we now have many copies and we need to protect all those locations and control access consistently wherever the data is stored.&lt;/p&gt;

&lt;p&gt;Imagine that instead of having one copy of your passport that you keep in a secure location, you made 10,000 copies and then distributed them all over the world. Suddenly keeping your passport safe becomes a much harder problem in all 10,000 locations than if you have one copy secure in your home.&lt;/p&gt;

&lt;p&gt;But this is exactly what we do with data. &lt;/p&gt;

&lt;p&gt;We copy it everywhere and then attempt to lock down the hatches across all these systems and keep the policies and controls in sync about who can see what, when, and where. Additionally, because of the Cheese and Diamond Problem, we can’t adequately govern access to the data because the intermixing of our data conflates the rules of engagement about who has access. This quickly becomes an intractable problem because businesses don’t know what they’re storing or where it is, leading to the world we live in now where major corporations have data breaches on a regular basis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not All Data is Equal
&lt;/h2&gt;

&lt;p&gt;Businesses are collecting and processing more data than ever. With the explosion of generative AI, as much as we are in an AI revolution, we are also in a data revolution. We can’t have powerful LLMs without access to massive data.&lt;/p&gt;

&lt;p&gt;Companies leverage their data to drive business decisions, product direction, help serve customers better, and even create new types of consumer experiences. However, as discussed, not all data is created equal, some data, like PII, is special.&lt;/p&gt;

&lt;p&gt;Over time, we’ve recognized that other forms of data like encryption keys, secrets, and identity are special and need to be treated that way. There was a time when we stored secrets in our application code or database. We eventually realized that was a bad idea and moved them into secret managers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq00jgb90exe60uant5h0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq00jgb90exe60uant5h0.png"&gt;&lt;/a&gt;&lt;br&gt;Approaches to managing different types of sensitive data.
  &lt;/p&gt;

&lt;p&gt;Despite this progress, we are still left without an accepted standard for the storage and management of sensitive PII data. PII deserves the same type of special handling. You shouldn’t be contaminating your database with customer PII. &lt;/p&gt;

&lt;p&gt;Luckily there’s a solution to this problem originally pioneered by companies like Netflix, Google, Apple, and Goldman Sachs and now touted by the &lt;a href="https://www.computer.org/csdl/magazine/co/2022/10/09903879/1H0G8Iq3qDu" rel="noopener noreferrer"&gt;IEEE as the future of privacy engineering&lt;/a&gt;, the PII Data Privacy Vault.&lt;/p&gt;

&lt;h2&gt;
  
  
  The PII Data Privacy Vault
&lt;/h2&gt;

&lt;p&gt;A data privacy vault isolates, protects, and governs access to sensitive customer data (i.e. PII) while also keeping it usable. With a vault approach, you remove PII from your existing infrastructure, effectively de-scoping it from the responsibility of compliance and data security.&lt;/p&gt;

&lt;p&gt;A vault is a first principles architectural approach to data privacy and security, facilitating workflows like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PII storage and management for regulated industries&lt;/li&gt;
&lt;li&gt;PCI storage and payment orchestration&lt;/li&gt;
&lt;li&gt;Data residency compliance&lt;/li&gt;
&lt;li&gt;Privacy-preserving analytics&lt;/li&gt;
&lt;li&gt;Privacy-preserving AI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s go back to our example from earlier where we were collecting a phone number from the front end of an application. &lt;/p&gt;

&lt;p&gt;In the vault world, the phone number is sent directly to the vault from the front end. From a security perspective, we ideally want to de-identify sensitive data as early in the life cycle as possible. The real phone number will only exist within the vault, it acts as a single source of truth that’s isolated and protected outside of the existing systems.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbgoydsqjg5lppgsmzd4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjbgoydsqjg5lppgsmzd4.png"&gt;&lt;/a&gt;&lt;br&gt;Example of using a data privacy vault to de-scope an application.
  &lt;/p&gt;

&lt;p&gt;The vault securely stores the phone number and generates a de-identified reference in the form of a token that gets passed back to the front end. The token has no mathematical connection to the original data, so it can’t be reverse engineered to reveal the original value.&lt;/p&gt;

&lt;p&gt;This way, even if someone steals the data, as what happened with the &lt;a href="https://www.wsj.com/articles/capital-one-breach-highlights-shortfalls-of-encryption-11564738200" rel="noopener noreferrer"&gt;Capital One data breach&lt;/a&gt;, the tokenized data carries no value. In fact, Capital One was fined only because they failed to tokenize all regulated data, some records were purely encrypted and those records were compromised.&lt;/p&gt;

&lt;h3&gt;
  
  
  Revealing Sensitive Data
&lt;/h3&gt;

&lt;p&gt;While it’s great to securely store sensitive data, if we simply lock it up and throw away the key, it’s not super useful. We store all this customer PII so we can use it.&lt;/p&gt;

&lt;p&gt;For example, we may need to reveal some of the data to a customer support agent, an IT administrator, a data analyst, or to the owner of the data. In this case, if we absolutely need to reveal some of the data, we want to re-identify it as late as possible, for example during render. We also want to limit what a user has access to based on the operations they need to perform with the data. While I might be able to see my full phone number, a customer support agent likely only needs the last four digits of my phone number and an analyst maybe only needs the area code for executing geo-based analytics.&lt;/p&gt;

&lt;p&gt;The vault facilitates all of these use cases through a zero trust model where no one and no thing has access to data without explicit policies in place. The policies are built bottoms up, granting access to specific columns and rows of PII. This allows you to control who sees what, when, where, for how long, and in what format. &lt;/p&gt;

&lt;p&gt;Let’s consider the situation where we have a user logging into an application and navigating to their account page. On the account page, we want to show the user their name, email, phone number, and home address based on the information they registered with us.&lt;/p&gt;

&lt;p&gt;In the application database, we’ll have a table similar to the one shown below where the actual PII has been replaced by de-identified tokens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnezhosf39pzwn1ih3hqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnezhosf39pzwn1ih3hqo.png"&gt;&lt;/a&gt;&lt;br&gt;Example of users table within the application database.
  &lt;/p&gt;

&lt;p&gt;As in the non-vault world, the application will query the application database for the user record associated with the logged in user. The record will be passed to the front end application and the front end will exchange the tokens for a representation of the original values depending on the policies in place.&lt;/p&gt;

&lt;p&gt;In the image below, the front end already has the tokenized data but needs to authenticate with the vault attaching the identity of the logged in user so that access is restricted based on the contextual information of the user’s identity. This is known as &lt;a href="https://www.skyflow.com/post/dynamic-access-control-of-sensitive-user-data" rel="noopener noreferrer"&gt;context-aware authorization&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once authenticated and authorized, the front end can directly call the data privacy vault to reveal the true values of the user’s account information. But the front end only has access to this singular row of data and it's limited to the few columns needed to render the information on the account page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9te7rbvv6vtz73v9nze7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9te7rbvv6vtz73v9nze7.png"&gt;&lt;/a&gt;&lt;br&gt;Example of revealing sensitive data for a single record.
  &lt;/p&gt;

&lt;h3&gt;
  
  
  Sharing Sensitive Data
&lt;/h3&gt;

&lt;p&gt;No modern application exists in a silo. Most applications need to share customer PII with third party services to send emails, SMS, issue a payment, or some other type of workflow. This is also supported by the vault architecture by using the vault as a proxy to the third party service.&lt;/p&gt;

&lt;p&gt;In this case, instead of calling a third party API directly, you call the data privacy vault with the de-identified data. The vault knows how to re-identify the PII securely within its environment, and then securely share that with the third party service.&lt;/p&gt;

&lt;p&gt;An example of this flow for sending HIPAA compliant forms of communication is shown below. The backend server calls the vault directly with tokenized data and the vault then shares the actual sensitive data with the third party communication service.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitxg8snimwn71ndxvxau.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitxg8snimwn71ndxvxau.png"&gt;&lt;/a&gt;&lt;br&gt;Example of using a vault to send HIPAA compliant communication.
  &lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;We’ve come a long way since building business applications in the 1980s, but we’ve failed to evolve our thinking regarding how we secure and manage customer PII. Point solutions like firewalls, encryption, and tokenization alone aren’t enough to address the fundamental problem. We need a new approach to cut to the root of the Cheese and Diamond Problem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdsew9g3mzv9sc3w02kg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdsew9g3mzv9sc3w02kg.png"&gt;&lt;/a&gt;&lt;br&gt;Not all data is the same, PII belongs in a data privacy vault.
  &lt;/p&gt;

&lt;p&gt;The data privacy vault provides such an approach.&lt;/p&gt;

&lt;p&gt;It's an architectural approach to data privacy where security is the default. Multiple techniques like polymorphic encryption, confidential computing, tokenization, data governance, and others combine with the principle of isolation and zero trust to give you all the tools you need to store and use PII securely without exposing your systems to the underlying data.&lt;/p&gt;

&lt;p&gt;If you have comments or questions about this approach, please connect with me on &lt;a href="https://www.linkedin.com/in/seanf/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. Thanks for reading!&lt;/p&gt;

</description>
      <category>data</category>
      <category>privacy</category>
      <category>security</category>
    </item>
  </channel>
</rss>
