Skip to content

Add a resource for the deployment-wide chat system prompt #411

Closed

Description

@bpmct

Problem

The deployment-wide chat system prompt (Settings → Instructions in the dashboard, GET/PUT /api/experimental/chats/config/system-prompt) can't be managed by this provider. It's one of the most frequently-changed pieces of Coder Agents config — it's effectively the org's institutional knowledge for agents — and right now the only way to manage it as code is to curl the API from CI.

That's exactly what we do in dogfood today for cdrstable.dev: system-prompt.md lives in git, the workflow PUTs it on apply and diff-warns on drift in PR plans. It works, but it's a workaround bolted onto a Terraform module that manages everything else natively:

Everything needed already exists

  • SDK client methods are in the pinned codersdk: ExperimentalClient.GetChatSystemPrompt / UpdateChatSystemPrompt (codersdk/chats.go)
  • The provider already has singleton deployment-settings resources to copy the pattern from: coderd_oauth2_provider_settings (feat(coderd_oauth2_provider_settings): manage the OAuth2 DCR toggle #399) and coderd_default_agents_model
  • It already uses the ExperimentalClient for coderd_agents_model, with the standard "experimental, changes expected" warning

Proposed resource

resource "coderd_chat_system_prompt" "this" {
  system_prompt                 = file("${path.module}/system-prompt.md")
  include_default_system_prompt = true # append to Coder's built-in prompt rather than replace
}
  • Singleton (deployment-wide config, like coderd_oauth2_provider_settings): create/update both PUT, delete resets to empty prompt (or just forgets — open to opinions)
  • Drift shows up in plan like any other resource, replacing the hand-rolled diff step
  • Needs an owner-scoped token, same as the AI provider/model resources

Related

Generated by Coder Agents on behalf of @bpmct

Activity

  1. linear-code commented on Aug 18, 2026

    @linear-code
  2. added 4 commits that reference this issue on Aug 19, 2026
    55d5bf6
    f7e1616
    dcc83f9
    d750b12
  3. added a commit that references this issue on Aug 21, 2026
    e469690
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions