Repository navigation
Description
Summary
Add a new docs page under docs/ai-coder/agents/platform-controls/ that documents the pattern of managing the Coder Agents deployment-wide system prompt (and, more broadly, AI providers/models) as code — with PR review, CI-driven deploys, and drift detection — instead of clicking it into the dashboard.
We already run this pattern in production on cdrstable.dev via coder/dogfood, but it's currently only discoverable if you happen to know to look in that repo. Prospects and customers asking "how do we govern the system prompt at enterprise scale?" have no docs page to land on.
Why
The existing docs cover the what well:
- Getting Started → Set a deployment-wide system prompt
- Platform Controls → System prompt
- Best Practices → Provide Agents with Proper Context
…but none of them show the how for a team that wants to manage the prompt like any other production config. Enterprise prospects consistently ask for this — it's the natural first-step answer to "how do we bring institutional knowledge into agents and govern it?"
Reference implementation (already in production)
We should link to and summarize the dogfood pattern:
- Pattern / IaC scaffolding:
coder/dogfood→coderd-stable/README.md - Worked example prompt:
coder/dogfood→coderd-stable/system-prompt.md
Key elements of the pattern worth documenting:
system-prompt.mdlives in a git repo, deployed byte-for-byte viaPUT /api/experimental/chats/config/system-promptfrom CI (listed in.prettierignoreso formatters don't rewrite it).include_default_system_prompt: truekeeps Coder's built-in prompt and appends the custom text.- Providers and models are managed via the
coder/coderdTerraform provider with S3 remote state. - GitHub Actions:
terraform planon PRs (with a diff of the live system prompt for drift detection),terraform apply+ promptPUTon merge tomain. - OIDC-authed CI roles scoped to state read (plan) vs. state write (apply).
- Write-only API keys (
api_key_wo+api_key_wo_version) so live secret values are preserved across applies. - Drift caught in PR review: changes made in the dashboard show up in the next plan and get reverted on apply unless promoted into the config.
Proposed page
- Path:
docs/ai-coder/agents/platform-controls/system-prompt-as-code.md(open to a better name — e.g.manage-system-prompt-as-code.md) - Suggested sections:
- Why manage the system prompt as code (audit, review, rollback, drift detection)
- Repo layout (a
system-prompt.md+ a thin Terraform module for providers/models) - Deploying the system prompt via API
PUTfrom CI (with a minimal working example) - Managing providers and models with the
coder/coderdTerraform provider - CI recipe: plan on PR, apply on merge, drift detection
- Secret handling (
api_key_wo/api_key_wo_version) - Known limitations and follow-ups (no native
coderdresource for the system prompt yet — track when it lands and fold the file into the Terraform module) - Link out to the live dogfood implementation as a reference
- Cross-links to add:
- Link from
platform-controls/index.md→ System prompt - Link from
getting-started.md→ Set a deployment-wide system prompt - Optional mention from
best-practices.md→ Provide Agents with Proper Context
- Link from
Follow-up
When the coderd Terraform provider adds a native resource for the chat system prompt, update this recipe to use the resource and drop the workflow-driven API PUT (as already noted in the dogfood README).
Created on behalf of @mdanter
Activity
linear-code commentedon Aug 12, 2026
ENG-3169
mdanter commentedon Aug 13, 2026
First draft of this: https://github.com/mdanter/coder-chats-inst-kb/blob/main/README.md
bpmct commentedon Aug 18, 2026
Opened coder/terraform-provider-coderd#411 for the native resource mentioned in the Follow-up section — the system prompt is one of the most frequently-changing pieces of agents config, so it should be codified rather than PUT from CI. Once that ships, the recipe here can use
coderd_chat_system_promptdirectly and drop the workflowPUT+ drift steps.