fix(citation-guard): enforce trusted documentation hosts - #898
Draft
langsmith-engine-dev[bot] wants to merge 1 commit into
Draft
langsmith-engine-dev[bot] wants to merge 1 commit into
langsmith-engine-dev[bot] wants to merge 1 commit into
Conversation
Citation footer validation previously trusted any hostname and ignored the Invalid links section, while a repair response could bypass validation. Add the citation host allowlist, reject invalid check-links results, validate every response through two bounded retries, and remove any surviving invalid footer citations. Clarify the same provenance rules in both documentation prompts and add focused regression tests for user-supplied, stale, invalid, and retry citations.\n\nVerified with: .venv/bin/ruff check src/middleware/citation_guard_middleware.py tests/unit/test_docs_research_guard_middleware.py\nVerified with: .venv/bin/pytest -q tests/unit/test_docs_research_guard_middleware.py (15 passed)\nThe existing prompt module's unrelated D100 lint finding was not changed.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
LangSmith preview deployment failed.
|
|
LangSmith preview deployment is ready.
This preview is ready for the current PR commit. |
|
LangSmith preview deployment was torn down.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Citation footer validation previously trusted any hostname and ignored the Invalid links section, while a repair response could bypass validation. Add the citation host allowlist, reject invalid check-links results, validate every response through two bounded retries, and remove any surviving invalid footer citations. Clarify the same provenance rules in both documentation prompts and add focused regression tests for user-supplied, stale, invalid, and retry citations.\n\nVerified with: .venv/bin/ruff check src/middleware/citation_guard_middleware.py tests/unit/test_docs_research_guard_middleware.py\nVerified with: .venv/bin/pytest -q tests/unit/test_docs_research_guard_middleware.py (15 passed)\nThe existing prompt module's unrelated D100 lint finding was not changed.
Opened from a LangSmith Engine issue, which has the diagnosis and the traces that surfaced it.