fix(backend): add prompt guardrails from feedback#144
Merged
Conversation
Address three recurring complaints from the internal Ask O11y feedback round by tightening the default system prompt: - No unprompted writes: default to read-only investigation; propose and confirm before creating/modifying/deleting any resource. - Capability honesty: only claim capabilities backed by an available tool; say so plainly when something is unsupported instead of inventing a workflow. - Honor user-specified time ranges exactly rather than drifting to a default window. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Org policy requires all GitHub Actions pinned to a full-length commit SHA. Pin wait-for-grafana (e2e) and is-compatible (compatibilitycheck) to the current plugin-actions main SHA to unblock required checks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tightens the default system prompt to fix three recurring complaints from the internal Ask O11y feedback round. All changes are in
DefaultSystemPrompt;/api/prompt-defaultsreturns this constant directly, so the config UI stays in sync (no route/OpenAPI change). Provisioned custom prompts intentionally don't inherit these.Testing
go test ./pkg/...✅ (extendedprompts_test.goto assert all three guardrails appear in the assembled prompt)🤖 Generated with Claude Code
Note
Low Risk
Changes are limited to default prompt text, a unit test, and CI action SHA pins; no auth, data paths, or API contract changes.
Overview
Strengthens the default Ask O11y system prompt (
DefaultSystemPrompt) to address recurring feedback: mutating Grafana resources only when the user explicitly asks (otherwise propose and confirm), a new capability honesty rule in the anti-hallucination contract, and strict use of user-specified time ranges without silent defaults.Adds
TestBuildSystemPrompt_FeedbackGuardrailsPresentso the assembled prompt always includes those three snippets. Custom provisioned prompts still override via settings and do not pick up these defaults automatically;/api/prompt-defaultscontinues to serve the updated constant.CI pins
grafana/plugin-actionswait-for-grafana and is-compatible to commit2ecc2ba…instead of@main.Reviewed by Cursor Bugbot for commit 243444e. Bugbot is set up for automated code reviews on this repo. Configure here.