System Prompt

Learn how the default system prompt works and when to customize it.

While the user prompt instructs the AI model what to generate, the system prompt instructs the AI model how to generate content. It provides structural guidance for the generation process.

Default System Prompt

Kirby Copilot ships with a well-crafted system prompt that handles most use cases out of the box. Manual customization is rarely necessary.

The default prompt automatically adapts to:

  • The target field type (plain text, Markdown, or rich-text)
  • Selected text in writer or textarea fields (preserved as context)
  • Attached files like PDFs (text is extracted when files exceed 50 MB)
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.
- "rich-text": Use double newlines to separate paragraphs. For inline formatting, use HTML tags (<strong>, <em>, <code>, <a href="...">, etc.). Do NOT wrap paragraphs in <p> tags.

When <selection> is provided, use it as context for your response. Preserve any formatting (bold, italic, links, etc.) present in the selection unless the task explicitly requires different formatting.

Response Formats

The response format is determined automatically based on how you trigger AI generation:

TriggerResponse FormatDescription
textarea toolbar buttonmarkdownRaw Markdown without code fences
writer toolbar marktextPlain text only
blocks / layout fieldsSchema-based generation (no format directive)
For blocks and layout fields, Copilot uses schema-based object generation, which supports all custom block types defined in your project.

Customizing the System Prompt

In most cases, the default system prompt is sufficient. To override it globally:

config.php
return [
    'johannschopplich.copilot' => [
        'systemPrompt' => 'Your custom system prompt here…'
    ]
];

You can also override the system prompt per blueprint in view button configurations.

Inline Suggestions Prompt

The inline suggestions feature uses a separate, lightweight system prompt optimized for inline text suggestions. This prompt cannot be customized:

You are a writing assistant providing inline autocompletions.

RULES:
- Output ONLY the continuation text, NEVER repeat input
- Keep completions brief (1-2 sentences max)
- Match the existing tone and style
- No explanations or meta-commentary

FORMAT:
- If given <prefix> and <suffix> tags, insert text that bridges them naturally
- Otherwise, continue the text directly

EXAMPLE:
Input: "The quick brown fox"
Output: " jumps over the lazy dog."