Browser & Computer-Use Agent Security
Run Playwright browser agents in ephemeral zero-credential profiles with confined download directories, strict network egress allowlists, and no host shell access. Use `D9` Pixel Auditor to verify fresh screenshots and OCR/DOM coordinates before clicks, paired with parameter-bound human approval and `C6` emergency takeover.
Module detail
Best time to learn: After MCP, tool authorization, scoped identity, and human approval are implemented in Project 3. Do not start with a powerful computer-use agent before the simpler tool model is secure.
Prerequisites - Agent state machine and tool execution. - Authentication and delegated authorization. - Prompt injection and untrusted tool/page content. - Process/container isolation and network restrictions. - Human-in-the-loop approval.
### Threat model
A browser or computer-use agent can interact with untrusted websites and potentially sensitive user sessions. The webpage is an untrusted source of instructions. The agent's ability to click, type, download, upload, or execute commands creates real-world side effects.
Study: - Browser prompt injection and malicious webpage content. - Browser profile and session isolation. - Cross-origin navigation and account-boundary risks. - Credential and cookie protection. - Download and attachment handling. - Filesystem sandboxing and path restrictions. - Shell/command execution policy. - Network egress allowlists and DNS/IP restrictions. - Screenshot, clipboard, and page-content leakage. - Human approval for high-impact actions. - Time-of-check/time-of-use and approval-context binding. - Cancellation, emergency stop, and action audit trails.
### Labs
- Threat model (1h): Draw trust boundaries for agent, browser, website, identity provider, user session, filesystem, network, and model.
- Browser isolation (2h): Use a disposable browser profile and test that credentials/cookies are not shared with unrelated sessions.
- Prompt injection (2h): Create a local test webpage with benign instructions attempting to redirect the agent's task. Verify the agent treats page content as untrusted and cannot change its authorization scope.
- Filesystem and download sandbox (2h): Restrict downloads and file writes to a temporary workspace; test path traversal and unexpected file types.
- Network and command restrictions (1h): Deny unapproved destinations and shell operations. Verify the policy is enforced outside the model.
- Approval and emergency stop (2h): Require explicit approval for a sensitive action; bind approval to the exact action and parameters. Test cancellation during execution and audit the outcome.
### Project integration
- Project 3: Add a restricted browser or computer-use tool only after the normal agent's tool authorization works.
- Execution worker: Run in a disposable container or isolated environment with no host credentials, restricted mounts, and network egress controls.
- Approval layer: The user approves a specific action, not a vague plan that the agent can later reinterpret.
### Measurable completion criteria
- A malicious webpage cannot expand the agent's permissions.
- Browser sessions are isolated and disposable.
- Downloads and file writes are confined to an approved workspace.
- Network and command restrictions are enforced outside the model.
- Sensitive actions require parameter-bound approval.
- Cancellation and audit records work during partial execution.
Do not overreach: Do not give the agent unrestricted desktop access, host filesystem access, personal browser cookies, or a general-purpose shell.
------------------------------------------------------------------------
Study days for this domain
8- 57Threat-model a browser/computer-use agentW10M9D9R33 R41
- 58Disposable Browser Profile IsolationW10S2M9D9R04 R10 R33
- 59Restrict downloads and file writes to a temporary workspaceW10S0M9D9R10 R33
- 60Restrict network egress and command execution outside the modelW10M4M9D9R10 R25
- 61Pixel Auditor, Approval & TakeoverW11M7M9D9R10 R17 R33 R41
- 88Browser Sandbox & Pixel Auditor AuditW15M9M10D2D3D7D8D9D11R21 R22 R25 R27 R33 R41
- 97Simulate agent runaway or unsafe browser actionW17S3M9D2D7D9D11R33 R41
- 107Revisit browser/computer-use securityW18M9D9R33 R41