Repository navigation
Closed
Description
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:
- https://github.com/coder/dogfood/blob/main/coderd-stable/README.md#system-prompt (see "System prompt" — the README already says to fold this into the module "when a
coderdresource for the system prompt ships") - Workflow steps: https://github.com/coder/dogfood/blob/main/.github/workflows/coderd-stable.yaml
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) andcoderd_default_agents_model - It already uses the
ExperimentalClientforcoderd_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 bothPUT, delete resets to empty prompt (or just forgets — open to opinions) - Drift shows up in
planlike any other resource, replacing the hand-rolled diff step - Needs an
owner-scoped token, same as the AI provider/model resources
Related
- docs: add "Manage the system prompt as code" recipe under ai-coder/agents/platform-controls/ coder#28090 — docs recipe for managing the system prompt as code; the "Follow-up" section there is this issue
- coder/dogfood#400 — the IaC PR that currently ships the workflow-PUT workaround
- Possibly overlaps with PRODUCT-373 (expose agent settings in the coderd Terraform provider) in Linear
Generated by Coder Agents on behalf of @bpmct
Metadata
Metadata
Assignees
Labels
No labels
Activity
linear-code commentedon Aug 18, 2026
ENG-3245
feat(coderd_chat_system_prompt): manage the deployment-wide chat syst…
feat(coderd_chat_system_prompt): manage the deployment-wide chat syst…
feat(coderd_chat_system_prompt): manage the deployment-wide chat syst…
feat(coderd_chat_system_prompt): manage the deployment-wide chat syst…
feat(coderd_chat_system_prompt): manage the deployment-wide chat syst…