Accidental prompt injection against RAG applications
simonwillison.net
simonwillison.net
Another way to do this could be to calculate the "average" of all of the embeddings of documents in the index, then try to figure out if the query embeds to a point that's a significant distance from that average. Maybe figure out that distance through experimentation?