bruteSourceBruteMiddlewareSystemPrompt

class SystemPrompt

Prepends a system message to env[:messages] before passing control down the middleware chain.

By default, uses Brute::SystemPrompt.default which assembles a provider-specific prompt stack (Identity, ToneAndStyle, ToolUsage, etc.) from the Brute::Prompts modules and text files.

Pass a custom Brute::SystemPrompt instance to override — useful for SubAgents that need a specialized prompt (e.g. the explore agent prompt):

use Brute::Middleware::SystemPrompt, system_prompt: Brute::SystemPrompt.build { |p, _ctx| p.append Brute::Prompts.agent_prompt("explore") }

Skips injection when env[:messages] already contains a :system message (e.g. from session.system(...)), so manually-set system prompts are respected.