Repository navigation
fix(assertions): treat search-rubric output and web content as untrusted - #11898
Varunpoojari wants to merge 5 commits into
Conversation
The default search-rubric grader prompt had no instruction about untrusted material, even though the grader reads the evaluated output and live web search results. Add the same guard the agent-rubric default already carries, and a regression test. Refs promptfoo#10575 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DYzRi6risVxjoGAnG7w4Dh
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
👍 All Clear
Reviewed the prompt changes for the web-search grading flow and associated tests. The PR strengthens guidance to treat evaluated output and retrieved web content as untrusted, which mitigates prompt-injection style risks. No new tools or capabilities were added, and no exploitable LLM security issues are evident from the diff.
Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11898 +/- ##
==========================================
- Coverage 89.73% 89.73% -0.01%
==========================================
Files 1051 1051
Lines 92781 92781
Branches 32855 32855
==========================================
- Hits 83261 83259 -2
- Misses 9520 9522 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
👍 All Clear
I reviewed the prompt changes for the web-search-enabled grader and the associated tests. The PR strengthens defenses by instructing the model to treat evaluated output and retrieved web content as untrusted and to ignore embedded instructions. No new tools, sinks, or data flows that would raise LLM-specific security concerns were introduced. As a result, I did not find any LLM security vulnerabilities in these changes.
Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more
There was a problem hiding this comment.
👍 All Clear
Reviewed the prompt changes for the web-search-enabled grader and associated tests. The PR adds guardrail language to treat evaluated output and retrieved web content as untrusted and not to follow instructions in that material. No new tools, capabilities, or execution paths were introduced by these changes. No LLM security vulnerabilities were identified.
Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more
There was a problem hiding this comment.
👍 All Clear
Reviewed the prompt changes for the web-search-enabled grader and the associated tests. The update strengthens guidance by treating evaluated output and retrieved web content as untrusted and instructing the model not to follow embedded instructions. No new tools, permissions, or execution paths were introduced. I did not identify any LLM security vulnerabilities introduced by this PR.
Minimum severity threshold: 🟡 Medium | To re-scan after changes, comment @promptfoo-scanner
Learn more
|
Thanks for re-running the checks, @mldangelo-oai! The Would a fresh re-run of that job be possible when you have a moment? I'm also happy to merge main again if you'd rather it be up to date first. Thanks! |
|
Hi @mldangelo-oai, friendly ping on this one. The change adds an untrusted-content guard to the default |
Summary
The default
search-rubricgrader prompt (DEFAULT_WEB_SEARCH_PROMPT) had no instruction about untrusted material, even though that grader reads the evaluated output and live web search results.DEFAULT_AGENT_GRADING_PROMPTalready carries this guard. This adds an equivalent instruction to the web-search default and a regression test.Refs #10575
What changed
src/prompts/grading.ts: add one paragraph to theDEFAULT_WEB_SEARCH_PROMPTsystem message telling the grader to treat the evaluated output and retrieved web content as untrusted evidence, not to follow instructions found in that material, and not to let it change the rubric, grading criteria or required JSON format.test/matchers/search-rubric.test.ts: new test that renders the default prompt throughmatchesSearchRubricand asserts the system message contains the guard.How to verify
main(system message lacks the guard) and passes with this change.npx @biomejs/biome checkis clean on both changed files.Limits / trade-offs
This is a plain-text instruction, not structural enforcement, so it narrows the gap rather than closing it. A determined injection can still try to override it, and a custom
rubricPromptreplaces the default entirely. I kept the scope tosearch-rubriconly, since that is what the issue points at. Other default graders that read untrusted content (for example the trajectory prompts) could get the same treatment in a follow-up if maintainers want it.