Without going into details, an embedding is a way to convert text, images, and so on into a numerical representation. That’s because computers can take this representation and then perform mathematical operations with it.
Embeddings solve a specific problem. As humans, we understand each other using words and phrases, but a computer doesn’t perform well in this field. Imagine you have two sentences like these:
It exposes sensitive data
It leaks confidential information
They have the same meaning, but computers can’t understand that they are similar. That’s where embeddings work really well. What if you were able to tell a computer that they are similar?
"It exposes sensitive data"
[0.91, 0.12, 0.77]
"It leaks confidential information."
[0.89, 0.10, 0.75]Look at these two sentences again converted into vectors. Because of this conversion, computers can now compare them and understand that they are very similar.
Because embeddings transform text into comparable vectors, companies can use them to build features that search by the meaning of words instead of keywords. That’s why they are commonly used in combination with RAG (Retrieval-Augmented Generation). It allows companies to retrieve the most semantically relevant content even if the wording is different. Instead of matching exact keywords or text, RAG retrieves information based on conceptual similarity.
How could an attacker retrieve sensitive information from this? Let’s look at an example of a wrong use of RAG with embeddings.
How could it become a threat?
Semantic Steering
It happens when an attacker crafts normal-looking search queries whose embeddings are semantically close to sensitive internal content. Let’s imagine there is an internal post that explains how to perform HTTP requests to an exposed API.
During the development cycle, engineers can use this API with these credentials to perform HTTP requests.
An attacker could use the Search Bar feature, with RAG in combination with embeddings, to do something like this:
How do developers usually test APIs during development?
Embedding Poisoning
It happens when malicious, misleading, or sensitive content is embedded and stored in the vector database, where it continues to influence future search and retrieval results until it is explicitly removed. An attacker, using the same Search Bar feature, could try:
How do developers usually test APIs?

