# agentbrush_save_as_reference

Promote a previously-generated or mask-edited image into the project brand identity folder (.agentbrush/references/) and register it in identity.json so the agent can reuse it as a style/character reference on future agentbrush_generate calls. Typical workflow: generate a character with agentbrush_generate → optionally polish it via agentbrush_edit_mask → call agentbrush_save_as_reference with the saved file path → now every agentbrush_generate call can pass that reference path via reference_image_paths to keep the character consistent across new scenes. image_path must be an absolute path to a PNG/JPG/WebP file. Optional name becomes the stored filename (slugified). Optional tags and description surface in agentbrush_list_references output so the agent can filter later. Returns the manifest-relative path and the absolute path — both work as inputs to reference_image_paths.

Agent View of the PolicyLayer registry record for `agentbrush_save_as_reference`. HTML page: https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-save-as-reference

## Facts

- Tool: `agentbrush_save_as_reference`
- 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: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 4 (1 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | Optional human-readable slug for the stored filename. Defaults to the source filename. Letters, digits, hyphens, underscores only — anything else is replaced wi |
| `tags` | array | no | Optional tags to attach to the manifest entry so future agentbrush_list_references calls can filter by them (e.g., ["character", "protagonist"]). |
| `image_path` | string | yes | Absolute path to the image to copy into the references folder. Typically a path returned by a prior agentbrush_generate or agentbrush_edit_mask call. |
| `description` | string | no | Optional one-line description of the reference (e.g., "Protagonist Maya, default A-pose"). Surfaces in agentbrush_list_references output. |

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_save_as_reference",
    "arguments": {
      "image_path": "<image_path>"
    }
  }
}
```

## Why agentbrush_save_as_reference is rated Medium

This tool creates and modifies data (files in .agentbrush/references/ and entries in identity.json) in a reversible manner. It does not execute arbitrary code, delete data, or move money. The scope is limited to registering image references within a local project structure.

From the tool's own definition: "The tool 'Promote a previously-generated or mask-edited image into the project brand identity folder (.agentbrush/references/) and register it in identity.json' — explicitly writes/creates files and modifies the identity.json configuration to persist a…"

Risk signals: Bulk/mass operation — affects multiple targets

## Use case

AI agents use agentbrush_save_as_reference to create or update resources in Mcp Server, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Mcp Server environment.

## 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_save_as_reference": {
      "limits": [
        {
          "counter": "agentbrush_save_as_reference_rate",
          "window": "minute",
          "max": 30,
          "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` — Execute — https://policylayer.com/tools/dev-agentbrush-mcp-server/agentbrush-edit-mask.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

## 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
