Skip to content

fix(citation-guard): enforce trusted documentation hosts - #898

Draft
langsmith-engine-dev[bot] wants to merge 1 commit into
vishnu/mda-github-deploymentfrom
issues-agent/4a4c7d1a-2738-450f-9b1e-c0511e44dbd3
Draft

langsmith-engine-dev[bot] wants to merge 1 commit into
vishnu/mda-github-deploymentfrom
issues-agent/4a4c7d1a-2738-450f-9b1e-c0511e44dbd3

Conversation

@langsmith-engine-dev

Copy link
Copy Markdown
Contributor

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.

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.
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
chat-langchain Ready Ready Preview Sep 14, 2026 11:45pm UTC
chat-langchain-on-mda Ready Ready Preview Sep 14, 2026 11:45pm UTC

Request Review

@hosted-langserve-dev

hosted-langserve-dev Bot commented Sep 14, 2026

Copy link
Copy Markdown

LangSmith preview deployment failed.

@hosted-langserve

hosted-langserve Bot commented Sep 14, 2026

Copy link
Copy Markdown

LangSmith preview deployment is ready.

This preview is ready for the current PR commit.

@hosted-langserve

hosted-langserve Bot commented Sep 14, 2026

Copy link
Copy Markdown

LangSmith preview deployment was torn down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants