# execute_script

Execute JavaScript code in the browser tab

Agent View of the PolicyLayer registry record for `execute_script`. HTML page: https://policylayer.com/tools/browser/execute-script

## Facts

- Tool: `execute_script`
- Server: Browser (`mcp-server-browser`) — https://policylayer.com/tools/browser.md
- Install: `npx -y mcp-server-browser`
- Homepage: git+https://github.com/mvtcode/mcp-server-browser.git
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "execute_script",
    "arguments": {}
  }
}
```

## Why execute_script is rated High

This tool permits running arbitrary JavaScript in a browser context, which can modify DOM, exfiltrate data, trigger network requests, interact with local storage, and perform any action a malicious script could execute. The blast radius is extremely broad—an AI agent given this tool could compromise user data, perform unauthorized transactions, hijack sessions, or chain attacks via the browser.

From the tool's own definition: "Tool name 'execute_script' and description 'Execute JavaScript code in the browser tab' explicitly indicate arbitrary code execution capability."

## Use case

AI agents invoke execute_script to trigger actions in Browser. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Browser:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "execute_script": {
      "limits": [
        {
          "counter": "execute_script_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Browser (18)

- `close_tab` — Destructive — https://policylayer.com/tools/browser/close-tab.md
- `new_tab` — Execute — https://policylayer.com/tools/browser/new-tab.md
- `pin_active_tab` — Execute — https://policylayer.com/tools/browser/pin-active-tab.md
- `set_active_tab` — Execute — https://policylayer.com/tools/browser/set-active-tab.md
- `set_url_tab` — Execute — https://policylayer.com/tools/browser/set-url-tab.md
- `get_active_tab` — Read — https://policylayer.com/tools/browser/get-active-tab.md
- `get_console_debug` — Read — https://policylayer.com/tools/browser/get-console-debug.md
- `get_console_error` — Read — https://policylayer.com/tools/browser/get-console-error.md
- `get_console_info` — Read — https://policylayer.com/tools/browser/get-console-info.md
- `get_console_log` — Read — https://policylayer.com/tools/browser/get-console-log.md
- `get_console_warn` — Read — https://policylayer.com/tools/browser/get-console-warn.md
- `get_list_tab` — Read — https://policylayer.com/tools/browser/get-list-tab.md
- `get_network_request` — Read — https://policylayer.com/tools/browser/get-network-request.md
- `get_network_request_detail` — Read — https://policylayer.com/tools/browser/get-network-request-detail.md
- `get_tab_content_html` — Read — https://policylayer.com/tools/browser/get-tab-content-html.md
- `get_tab_content_text` — Read — https://policylayer.com/tools/browser/get-tab-content-text.md
- `query_selector` — Read — https://policylayer.com/tools/browser/query-selector.md
- `unpin_active_tab` — Write — https://policylayer.com/tools/browser/unpin-active-tab.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=browser · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/browser
