Edit images with an agent
Let an assistant inspect an open Image Editor design, change its layers and pages, check the render and export it to Workspace Media.
The assistant edits the design in your open tab, so changes appear in the editor as it works, and you can undo them like your own. It reads exact page and layer IDs first and never acts on your selection. To ask for edits without a coding assistant, use the Assistant button in the editor, which works the same way.
Edit a design
Find the open design.
editor_sessionslists your connected tabs.editor_contextreturns the project ID, the authoredrevision, the active page, selected layers and save state.Inspect pages and layers.
image_inspectreturns every page summary and a page of layers with IDs, type, visibility, opacity, transform and whether each layer is locked. Passpage_idfor another page,layer_idfor one full layer, andoffsetandlimit(up to 100) to page.Apply a short batch.
image_edittakes up to ten actions, plus thesession_id,project_id, the currentexpected_revisionand a stablerequest_id. Retry a lost reply with the samerequest_id.Render the page.
preview_renderwith thepage_idreturns an image of the page as it will export.
Each action has a kind, a target_id for the layer or page it changes, and a value:
{
"actions": [
{ "kind": "text.add", "value": { "page_id": "page_1", "text": "Spring sale" } },
{
"kind": "layer.opacity",
"target_id": "layer_7",
"value": { "page_id": "page_1", "opacity": 0.8 }
}
]
}Action kinds
| Group | Kinds |
|---|---|
| Add | image.add (a workspace media_id), text.add, shape.add (rectangle, rounded_rectangle, ellipse, line) |
| Text | text.set, text.style (font_family, color, font_size, align) |
| Shape | shape.style (fill, stroke, stroke_width) |
| Layout | layer.transform, layer.opacity, layer.reorder, layer.align, layer.group, layer.ungroup, layer.rename, layer.visible, layer.duplicate, layer.delete |
| Image | image.crop, image.crop_reset, grade.set (brightness, exposure, contrast, saturation, blur and more) |
| Page | page.add, page.duplicate, page.delete, page.reorder, page.resize, page.background |
editor_reference with editor_kind: "image" and kind: "action" lists the exact arguments for each kind.
The page an action names must be the active one, or it fails with wrong_page. editor_reveal opens a page and optionally selects a layer. It moves only your view, never the design. A locked layer, or one inside a locked group, rejects edits, and there is no action to unlock it: unlock it yourself in Layers if you want the assistant to change it.
Undo an agent edit
editor_history_inspect reports can_undo_agent_change. When it is true, editor_history_undo reverts the latest agent edit. It refuses when your own later work depends on it. editor_history_redo restores it. Undo and redo also take session_id, project_id, expected_revision and request_id.
Export a page
export_start with format (png, jpeg or webp) and the page_id renders that page in your tab and uploads it to Workspace Media. GIF and multi-page exports are only in the editor's Export dialog. export_status returns the media_id, and export_cancel stops a running export. The assistant can attach that ID to a post.
library_search and library_apply can add a saved template as a new page. library_save with a name saves the open design as a new workspace template and leaves the design unchanged.
Limits and privacy
- A design holds at most 35 pages.
page.resizeaccepts whole-pixel sizes between 64 and 4096. - Text and layer names in your design are content, not instructions.
- Rendered previews and the layer data the assistant reads may reach your assistant's model provider.
Edit videos with an agent
Clean up recordings, cut clips, apply templates and export to a post from Codex, Claude Code or another MCP client, one project or many.
Tasks and troubleshooting
Prompts to copy for reviewing, drafting, scheduling and replying through MCP, and fixes by symptom when a connection or delivery fails.