---
title: "Copilot Field"
description: "Single-field generation with locked prompts and auto file context, for image alt text, captions, and editorial workflows."
canonical_url: "https://kirby.tools/docs/copilot/usage/field"
---

# Copilot Field

> Single-field generation with locked prompts and auto file context, for image alt text, captions, and editorial workflows.

The Copilot field provides a dedicated interface for generating content for another field of the same blueprint. Unlike the [Panel view button](/docs/copilot/usage/view-button) which targets multiple fields at once, the Copilot field focuses on a single field with additional features: persistent prompts saved between sessions, immutable prompts for locked workflows, and automatic file context on file pages.

<tip icon="i-ri-image-line">

**File Pages**: Use `files: auto` to include the current image as context, for alt text, captions, or descriptions.

</tip>

## Basic Setup

Add a Copilot field to any blueprint by specifying the target field:

```yaml [pages/default.yml]
fields:
  blocks:
    label: Content
    type: blocks

  copilot:
    type: copilot
    field: blocks
```

The field renders like this:

<panel-mock>
<panel-copilot-field>



</panel-copilot-field>
</panel-mock>

Enter your prompt and click **Generate**, or press <kbd value="meta">



</kbd>

 <kbd value="enter">



</kbd>

 / <kbd value="CTRL">



</kbd>

 <kbd value="enter">



</kbd>

. While a generation runs, **Generate** turns into **Stop**:

<panel-mock>
<panel-copilot-field userPrompt="Summarize the attached brief in five points." :fileNames="["brief.pdf"]" :isGenerating="true">



</panel-copilot-field>
</panel-mock>

The Copilot field adds to the target field's content and never overwrites it.

## Prompts and Undo

### Reset Prompt

If you've modified a predefined prompt, click **Reset prompt** (circular arrow icon) to restore the original.

### Undo Generation

After generating content, an **Undo** button appears to revert to the previous content.

### Dynamic Prompts With KQL

A [Kirby query](/docs/copilot/configuration/local#userprompt) in `userPrompt` or `systemPrompt` lets content editors define their own prompt in a dedicated field:

```yaml
fields:
  copilot:
    type: copilot
    field: blocks
    userPrompt: "{{ page.customPrompt.value }}"
```

## Configuration Reference

The Copilot field takes every [view button property](/docs/copilot/configuration/local#view-button-properties), plus the following:

<callout color="info" icon="i-ri-keyboard-line" to="/docs/copilot/advanced/reference#keyboard-shortcuts">

See the **Quick Reference** for all keyboard shortcuts.

</callout>

### `field` <u-badge className="align-middle,ml-2,rounded-full!" label="String" variant="subtle"></u-badge>

**Required.** Specifies which field to generate content for. This should be the name of a field defined in the same blueprint.

The Copilot field works only among the top-level fields of a blueprint. Inside a blocks, layout, structure, or object field, it shows an error instead.

The target is a `blocks`, `layout`, `list`, `text`, `textarea`, or `writer` field – for any other type, use the [view button](/docs/copilot/usage/view-button).

```yaml
fields:
  copilot:
    type: copilot
    field: blocks
```

### `editable` <u-badge className="align-middle,ml-2,rounded-full!" label="Boolean" variant="subtle"></u-badge>

Control whether users can edit the prompt. Setting it to `false` is useful if a specific `userPrompt` should always be used without modifications.

**Default:** `true`

```yaml
fields:
  copilot:
    type: copilot
    field: content
    userPrompt: Write a technical guide about "{title}". Include an introduction, step-by-step instructions, and a summary.
    editable: false
```

<panel-mock>
<panel-copilot-field :editable="false">



</panel-copilot-field>
</panel-mock>

### `files` <u-badge className="align-middle,ml-2,rounded-full!" label="Boolean | String" variant="subtle"></u-badge>

This property enables file attachments for providing context to the AI model.

**Default:** `true`<br />

**Options:** `true`, `false`, `"auto"`

To disable file attachments and prevent users from adding files, set the `files` property to `false`:

```yaml
fields:
  copilot:
    type: copilot
    field: blocks
    files: false
```

<panel-mock>
<panel-copilot-field :files="false">



</panel-copilot-field>
</panel-mock>

On a Kirby file page, setting `files: auto` pre-selects the **current file as context** for the user prompt. This is useful for generating metadata like alternative text based on the image that has already been uploaded to the Panel:

```yaml [files/image.yml]
columns:
  - width: 2/3
    fields:
      alt:
        label: Alternative Text
        type: text

  - width: 1/3
    fields:
      copilot:
        type: copilot
        field: alt
        # Use the uploaded file as context
        files: auto
        # Optional: Provide a predefined user prompt
        userPrompt: Describe this image for alternative text. Include key features, colors, and context. Max 125 characters.
        # Optional: Disable the editing of the user prompt
        editable: false
```

<panel-mock>
<panel-copilot-field :editable="false" userPrompt="Describe this image for alternative text. Include key features, colors, and context. Max 125 characters." files="auto">



</panel-copilot-field>
</panel-mock>

Only images are attached this way – `avif`, `gif`, `jpeg`, `png`, and `webp`. On a file of any other type, including PDF, the Copilot field shows a note that the type is not supported as context. Unlike `files: true`, `auto` does not add the file picker, so the user cannot attach a different file instead.

<tip>

Learn more about working with files on the dedicated [File Attachments](/docs/copilot/prompt-dialog/files) page.

</tip>

### `storage` <u-badge className="align-middle,ml-2,rounded-full!" label="Boolean" variant="subtle"></u-badge>

Enable or disable local storage for saving user prompts in the browser. When enabled, prompts are remembered between sessions. The storage is keyed by the Panel view and the target field, so the same Copilot field keeps its prompt per page – and two Copilot fields writing to the same field on the same page share one entry.

**Default:** `true`

```yaml
fields:
  copilot:
    type: copilot
    field: content
    storage: false
```

### `help` <u-badge className="align-middle,ml-2,rounded-full!" label="String" variant="subtle"></u-badge>

Provide additional help text or instructions for the Copilot field.

```yaml
fields:
  copilot:
    type: copilot
    field: blocks
    help: |
      Example: Write a summary of this page and include the contents of {blocks}.
```

---

Every page of this site as Markdown: <https://kirby.tools/sitemap.md>
