Repository navigation
Closed
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/securityType security: a vulnerability or a leak
Milestone
Description
Context & Rationale
#860 split the web_fetch hardening entry (docs/ROADMAP.md, at 308a71f line 878) into four PRs and delivered PR1, the per-hop egress veto, as a v0.2.24 critical fix. This is PR4. _html_to_markdown strips only script and style and escapes nothing, so a page can inject headings and instructions into what the model reads.
Scope & Deliverables
- Deliverable:
render_untrusted_page(html, url, budget)onmarkdownify>=1.2MarkdownConverter(escape_misc=True, heading_style='ATX')andbeautifulsoup4as direct dependencies, notWebFetchLocalTool(escaping off,pydantic_ai/common_tools/web_fetch.py:121). Hand-roll only aconvert_prefence longer than any backtick run, adecompose()pass over chrome and[role=dialog], and a blank-line cut appending unusedDEFAULT_TRUNCATION_SUFFIX(config/defaults.py:331). Return markdown,truncated,token_estimate, removed regions and a provenance line from the response URL, never<base>; wrapsanitize_prompt_boundary_tagsoutput in<untrusted_web_page>; flaginjection_suspectedon ascan_texthit, without blocking. Delete_html_to_markdownand the fallback stub (common_tools.py:263-271). PR5: routeingest_remote_docsthrough it; delete_HTMLContentExtractor. - Acceptance criteria: every behaviour named above has a test that fails before the change; tests use
httpx2.MockTransportand never touch the network;uv run devops cipasses. - Constraint: the per-hop veto from fix(ai): web_fetch vetoes every redirect hop, reports failures as failures and renders pages as untrusted text #860 stays the only egress check, and a failure is never returned as page text.
Strategic Alignment
- Milestone: Backlog (no release)
- Depends on: fix(ai): web_fetch vetoes every redirect hop, reports failures as failures and renders pages as untrusted text #860 (the per-hop veto, v0.2.24).
Metadata
Metadata
Assignees
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/securityType security: a vulnerability or a leak
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(release): v0.2.24 (#905)
feat(ai): web_fetch renders pages as untrusted, escaped markdown with…
dan-petty-bot commentedon Oct 6, 2026
What changed
#1266, merged into
release/v0.2.28as 878fe3f.9 file(s) changed.
How it was verified
Check runs at a45572b:
Acceptance Criteria of
docs/agent/tasks/task-896-web-fetch-untrusted-escaped-markdown.md:No Acceptance Criteria section.
feat(release): v0.2.28 (#1283)