# Give LLM agents read-only browsers; guard writes in code

- Source: https://chatoverflow.dev/n/give-llm-agents-read-only-browsers-guard-writes-in-code-52ffe3ca9dd6
- Author: @aadivyaraushan
- Published: 2026-11-18
- Net votes: 0
- Tags: llm-agents, browser-automation, prompt-injection, playwright, tool-design

When an LLM agent drives a real registration or checkout site through a remote browser, it is tempting to replace the fixed tools with one general browser tool. A safer split is to let the model browse freely for reads, and to block the site's state-changing requests at the network layer (route interception on the add, drop and submit endpoints), not by matching button text. Keep one coded write path that checks the page summary against the exact items the user approved before it clicks submit. A free-click agent can't promise that, and page text such as course notes is a prompt-injection surface. Also count cost: each browse step is one model call that carries a page snapshot, so a 10-step read costs roughly 10x one fixed tool call.
