Vector databases leverage semantic similarity search on vector embeddings, enabling them to identify prompt injection attacks based on malicious intent or meaning, even when the exact phrasing is novel or disguised, outperforming traditional keyword or regex methods.