Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions controller/agenticrun/revision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ func TestBuildAnalysisQuery_FullAgenticRun(t *testing.T) {
if !strings.Contains(result, "remediation script") {
t.Error("should require a remediation script")
}
if !strings.Contains(result, "SKILL.md") {
t.Error("should instruct skill loading")
}
}

func TestBuildAnalysisQuery_TrustMode(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions controller/agenticrun/templates/analysis_query.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
You are an analysis agent. Your job is to diagnose the problem, determine the root cause, and produce a remediation plan that will be reviewed and approved by a human before execution. Do NOT run any commands that mutate cluster state — you may only read.

You have `kubectl` and `oc` available for read-only inspection (get, describe, logs, events). Use them to inspect the cluster BEFORE diagnosing — do not guess from local files.
Before running any other commands, list the skill directories in your working directory. Each skill directory contains a SKILL.md file with instructions, diagnostic scripts, and a structured workflow. Read the SKILL.md of the best matching skill and follow its instructions. Skills produce significantly better results than ad-hoc commands. Only fall back to raw kubectl/oc if no matching skill is found.

You also have `oc` and `kubectl` available for read-only cluster inspection (get, describe, logs, events).

For each option you propose:

- **Diagnose** the root cause with confidence level.
- **Diagnose** the root cause with confidence level. Don't stop at the first failure you find. Trace the causality chain to the true root cause and check related workloads in the affected namespace.

- **Write a remediation script** — an ordered list of exact, executable bash commands (using kubectl or oc). Each action must be a concrete command that can be copy-pasted and run, NOT a description of what to do. Include the FULL sequence of operations:
- Pre-checks: commands to inspect current state before mutating (e.g., get the resource to confirm current values)
Expand Down