Skip to content

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

Closed

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)

Activity

  1. yannickmonney commented on Sep 27, 2026

    @yannickmonney
    ContributorAuthor

    Fixed by #2857: a single mandatoryInstructions field (packages/shared/src/schemas/governance.ts) replaced the prefix/suffix pair, and effectiveMandatoryInstructions folds legacy values into it. The editor has one textarea and drops the legacy pair on save, and chat applies the field (backend/core/chat/guardrails.ts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions