System Prompt

Configure the default system prompt for the AI model.

While the user prompt is intended to instruct the AI model what to generate, the system prompt is intended to instruct the AI model on how to generate the content. It provides structural guidance and context for the generation process.

Default System Prompt

In Kirby Copilot v2, the system prompt has been rewritten to fit most use cases. Manual customization is usually not necessary anymore. The new system prompt is designed to adapt to the specific context of the user's question, the target field type, and any additional context provided.

When a user submits a prompt, the AI model receives the following information:

  • The selected text of writer or textarea fields.
  • Optional extracted text from PDF documents (if appended PDF files exceed 50 MB, otherwise they are sent natively to the AI model).

If you don't provide a systemPrompt, the plugin will use the following default prompt:

You are a content assistant.

When <response_format> is provided, format your response as:
- "text": Plain text only, no formatting syntax.
- "markdown": Raw Markdown, no code fence wrappers.
- "HTML": Only body-level tags (<p>, <h2>, <ul>, <a>, etc.), no <html>/<body>.

When <selected_text> is provided, use it as context for your response.

Response Formats

Copilot Section

The response format is set by the Kirby Copilot plugin, depending on which Kirby field type is the target for the generated text:

  • If the target field is of type writer, the response format is set to HTML.
  • If the target field is a textarea, the response format is set to markdown.
  • In all other cases, the response format is set to text.
The response format is not set for blocks and layout fields, since Copilot uses schema-based object generation for these field types. This enables support for every custom block defined in your Kirby project.

Writer/Textarea Buttons

The response format is determined by the button that was clicked to open the Copilot prompt dialog:

  • If the prompt is sent from the textarea field Copilot button, the response format is set to markdown.
  • If the prompt is sent from the writer field Copilot mark, the response format is set to text.

Customizing the System Prompt

In most cases, the default system prompt is sufficient. However, you can customize the system prompt in your global Kirby configuration:

config.php
return [
    'johannschopplich.copilot' => [
        'systemPrompt' => '<prompt override>'
    ]
];