8000 feat(assistant): ask before the browser opens or types what the assistant wrote after reading a page by adeelahmad · Pull Request #333 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content 8000

feat(assistant): ask before the browser opens or types what the assistant wrote after reading a page - #333

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-mr9hx9
Oct 10, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-mr9hx9

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: once the assistant was using your browser (#330), a poisoned page or email could tell it to open https://some-allowed-site/?d=<what it read>, or to type your notes into a field, and on a site you had already allowed that happened without asking.

After: once an answer has read a page, an email or any other text from outside Lens, the side panel asks before opening or downloading an address, or typing text, that you didn't write yourself. That holds on sites you allowed too. The card shows the address or the text and why: "Open evil.example? https://evil.example/?d=42. Asked because this answer read text from outside Lens: tool browser_read." Clicking links, importing them by ref, and typing words from your own message don't ask. Ask before sending data out after reading third-party text (ai.untrusted_asks, from #309) turns it off.

How: Toolbox._browse adds confirm (the reason) to open, type and import-by-address actions when Toolbox.wary() and the text or address isn't in the person's own message (never when it came from a chat room open to anyone). The extension's Hands asks the person first whenever confirm is set (vouch). The browser NOTE tells the model to prefer refs, so routine browsing stays one click.

Motivation and Context

This follows up #309 (prompt injection: ask before sending data out) and #330 (browser control), as the prompt-injection thread asked: navigation to addresses the model built counts as sending out once the answer is wary.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (ruff check and format are clean).
  • I added or updated tests. tests/api/test_browser.py covers which actions carry confirm and turning it off; 64 tests in the chat, bridge, extension, assistant, browser and injection suites pass. The Edge smoke test checks that No keeps an address from opening and Yes types; it passes locally in Chromium.
  • My change requires documentation updates, and I have updated docs/ accordingly (docs/browser-assistant.md, docs/assistant.md); mkdocs build --strict is clean.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Done questions (AGENTS.md)

  • Goal: closes the browser exfiltration path the prompt-injection series named. It merges on green.
  • Agents: confirm is part of the action's args on the documented API, so another side panel can honour it.
  • Zero setup: on by default, nothing to install.
  • Fewest clicks: it asks only for addresses and text the person didn't write, after outside text was read. Links and refs stay instant.
  • Configurable: the existing ai.untrusted_asks setting in Settings → AI assistant.
  • Light: a string check per action, no model call.
  • Private and secure: P-BROWSER-GUARD is updated in md, yaml and json, including what voids it (an extension older than confirm doesn't ask).
  • Cost: no extra model calls.
  • User decides: this is the point.
  • Upgrades: n/a, no stored data changes.
  • Honest: the docs say what asks and what doesn't.
  • Tests and docs updated. No generated files are touched; the API shape is unchanged.
  • Open standards: n/a; no new dependencies.
  • Refine later (in DEVLOG.md): Lens checking that the extension asked.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PhTrpdr3XSgcD91oFxAiMQ


Generated by Claude Code

…tant wrote after reading a page

Once an answer has read text from outside Lens (Toolbox.wary(), #309), an
address to open or download and text to type that the person didn't write
themselves go to the side panel with confirm (why), and the panel asks for a
yes first, on allowed sites too. Links and clicks by ref don't ask.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PhTrpdr3XSgcD91oFxAiMQ
@adeelahmad
adeelahmad merged commit 100c065 into 8000 main Oct 10, 2026
16 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-mr9hx9 branch October 10, 2026 22:56
adeelahmad added a commit that referenced this pull request Oct 10, 2026
…PRs (#335)

The README and Get started say the web installer can install with the defaults in one click (#331). "In progress"
adds flagging instruction-like third-party text (#329), asking before the browser acts on what the assistant wrote
(#333) and cloud model presets (#334).


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
adeelahmad added a commit that referenced this pull request Oct 11, 2026
…349)

"Stay private and safe" now covers flagging instruction-like text (patterns or the optional local classifier, #329,
#347), asking before the browser acts on what the assistant wrote (#333), breaking up links in chat-room answers
(#338), the archive as data over MCP (#343) and the audit log of what was caught (#344). "See what it costs" adds the
overall budget asked for in setup (#281). "In progress" drops what merged and adds #337, #341 and #346.


Claude-Session: https://claude.ai/code/session_01HDx7PPUauyjMn1LZs8JAsS

Co-authored-by: Adeel Ahmad <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0