Loading...
for (const url of submittedUrls) {
await index.add(await fetchText(url));
}for (const url of submittedUrls) {
if (!TRUSTED_HOSTS.has(new URL(url).hostname)) continue;
const text = await fetchText(url);
await index.add(text, { source: url, addedAt: Date.now() });
}Indexing only trusted sources and recording where each document came from makes poisoned content harder to add and easier to remove.
Yes. If attackers can add documents to the index, they can make the model return false answers or hidden instructions when those documents are retrieved.
Data poisoning changes the data a model learns from or retrieves. Prompt injection gives the model instructions at runtime.
Track the source of every document, review user-submitted content, and run evals that check for unexpected answers on trigger phrases.