Fase 8 · Bloco D — injection-guard em todas as rotas LLM + red-team (#3857)

Integrated into release/v3.8.25 — Fase 8 Bloco D (injection-guard em todas as rotas LLM + red-team).
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-06-14 18:02:18 -03:00
committed by GitHub
parent d3146a1751
commit d728bfbb1e
19 changed files with 260 additions and 12 deletions

View File

@@ -144,6 +144,20 @@ function extractMessageContents(body) {
}
}
if (typeof body.input === "string") contents.push(body.input);
if (typeof body.prompt === "string") contents.push(body.prompt);
else if (Array.isArray(body.prompt))
for (const p of body.prompt) {
if (typeof p === "string") contents.push(p);
}
if (typeof body.instructions === "string") contents.push(body.instructions);
if (typeof body.query === "string") contents.push(body.query);
if (Array.isArray(body.documents))
for (const d of body.documents) {
if (typeof d === "string") contents.push(d);
else if (d && typeof d.text === "string") contents.push(d.text);
}
return contents;
}