Skip to content

Improvement: Consolidate system prompt prefix and suffix into one field #2793

Description

@yannickmonney

Problem

Governance “system prompt” is split into a mandatory prefix and mandatory suffix. Authors think in one wrap-around policy text; two fields add friction without a clear product win.

Current behaviour

  • Schema: systemPromptConfigSchema with mandatoryPrefixPrompt + mandatorySuffixPrompt (lib/shared/schemas/governance.ts, policy system_prompt).
  • Builtin / fixtures: builtin-configs/governance/system-prompt.json, e2e docs-demo fixture.
  • UI: SystemPromptEditor — two FormSection + textareas; copy keys governance.systemPrompt.prefixLabel|suffixLabel|….
  • Runtime: fetchGovernanceSystemPrompt → prepend prefix / append suffix around agent instructions (governance_prompt.ts, internal_actions.ts, openai-compat path).
  • E2E: governance.spec.ts (systemPromptPrefixField).

Proposed change

  • Consolidate to a single system-prompt field in schema, org config, and the governance editor.
  • Define apply semantics once (e.g. entire string prepended, or a documented wrap convention) and migrate existing prefix+suffix pairs into that field without dropping content (versioned org-config / data migration as required by migrations:check).
  • Update i18n, docs, and e2e selectors.

Acceptance criteria

  • Governance UI shows one system-prompt field; prefix/suffix controls are gone.
  • Existing orgs keep equivalent effective prompt text after migration (prefix+suffix content preserved).
  • Chat / openai-compat paths apply the single field consistently.
  • Locales, builtin config, fixtures, and e2e updated; migrations:check / config gates green.

Affected service

Platform (web app)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions