Skip to main content
Version: 0.2 · v0.2.1

Configure AI scoring

AI is optional and off by default. When enabled it blends into the readiness gauge (base × 0.7 + AI × 0.3) and adds reasoning — it never affects the verdict. See AI as a copilot for the why.

AI scoring is part of an UpgradeAnalysis, so it needs upgrade analysis on (Helm upgrade.enabled=true). The ClusterMirror doesn't use AI.

1. Create the API-key Secret​

In the operator's namespace. The key name must be ANTHROPIC_API_KEY or OPENAI_API_KEY:

kubectl create secret generic mirops-ai -n mirops \
--from-literal=ANTHROPIC_API_KEY=sk-ant-...

2. Enable it on the analysis​

apiVersion: mirops.mirops.io/v1
kind: UpgradeAnalysis
metadata:
name: to-1-34
spec:
targetVersion: "1.34"
ai:
enabled: true
provider: anthropic # anthropic | openai
model: claude-sonnet-4-6 # optional; provider default otherwise
maxTokens: 2048 # response ceiling (1–32768)
credentialsSecret: mirops-ai

Token cost, kept in check​

  • Only at-risk resources are sent to the model — a healthy cluster sends almost nothing.
  • The result is memoized per unchanged snapshot — a resync on a steady cluster doesn't re-call the model.
  • maxTokens is a ceiling, and you're billed on actual output — so a generous ceiling is nearly free. Raise it (e.g. 8192) when using remediation, whose responses are longer.

Enable remediation​

Add proposed fixes to a RemediationPlan:

ai:
enabled: true
credentialsSecret: mirops-ai
remediation:
enabled: true
maxRiskLevel: low # low (default) | medium | high
autoApprove: false

If the AI fails​

The verdict is unaffected — you'll see the base analysis with a banner. Common causes: an invalid/empty API key, insufficient credit, or a maxTokens too low for the response (it truncates). The exact cause is in status.aiError and the operator logs.