Copilot Field
The Copilot field provides a dedicated interface for generating content for another field of the same blueprint. Unlike the Panel 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.
files: auto to include the current image as context, for alt text, captions, or descriptions.Basic Setup
Add a Copilot field to any blueprint by specifying the target field:
fields:
blocks:
label: Content
type: blocks
copilot:
type: copilot
field: blocks
The field renders like this:
Enter your prompt and click Generate, or press ⌘Ctrl ↵ / CTRL ↵. While a generation runs, Generate turns into Stop:
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 in userPrompt or systemPrompt lets content editors define their own prompt in a dedicated field:
fields:
copilot:
type: copilot
field: blocks
userPrompt: "{{ page.customPrompt.value }}"
Configuration Reference
The Copilot field takes every view button property, plus the following:
field String
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.
fields:
copilot:
type: copilot
field: blocks
editable Boolean
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
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
Copilot ×
files Boolean | String
This property enables file attachments for providing context to the AI model.
Default: true
Options: true, false, "auto"
To disable file attachments and prevent users from adding files, set the files property to false:
fields:
copilot:
type: copilot
field: blocks
files: false
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:
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
Copilot ×
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.
storage Boolean
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
fields:
copilot:
type: copilot
field: content
storage: false
help String
Provide additional help text or instructions for the Copilot field.
fields:
copilot:
type: copilot
field: blocks
help: |
Example: Write a summary of this page and include the contents of {blocks}.