# agentbrush_edit_mask

Open a browser-based mask editor for spatial precision edits on an existing image, then block until the user accepts a result. Use this instead of agentbrush_generate when the change requires repositioning, area-specific modifications, removing or adding elements in a specific region, or any edit that text prompts alone cannot express. How it works: 1. The tool opens a browser tab where the user draws a mask over the area to modify. 2. The user describes the change and submits the edit. 3. The tool blocks while the user edits (up to 30 minutes). 4. Returns the edited image path, token cost, and remaining balance when the user accepts a result. If you want to hand the editor URL to the user and continue working while they draw, call agentbrush_edit_mask_open instead and then agentbrush_edit_mask_result to retrieve the image. Requires authentication — run agentbrush_login first if not authenticated. image_path must be an absolute path to an existing image file within the project. instruction describes what should change in the masked area (max 500 characters). quality_hint: low=1 token, medium=5 tokens (default), high=20 tokens at 1024×1024.

Agent View of the PolicyLayer registry record for `agentbrush_edit_mask`. HTML page: https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask

## Facts

- Tool: `agentbrush_edit_mask`
- Server: Mcp Server (`@agentbrush/mcp-server`) — https://policylayer.com/tools/dev-agentbrush-mcp-server.md
- Install: `npx -y @agentbrush/mcp-server`
- Homepage: https://www.npmjs.com/package/@agentbrush/mcp-server
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 3 (2 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `image_path` | string | yes | Absolute path to the image to edit |
| `instruction` | string | yes | What should change in the masked area (max 500 chars) |
| `quality_hint` | string | no | Quality level for the edit: low=1 token, medium=5 tokens (default), high=20 tokens at 1024×1024. |

Parameters from the server's own tool schema.

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

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "agentbrush_edit_mask",
    "arguments": {
      "image_path": "<image_path>",
      "instruction": "<instruction>"
    }
  }
}
```

## Why agentbrush_edit_mask is rated High

This tool triggers an external browser-based operation (opens a browser tab, blocks execution for up to 30 minutes waiting for user interaction) and produces a modified image artifact. It spans Write (modifies an existing image) and Execute (triggers browser actions and external operations). Per the rules, Execute is more severe than Write, so Execute is selected.

From the tool's own definition: "Open a browser-based mask editor... then block until the user accepts a result... The tool opens a browser tab where the user draws a mask... Returns the edited image path"

## Use case

AI agents invoke agentbrush_edit_mask to trigger actions in Mcp Server. 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 Mcp Server:

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

## Other tools on Mcp Server (11)

- `agentbrush_remove_background` — Destructive — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-remove-background.md
- `agentbrush_edit_mask_open` — Execute — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask-open.md
- `agentbrush_check_status` — Read — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-check-status.md
- `agentbrush_list_presets` — Read — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-list-presets.md
- `agentbrush_list_references` — Read — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-list-references.md
- `agentbrush_edit_mask_result` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask-result.md
- `agentbrush_generate` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-generate.md
- `agentbrush_init` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-init.md
- `agentbrush_login` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-login.md
- `agentbrush_populate_identity` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-populate-identity.md
- `agentbrush_save_as_reference` — Write — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-save-as-reference.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=dev-agentbrush-mcp-server · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dev-agentbrush-mcp-server
