TypeSafe classifies RAG passages with probability thresholds to fight noise and prompt injection

marlene_zw · x · 2026-09-23

TypeSafe AI docs show adding a classification stage between RAG retrieval and generation: one request asks four questions per query-passage pair (relevant? contains an answer? contradicts assumptions? instructing the model?), returning probabilities used for branching — e.g. drop if P(relevant)<0.45, keep if P(has answer)>0.55. Evidence and conflicts are passed in separate blocks. A full demo over an 81-passage corpus with cosine top-12 retrieval flags planted prompt injections and false-premise questions. The poster is trying it for compaction in the copilot SDK.

Related event: Small-Model Probability Scoring for Cheaper RAG and Agent Context Management(3 posts)→

Original post →

More from coding & agent

coding & agent channel →