[00:00.000 --> 00:06.220] Welcome, this is the attacks on GenAI data and using vector encryption to stop them talk. [00:06.960 --> 00:11.280] I'm Patrick Walsh, this is Bob Wall, we're the co-founders of IronCore Labs, [00:11.280 --> 00:15.080] where we help people protect data in their cloud applications by making [00:15.080 --> 00:20.320] application layer encryption more easy and practical and usable. [00:21.220 --> 00:26.780] So this talk is going to be about the ecosystems around LLMs, but we'll start by talking about LLMs [00:26.780 --> 00:33.680] specifically. And in particular, some limitations of LLMs, right? When an LLM is trained, it's [00:33.680 --> 00:40.220] trained to predict a plausible completion to a prompt, and that means it can sometimes make [00:40.220 --> 00:45.020] stuff up that sounds good but isn't necessarily right. It's also trained on what, by the time [00:45.020 --> 00:49.660] it's released, is typically stale data, because it takes a long time to train it, to test it, [00:49.660 --> 00:55.220] to fine-tune it, etc. And then finally, it hopefully hasn't been trained on your data, [00:55.220 --> 00:59.980] and therefore, if you want it to do things that are cool across, you know, your corporate data, [00:59.980 --> 01:05.060] your personal data, or something like that, it's not going to work. And to fill those gaps, there's [01:05.160 --> 01:10.260] a thing called RAG, or Retrieval Augmented Generation. Terrible name, basically means [01:10.260 --> 01:15.180] stuff extra stuff into the prompt so the LLM can answer questions better. And it works a lot like [01:15.180 --> 01:20.020] this. You have a chat app, it doesn't have to be a chat app, it's just like the most common thing [01:20.020 --> 01:25.080] you use, right? A user asks a question, and now instead of passing that question to the LLM, [01:25.080 --> 01:30.960] the first thing it does is a search. And that search is to find relevant documents related to [01:30.960 --> 01:36.320] the query. That all gets jammed together into a prompt, which then goes to the LLM. That's it, [01:36.320 --> 01:41.280] that's RAG in a nutshell, you get it. Here's a kind of more practical example of what that looks [01:41.280 --> 01:47.480] like. There's a system prompt, there's a history of the previous questions and answers from the chat, [01:47.480 --> 01:52.960] and then there's the current, the most recent question, and then stuffed in with that is any [01:52.960 --> 01:58.640] documents or web pages or whatever it is that might be related to what the question was. In [01:58.640 --> 02:04.060] this case, it's about, hey, what's that draft 10Q? It's a private document that's not public, [02:04.060 --> 02:09.140] and that's how it all gets in to the LLM so it can answer questions on that private data. [02:09.280 --> 02:14.180] It's fundamental to basically how everyone is using this stuff today, if you're using [02:14.180 --> 02:20.760] chat inside an app. And to make all this work, you need to have some type of more intelligent [02:20.760 --> 02:25.680] search than what we typically do. Call it AI search, call it semantic search or whatever you [02:25.680 --> 02:31.280] want to, and there's a bunch of ways to do this. The most popular right now is an approach called [02:31.280 --> 02:35.960] vector search. It's kind of what everyone is doing, although it's not the only way to do it. [02:36.140 --> 02:42.740] And vector search and actually all of those AI search type techniques are important because they [02:42.740 --> 02:47.760] differentiate between different meanings of words, they can understand a sentence in context, [02:47.760 --> 02:53.440] they can understand when arm means a division of an organization versus when arm is a body part or [02:53.440 --> 03:01.180] even a verb, right? And in practice, how these types of vector search works is you start with [03:01.180 --> 03:07.020] some input document. And that input, did we lose it? And that input document then gets chunked up [03:07.020 --> 03:12.640] into pieces. Sometimes it's by sentence, sometimes it's sets of, call it 30 words, or it can be any [03:12.640 --> 03:18.300] strategy and often overlapping. But each of those pieces gets run through something that's very [03:18.300 --> 03:24.840] similar to an LLM, that sucks, that's very similar to an LLM, but is in fact called a text embedding [03:24.840 --> 03:31.440] model. And a text embedding model, unlike an LLM, produces something called a vector embedding. [03:31.540 --> 03:33.120] That's not great. [03:35.920 --> 03:40.740] Produces something called a vector embedding. And the vector embedding is basically just [03:41.280 --> 03:47.060] a long list of very small numbers. And those small numbers can be hundreds or thousands in length. [03:47.440 --> 03:52.040] And we'll get into what they mean in a minute here, but to give you some intuition on these, [03:52.040 --> 03:55.860] we'll take a look at a list, like a vector that's only three long, right? Because you can graph this [03:55.860 --> 04:00.000] in 3D space and you can understand it better. And if we have a bunch of different vectors, [04:00.000 --> 04:04.480] let's say we have A and B and we have C, we can kind of look at this visually and say, [04:04.480 --> 04:09.840] oh look, A and B kind of look like they're close together and A and C look like they're far apart. [04:09.840 --> 04:15.380] In fact, if we run a distance comparison operation like this one, Euclidean distance, [04:15.380 --> 04:18.440] although there's a bunch of different ones, they all have the same kind of effect, [04:18.440 --> 04:23.920] you can see that A and B are 2.2 apart, whereas A and C are 5.6 apart. [04:24.360 --> 04:28.740] And the way this works with search is we take a query, right? It's a sentence, [04:28.740 --> 04:33.740] and we reduce it to, let's say, A. A is a vector representation of what we queried, [04:33.740 --> 04:38.740] and then we search across all our vectors and we say, give me anything that's similar to A, [04:38.740 --> 04:43.480] and then hopefully, if it does it right, it returns B but not C. That's it, that's what vector [04:43.480 --> 04:48.640] search is doing, it's the whole shebang. The vector represents the meaning of the content. [04:49.180 --> 04:54.260] And to make that work, we have this kind of new concept, or at least new to a lot of us, [04:54.260 --> 04:57.840] at least to me, although I guess it's been around for quite a while, and that's called a vector [04:57.840 --> 05:03.480] database. And a vector database's purpose is to be able to do these nearest neighbor or approximate [05:03.480 --> 05:09.400] nearest neighbor searches across large amounts of data very quickly. And there are a lot of [05:09.400 --> 05:14.540] these companies now that are doing this. In fact, last year we saw hundreds of millions of VC money [05:14.540 --> 05:18.600] go into the startups that are building vector databases, startups like Pinecone and Weaviate [05:18.600 --> 05:25.200] and Quadrant. And despite that, the idea of a vector database is already eroding away to nothing [05:25.200 --> 05:30.460] because classic databases like Mongo and Postgres and Oracle are all adding vector capabilities [05:30.460 --> 05:33.920] to their existing databases. So you're getting these type of vector comparison [05:33.920 --> 05:38.600] nearest neighbor search capability pretty much everywhere that you have a database now. [05:39.140 --> 05:44.260] Okay, changing tracks for a second. We started thinking to ourselves, who's using this stuff? [05:44.680 --> 05:51.060] Well, we looked at the top 10 SaaS companies and we thought, how many of them are doing [05:51.060 --> 05:56.080] adding LLM capabilities over private data? Which means that they're almost certainly using RAG. [05:56.080 --> 06:00.620] The answer is 100%. Then we said, well, what about security companies? They wouldn't jump on [06:00.620 --> 06:04.760] to just using all this new technology that we don't know how to secure yet, would they? No, [06:04.760 --> 06:12.140] 100% of them too. Also adding LLM capabilities on top of private data. Think about that for a [06:12.140 --> 06:16.800] moment, right? It means that these AI systems, whatever cloud services and things you're using, [06:16.800 --> 06:22.080] they are hoovering up this data. Probably copies of it are going into the vector databases as [06:22.080 --> 06:29.080] vectors and among other places, which I'll talk about ever so briefly later. So, do these vectors [06:29.080 --> 06:35.040] matter? I was talking to the CEO of one of the vector database companies who's raised tens of [06:35.040 --> 06:39.120] million dollars last year and he told me that a vector was like a hash and it was basically [06:39.120 --> 06:44.680] meaningless, except for comparison purposes. So, which my first thought is, well, you clearly don't [06:44.680 --> 06:51.420] know how people abuse hashes. And my second thought is, you're wrong. So, that isn't how [06:51.420 --> 06:57.440] it works at all. If you look at taking a phrase and you reduce it to an embedding vector, an [06:57.440 --> 07:04.460] embedding model into a vector, okay, it looks pretty meaningless to us. But then again, so does [07:04.460 --> 07:09.080] an animated GIF like this cat if you look at it in a text editor, right? Just because it's meaningless [07:09.080 --> 07:15.200] to us to look at, doesn't mean it's meaningless to a computer or in this case, to an AI model. [07:15.200 --> 07:21.440] And so, the way you go back from a vector to the original text or something approximating it [07:22.000 --> 07:25.360] is using something called an inversion model. An inversion model is just a model that's [07:25.360 --> 07:31.200] trained on vectors to sentences so that it can make that same prediction. In this case, [07:31.200 --> 07:35.520] it comes close. It's our income is down instead of our earnings is down, right, in this example. [07:35.800 --> 07:42.700] 100% match on meaning, not 100% match on words. There are some tens of thousands of papers on [07:42.700 --> 07:49.380] this at this point. It's heavily studied in academia, not widely known, I don't think, broadly. [07:49.940 --> 07:54.440] Best paper we've seen for text inversions, and it's not just text that vectors represent, [07:54.440 --> 08:01.240] I'll talk about that in a second, recovers 92% of exact words. That means full names, [08:01.240 --> 08:07.160] everything coming right back out exactly as it went in on the text, okay? The other 8% is basically [08:07.160 --> 08:14.620] effectively the same anyway. So are these attacks hard? What's the skill level for doing this kind [08:14.620 --> 08:21.020] of attack? The answer is most of these papers have accompanying open source software on GitHub, [08:21.020 --> 08:25.220] and so really you just need someone who can run the software, not someone who knows how to build [08:25.220 --> 08:30.560] the software, which means it's script kiddy level. And on that note, we actually ran some [08:30.560 --> 08:35.300] of these attacks ourselves. We posted some blogs you can check out. We did one on, so I mentioned [08:35.300 --> 08:39.080] vectors can represent different things, they can represent images for image search, they can [08:39.080 --> 08:44.680] represent faces or voice prints or other things for that. We did one against facial recognition. [08:44.680 --> 08:48.040] That doesn't use an inversion model, that's a different technique by the way, so it's kind of [08:48.040 --> 08:54.160] interesting for that purpose, and we did one on text inversions. Really good results, like you [08:54.160 --> 09:00.000] can really get all the stuff back out or very near approximations of the inputs. [09:01.140 --> 09:04.540] All right, so let's talk about these new vector database companies. [09:04.920 --> 09:11.460] They probably have good security, right? Actually no, super immature. They'll fix it over time, [09:11.460 --> 09:18.460] it'll be fine, but if you look closely at these as we have, two of them have no authentication [09:18.460 --> 09:23.380] required by default, right, making the mistakes of Elasticsearch and MongoDB of years past but not [09:23.380 --> 09:30.880] learning. One of them has services that are meant to be internal services and that, you know, [09:30.880 --> 09:35.480] there's no protection or authentication on them, so that if someone goes to access that because [09:35.480 --> 09:41.280] the firewall neglected to block a port, direct access back to the data without any authentication. [09:41.860 --> 09:47.740] Two of them claim to have end-to-end encryption when they only have TLS in transport, and more. [09:47.740 --> 09:52.240] I could go on, it doesn't matter. The point is that these vector database systems, and for that [09:52.240 --> 09:58.540] matter the chat apps, either way, are like total treasure troves of information. And even if you [09:58.540 --> 10:03.360] don't use it and invert it, they're at least treasure maps of information because they point [10:03.360 --> 10:08.120] back to the data and you can query it. And if you think about that for a second, imagine [10:08.120 --> 10:13.300] that you're in a CTF competition in that corner of this thing, and you know, you get into a machine, [10:13.300 --> 10:16.680] cool, but now you have to get the flag, and it's in a database, you have to get into the database, [10:16.680 --> 10:21.400] and now you have to reverse the schema and, you know, figure out a query and find the flag. [10:21.940 --> 10:27.820] It ain't as easy as it sounds, right? It's a lot of expertise and time to do that versus, you know, [10:27.820 --> 10:36.080] give me that data. It is, like, incredibly far, far easier to attack these systems because you [10:36.080 --> 10:42.620] can do it in natural language. So, what do we think about bringing AI into our infrastructure? [10:42.620 --> 10:47.400] Maybe we should pause for a moment and think a little bit about it. Or if it's in there, maybe [10:47.400 --> 10:50.520] if you're a hacker in the audience, you should think about, holy shit, there's a lot here. [10:50.520 --> 10:56.760] Let me give you some ideas. Obviously, everyone knows about prompt injections. Maybe you haven't [10:56.760 --> 11:01.280] thought so much about the fact that you can put a prompt injection in the documents being searched, [11:01.280 --> 11:04.180] and they get pulled into the prompt, and you can poison the prompt that way. [11:05.540 --> 11:09.720] Logs are everywhere. If you're putting private data into the things that go to the LLMs and the [11:09.720 --> 11:14.980] LLMs log it, that's a problem. But also, the prompt firewalls, if you're using those, are [11:14.980 --> 11:19.180] logging that stuff, too. So, the data's kind of exploding. And don't even get me started on [11:19.180 --> 11:23.520] agents. Talk to me after if you want to hear about my thoughts on that. But if you're generating [11:23.520 --> 11:30.200] code to run to query a database, you're beyond hope. Today, though, we're not going to talk [11:30.200 --> 11:34.760] about any of that. We're going to talk specifically about this vector stuff and how to protect it. [11:34.900 --> 11:39.060] So, basically, today, the way to protect that is to encrypt it. And there's two approaches to this, [11:39.060 --> 11:43.000] at least in academia, that you could do. One is fully homomorphic encryption, and the other is [11:43.000 --> 11:48.660] partially homomorphic. So, fully homomorphic encryption, there's actually quite a few papers [11:48.660 --> 11:52.240] on this, and they're fairly interesting. There's a lot of different approaches. Some of them require [11:52.240 --> 11:57.380] sending all the vectors to the server. Some require some other stuff. They typically suffer [11:57.380 --> 12:02.420] from being slow. And you would have to build your own vector database and be another logo on that [12:02.420 --> 12:07.360] wall and compete with all the other vector databases on every other thing. The other option [12:07.360 --> 12:11.980] is partially homomorphic encryption. And the idea here is that something that's partially [12:11.980 --> 12:17.440] homomorphic is able to do some operations, but not arbitrary operations. And in this case, [12:17.440 --> 12:24.540] we're talking about optimizing for that nearest neighbor search type of operation. So, in this [12:25.200 --> 12:31.800] example, partially homomorphic, specific to nearest neighbor searches. And to talk more about this [12:31.800 --> 12:35.790] paper and the work that we've done around it, I'm going to turn it over to Bob. [12:39.810 --> 12:48.970] All right. We found this paper about a way to encrypt vectors. And you can see the title, [12:48.970 --> 12:53.910] Approximate Distance Comparison Preserving Symmetric Encryption. So, that's a mouthful. [12:54.390 --> 13:01.370] But this algorithm is a type of property-preserving encryption, [13:01.370 --> 13:06.250] which means it's kind of like order-preserving encryption or maybe deterministic encryption, [13:06.250 --> 13:10.910] if you've heard of those. The property that this algorithm is preserving, though, [13:10.910 --> 13:17.870] is distance comparison instead of equality or order. And so, if you can preserve the ability [13:17.870 --> 13:23.170] to compare the distance between two vectors after they've been encrypted, that means your [13:23.170 --> 13:28.230] vector database continues to work on the encrypted vectors just as well as it did on the original [13:28.230 --> 13:35.950] vectors. So, like deterministic and order-preserving encryption, there's a trade-off. [13:35.950 --> 13:43.130] The more secure you make it, the less well the property is preserved. And so, the less well [13:43.130 --> 13:49.330] queries might work on the data. So, you have a decision to make about whether you want a [13:49.330 --> 13:54.230] lot of security and you can tolerate maybe a little less accuracy on queries, or you want a [13:54.230 --> 13:59.250] lot of accuracy on the queries and maybe you'll have a little bit less protection of the data. [14:00.090 --> 14:06.330] But the system works by, if you've got a system that's ingesting data and it's making these [14:06.330 --> 14:11.250] vectors, putting them into a vector database, it's easy to add this encryption. You just, [14:11.250 --> 14:16.150] in the system that's already there, after you've taken the data and run it through the [14:16.150 --> 14:20.530] embedding model and generated the vector embedding, you run it through this algorithm and encrypt it, [14:20.530 --> 14:26.410] it's still a vector, it looks similar enough to the original vector that the vector database is [14:26.410 --> 14:32.970] going to take it and be happy with it. So, you use a secret key, you encrypt the vector, [14:32.970 --> 14:38.690] you throw it in the vector database. So, very simple change to the system to be able to do that. [14:38.690 --> 14:44.650] Now, most of these vector database systems support storing metadata along with the vectors, [14:44.650 --> 14:50.650] and that metadata might have some sensitive data in it too. So, you might want to consider [14:50.650 --> 14:54.170] encrypting that. That's a whole different thing. We're just going to focus on the vectors for [14:54.170 --> 14:59.250] right now. So, once you've got all of these vectors encrypted, you've loaded them into [14:59.250 --> 15:05.210] your vector database. When it's time to do a query, it's also pretty simple. Again, [15:05.210 --> 15:09.070] the normal process would be to take the query, run it through the embedding model, [15:09.070 --> 15:14.810] get a vector. So, then you just encrypt that vector with the same key and the same algorithm, [15:14.810 --> 15:18.710] and then you do your normal search. And because the algorithm, the encryption, [15:18.710 --> 15:23.970] preserves distance comparison, that means that when you give that encrypted query to the vector [15:23.970 --> 15:29.870] database, it's going to return the encrypted vectors that are closest to the encrypted query, [15:29.870 --> 15:34.530] and those are going to correspond to the decrypted vectors, the original vectors, [15:34.530 --> 15:40.830] that are closest to the original query. So, you get the same results out, pretty much. [15:41.750 --> 15:45.950] And once you get them out, you can maybe decrypt the vectors if you need to, [15:45.950 --> 15:50.610] or maybe you've got some metadata that lets you look up the associated data in a database or [15:50.610 --> 15:59.030] something else. So, without the key, an attacker can't really understand the queries. They are [15:59.030 --> 16:03.430] enough different that they can't look at that and kind of know what the query was. [16:03.430 --> 16:07.550] They can't invert the data that's in the database, even if they hacked it, [16:07.550 --> 16:15.050] exfiltrated all the data, they can't easily invert it. The results are still fairly accurate. Again, [16:15.050 --> 16:18.950] that's a trade-off between the security and the accuracy of their searches. [16:19.530 --> 16:27.250] The whole thing is, it introduces a negligible penalty in terms of performance. The encryption [16:27.250 --> 16:33.070] process is fast, so you can add this in and not add a lot of time to your process. [16:34.150 --> 16:37.650] So, I'm going to talk a little bit more about this encryption function. [16:38.050 --> 16:45.530] So, it's a function that maps inputs to outputs, and it does it such that for any distance function, [16:45.530 --> 16:51.270] the margin of error that you get when you compare two encrypted vectors will be within some factor, [16:51.270 --> 16:57.010] we'll call that beta, the approximation factor of the original distance. And so, if you can build [16:57.170 --> 17:02.630] a function that preserves that for any pair of vectors that you give as an input, then you have [17:02.630 --> 17:10.510] distance comparison preserving encryption functions. So, in real systems, we kind of [17:10.510 --> 17:14.810] talked about this, the comparison function is used for nearest neighbor and approximate [17:14.810 --> 17:19.890] nearest neighbor searches, which is what all these vector databases are doing. So, [17:19.890 --> 17:25.290] you know, if we can build, and we can, we've built this function that preserves distance comparison, [17:25.290 --> 17:31.190] so we can use it to encrypt these vectors. So, the paper introduced this scale and perturb [17:31.190 --> 17:37.010] algorithm. And I won't go into a lot of details about how it works, but I will give you a few [17:37.010 --> 17:44.970] key points about it. So, there's a scale factor, when you, when you set up the algorithm, [17:44.970 --> 17:50.230] you randomly choose this scale factor, and you choose a random key. And so, [17:53.640 --> 18:00.860] there's also when you go to encrypt an individual vector, you generate an initialization vector, [18:00.860 --> 18:06.160] an IV value, just the same as you might if you're doing symmetric encryption on data with, [18:06.160 --> 18:14.620] you know, a normal symmetric algorithm. And you perturb each element of the vector using that key [18:14.620 --> 18:20.620] in that initialization vector randomly. So, every element in the vector is going to get wiggled [18:20.620 --> 18:26.080] around a little bit. And that amount that it gets wiggled around depends on that value beta, [18:26.080 --> 18:33.060] that approximation value. And that's how it limits the change in the distance that you can get. [18:34.420 --> 18:41.140] So, the paper had this idea of perturbing the vectors as well. And they basically had this [18:41.140 --> 18:46.400] idea of shuffling. If you had all of the vectors, you would shuffle the order of them before you [18:46.400 --> 18:52.200] encrypted them. And we wanted an online algorithm so that you could, you know, you just encrypted [18:52.200 --> 18:57.640] the vectors as you saw them. So, we didn't find that shuffling to be beneficial. But [18:58.200 --> 19:03.740] we did add a shuffle where we took the elements of the vector and shuffled them up. So, we [19:03.740 --> 19:08.200] randomly changed the order. And it's a deterministic shuffling based on the key. [19:08.300 --> 19:12.380] So, when you get done, all of the elements in the vector have been scaled. [19:12.840 --> 19:18.120] And then they get shifted around, which makes it even harder. Even if you knew what the algorithm, [19:18.120 --> 19:22.400] what the embedding model was, all of the elements of the vector are in different places, [19:22.400 --> 19:28.480] which makes it a lot harder to look at it and try to even guess how it corresponds to the original [19:28.480 --> 19:36.260] vectors. So, to give a little bit of a more intuition about this, you can think about these [19:36.260 --> 19:42.600] vectors. I mean, a vector is a line from the origin to some point. And the point is defined by [19:42.600 --> 19:47.620] the elements in the vector, right? Those are the coordinates of that point. And so, [19:47.620 --> 19:55.740] the beta basically defines a sphere in n-dimensional space around that point. And [19:55.740 --> 20:02.240] so, as we perturb the elements of the vector, the resulting point is somewhere within that sphere. [20:02.240 --> 20:07.560] And the size of that sphere is governed by that beta value, the approximation factor. So, [20:08.620 --> 20:13.560] you can see that if you bound the amount that you can move the point around, [20:13.560 --> 20:16.340] and you've bound the amount that you've moved another point around, [20:16.340 --> 20:21.620] the distance between those is bounded too. So, that's how it manages to preserve the distance [20:21.620 --> 20:28.360] comparison. So, in addition, we talked about, we also scaled the vectors up so that they're, [20:28.360 --> 20:32.640] you know, they get moved around a little bit, they get scaled. So, if you just look at them, [20:32.640 --> 20:39.000] and then the elements get shuffled. So, it's very difficult to correlate an encrypted vector [20:39.000 --> 20:45.820] and the original vector that was encrypted. Again, because we've preserved that distance [20:45.820 --> 20:52.440] comparison, they're still relatively close together with each other. Here's an example, [20:52.440 --> 20:58.300] we kind of turned off the shuffle part of it, so it wouldn't be quite as difficult to see, [20:58.300 --> 21:03.220] but you can see, you know, we scaled it up, and then we perturb everything. So, sometimes, [21:03.220 --> 21:07.760] depending on how much we perturb stuff, signs on elements might change, you know, [21:07.760 --> 21:15.580] they bounce around a little bit, but they're still in this vector. So, we've implemented this [21:16.020 --> 21:21.120] algorithm. We've got an open source library we call IronCoreAlloy that's out there on GitHub. [21:21.720 --> 21:28.780] It's under the AGPL license. So, if you can use GPL software, you can go grab it and use it. [21:28.780 --> 21:33.780] If you can't use GPL software, you can talk to us about a different arrangement. [21:35.640 --> 21:39.840] Along with the library, we've got some sample code that shows how you can use it with a number [21:39.840 --> 21:45.520] of different vector databases. And as I said earlier, it's easy. So, the examples aren't [21:45.520 --> 21:49.960] super complicated. It's pretty easy to drop this into some code that's going to put data in one of [21:49.960 --> 21:56.260] these vector databases. The library is written in Rust, but we've exposed it in Java, Kotlin, [21:56.260 --> 22:03.740] and Python. We've got some more language support on the way. Along with the examples, we've got [22:03.740 --> 22:14.280] some results of using this on some output of different LLMs, open source LLMs. And you can [22:14.280 --> 22:21.860] see for an approximation factor of one and a half, which is a pretty modest one, we don't impact the [22:21.860 --> 22:26.260] search performance. We measured precision and recall loss, which are pretty common measures [22:26.260 --> 22:32.100] of search accuracy. It didn't really impact the search accuracy much at all. So, you know, it [22:32.100 --> 22:41.760] works. So now, once we've encrypted these vectors, suppose we want to run an attack on them. We're [22:41.760 --> 22:47.860] going to run one of the inversion models that Patrick was talking about. So, we know exactly, [22:47.860 --> 22:52.920] somehow we know exactly what the embedding model was that was used. It was an open source one, [22:52.920 --> 22:57.280] so we don't have to... we train this up once, and it's going to work on every embedding that [22:57.280 --> 23:02.220] was generated by that embedding model. But we're going to try to run it on the encrypted vectors. [23:02.220 --> 23:11.440] It turns out, because we've done the perturbation, and we shifted around all of the elements, [23:12.560 --> 23:20.620] it's mostly gibberish that we get out. So, you really can't tell much about them. [23:21.760 --> 23:27.320] Even if somebody knows the plain text, and they have a black box access to the model, [23:27.320 --> 23:33.380] and they're going to submit vectors, get encrypted vectors out for a particular key, [23:33.380 --> 23:38.020] and they're going to train their own inversion model, the randomization makes that so that [23:38.020 --> 23:42.900] it's very difficult, and you get a lot less valuable results. You might get a little bit [23:42.900 --> 23:51.420] of the meaning. You're not going to get exact words. And if you... and again, it depends on [23:51.420 --> 23:58.380] what value you use for that approximation model. If you knew the plain text, and you knew the [23:58.380 --> 24:05.100] ciphertext, can you extract the key? No. It's based on a probabilistic random function that's [24:05.100 --> 24:11.820] essentially like a 256-bit keyed hash. And I don't know about you, but I don't want to spend my next [24:11.820 --> 24:19.620] two billion weekends trying to brute force attack a 256-bit keyed hash. So, I'm going to turn it over [24:19.620 --> 24:32.100] to Patrick, and he'll summarize for you. Okay, so the takeaways that we hope you have here, [24:32.100 --> 24:38.120] as we just did a real brief fast run through on what this is and how it works, is first and foremost, [24:38.120 --> 24:44.120] you should walk away realizing that RAG produces a lot of copies of data. So, if people are using AI [24:44.120 --> 24:51.400] and LLMs in their applications, and somehow that they're operating over data that model wasn't [24:51.400 --> 24:56.060] trained on, probably they're doing this and probably lots of copies of that data are being [24:56.060 --> 25:03.240] made. It's sprinkled everywhere. And vector databases are like a key part of that. Second thing [25:03.240 --> 25:08.940] is that vectors and vector databases can be inverted back to their original input or something [25:09.620 --> 25:17.020] very closely approximating it, right? High fidelity and low effort attack, and oftentimes an attacker [25:17.020 --> 25:21.020] won't even need to do that. If they have access to the chat app, they can bypass that even. But [25:21.020 --> 25:25.420] never mind, if they have access to the vector database, that's as good as having access to the [25:25.420 --> 25:31.640] chat app, right? And then the third takeaway that we want you to walk away with is this. It isn't [25:31.640 --> 25:37.660] that hard in this case, because there's a built open source library to implement a solution to [25:37.660 --> 25:45.040] this problem in your software. So, if you want to, feel free, check out the results, go try it online. [25:45.900 --> 25:51.940] The results you get in a vector search are really close to the original. Like, it looks the same to [25:51.940 --> 25:56.460] me pretty much across the board. The benchmarks show a few percent differences. There's almost [25:56.460 --> 26:01.920] no performance penalty. From a latency perspective, there's almost no reason not to encrypt your [26:01.920 --> 26:08.020] vectors if they contain sensitive data in them. And that's it. Thanks for your time today. We're [26:08.020 --> 26:11.760] going to be out there, probably just outside the Creator Stage area, if people want to [26:11.760 --> 26:14.720] chat with us or have any questions. Thanks for your time.