Skip to content

feat(vision): a citizen can look at her own website: vision/look takes an http(s) url (card 92413965) - #4539

Closed
joelteply wants to merge 4 commits into
canaryfrom
feat/she-can-see-her-own-site
Closed

joelteply wants to merge 4 commits into
canaryfrom
feat/she-can-see-her-own-site

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Card 92413965, from the web-dev plumbing audit for Kimi's career-wrangler work. Designer and QA roles have to see the rendered site. interface/capture renders localhost but returns only a PNG path and isn't in her hands.

vision/look (native) now takes an optional url alongside file_path. The page is rendered by the same web capture a builder uses, scoped to her, then looked at through her own vision bridge in one act. It adds one optional field to an existing tool rather than a new tool on a surface near its token ceiling.

LookAt::try_from enforces exactly one target. A url must be http(s): the renderer runs as the core, and a file:// url would reach host files outside her workspace. The test lives in the existing mod.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…s an http(s) url (card 92413965)

Web-dev audit for Kimi's career-wrangler work: interface/capture renders
any page, localhost included, but returns only a PNG path and is not in
her hands, so a designer or QA citizen could not see the site she is
building. vision/look (native, AiSafe) now takes `url` as well as
`file_path`: the page is rendered by the same web capture a builder uses,
scoped to her, and looked at through her own vision bridge, one act. This
reuses an existing native verb with one optional field instead of adding a
second tool to the surface.

LookAt::try_from(&VisionLookParams) takes exactly one target. A url is
http(s) only, because the renderer runs as the core and a file:// url
would reach host files outside her workspace; both or neither is refused
with the fix named. Test in the existing mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits September 28, 2026 12:05
@joelteply

Copy link
Copy Markdown
Contributor Author

Approved at 5606ffd (Cormac). CI 8/8 success at this head.

It's the right shape. LookAt makes "exactly one of a file or a page" a type rather than a pair of options. The page goes through the same interface/capture a builder uses and is then looked at exactly like a file, which is one sight path. file:// is refused, and the test pins it along with the both/neither cases. Keeping file_path optional doesn't break existing callers.

Non-blocking, for follow-up cards:

  • Internal URLs: the renderer runs as the core, so an http(s) URL also reaches whatever the core can reach: its own local ports, the LAN, and, once this runs on AWS, the instance metadata at 169.254.169.254. The same reasoning that refuses file:// applies. Loopback is what she needs (her dev server), so allowing loopback and her leased ports (feat(ports): citizens lease ports for their services, clear of each other's and of Continuum's own (card 0c42c0bf) #4540, ports/list) while refusing link-local and private ranges would close it without costing her anything.
  • Unscoped file_path (existing, not from this PR): the path is read with std::fs as given, not resolved against her workspace root the way code/read is, so an absolute path outside her workspace is read too. The doc says "as for code/read", so resolving it through the same root would make that true.
  • Tiny: HTTP:// in upper case is refused by the prefix check. url::Url::parse plus a scheme match would take any case.

…other host from the core's position (Cormac on #4539)

The renderer runs as the core, so an arbitrary http(s) url could reach
internal endpoints and cloud metadata. A url is now accepted only when its
host is localhost, 127.0.0.1 or [::1] (her dev server); userinfo-disguised
hosts are refused; a public page stays web/fetch's job. Narrowing further
to her leased ports follows once #4540 lands. Test extended in the
existing mod.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Approved at 3acd33d (Cormac). CI success on every build and test check at this head (the WIP label check is the only one absent).

is_loopback_page closes the note, and it fails closed. I checked the usual bypasses against it:

  • look-alike hosts (localhost.evil.com, 127.0.0.1.nip.io) don't match exactly and are refused;
  • a userinfo @ is refused outright, and so is localhost\@evil.com, since the @ is still in the authority;
  • percent-encoded or upper-case forms and private or link-local IPs are refused;
  • [::1] is accepted.

One residual for the leased-ports follow-up, not blocking: the renderer follows redirects, so a page on localhost can still redirect it off the machine. It's her own dev server, so the risk is low, but pinning navigation to loopback in the capture (refusing a redirect to another host) would make the check hold end to end.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity. Please comment or update this PR to keep it active.

@github-actions github-actions Bot added the stale label Oct 29, 2026
@github-actions

Copy link
Copy Markdown

This PR was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions Bot closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant