Autonomy pilot runbook
This pilot starts in safe practice mode where nothing merges unattended, and the Slack Autonomy dial pauses new auto-merge grants without redeploying (details). If your install does not use Slack, see Without Slack.
1. Upgrade and enable practice mode
Section titled “1. Upgrade and enable practice mode”Upgrade to a release with risk-gated post-merge verification (Upgrade). On an install.sh install, merge these switches into TF_VAR_extra_helm_values in install.env with your Slack member IDs and run ./upgrade.sh --upgrade-mode=full (see Helm YAML and multi-project setup):
TF_VAR_extra_helm_values='{platformAgent={deployment={env=[ {name="KUBEAGENTS_DIAL",value="on"}, {name="KUBEAGENTS_DIAL_ADMINS",value="U0123ABCD,U0456EFGH"}, {name="KUBEAGENTS_POST_MERGE_CHECK",value="report"}, {name="KUBEAGENTS_AUTOMERGE",value="practice"}, {name="KUBEAGENTS_AUTOMERGE_MAX_RISK",value="low"}]}}}'2. Add .kube-agents/automation.yaml
Section titled “2. Add .kube-agents/automation.yaml”Commit this file to your GitOps repository’s base branch (the pinned baseBranch, or default branch if unset) and protect .kube-agents/ with CODEOWNERS so edits require human review (rules, environment mapping):
version: 1automerge: allow: - fix: no-pdb environments: [dev] - max_risk: low environments: [dev, test] deny: - fix: "*" environments: [prod]3. Observe in Slack for 2-4 weeks
Section titled “3. Observe in Slack for 2-4 weeks”Open the app’s Home tab in Slack (Slack setup) and leave the Autonomy dial on Propose fixes (restart note). Observe kube-agents/risk statuses, kube-agents:would-auto-merge labels (GitHub and Gitea), and post-merge comments for 2-4 weeks before enabling Phase 2.
What works out of the box. Risk classification inspects flat rendered Kubernetes YAML and static local Kustomize overlays, and post-merge sync checks read in-cluster Argo CD Application objects (including ApplicationSet-generated ones), Git-backed Flux Kustomization and HelmRelease objects, and Git-backed Config Sync (details). With unrendered Helm, Terraform, or Kustomize overlays using generators, remote bases, components, replacements, or plugins, pull requests stay human-reviewed; with other reconcilers or non-Git sources, kube-agents still opens normal pull requests and reports unknown for post-merge sync checks.
Advanced and reference
Section titled “Advanced and reference”Start in Phase 1 (practice mode) above, validate signals on real pull requests, and move to Phase 2 only when your repository and merge pipeline are ready.
Phase 2: Unattended auto-merge
Section titled “Phase 2: Unattended auto-merge”Set KUBEAGENTS_AUTOMERGE=on to enter Phase 2. kube-agents never merges a pull request itself; the credential broker signals qualifying pull requests so your own pipeline can merge them:
- Risk-based (
max_risk) pull requests receive a greenkube-agents/auto-mergecommit status on the current head SHA (on all supported forges) pluskube-agents:auto-mergeon GitHub and Gitea. - Recipe (
no-pdb) pull requests receive thekube-agents:auto-mergelabel on GitHub and Gitea only (nokube-agents/auto-mergecommit status).
Complete these checks before switching KUBEAGENTS_AUTOMERGE from practice to on:
- GitHub App permissions (
Commit statuses: write). Risk-based (max_risk) auto-merge fails closed unless the broker’s minted token carries Commit statuses: Read and write (statuses: write) to recordkube-agents/auto-mergeandkube-agents/riskon the head SHA. Grant it on both the GitHub App installation andplatform-agent-scopeingithub-token-minter-config(default.yaml, plus<repo>.yamlif maintained by hand). Chart upgrades overwritegithub-token-minter-config, so re-apply that scope edit after upgrades. - Branch protection and approvals. GitHub, GitLab, and Bitbucket cannot exempt pull requests from required human approvals by label or path. Use a dedicated zero-approval
devortestbranch or repository gated on CI and the qualifying auto-merge signal. - Merge pipeline. For
max_riskrules, configure a CI workflow (GitHub Actions or GitLab CI) that merges only when the head SHA carries a greenkube-agents/auto-mergecommit status and the branch is up to date (or queued in a merge queue). Do not mergemax_riskpull requests on the label alone. Forno-pdbrecipe fixes on GitHub or Gitea, gate on CI plus thekube-agents:auto-mergelabel. - Shared-path safety for
max_risk. Before enablingKUBEAGENTS_AUTOMERGE_MAX_RISKalongsideKUBEAGENTS_AUTOMERGE=on, verify that nodevortestsynced directory or path glob is shared with astagingorprodreconciler. Post-merge health verification (verified_healthy) and automatic step-down (writing areason:deny rule) cover registered fix recipes (no-pdb) andclusters/<cluster>/max_riskmerges whenKUBEAGENTS_POST_MERGE_CHECKis enabled.
To enable Phase 2:
- Update
KUBEAGENTS_AUTOMERGEfrompracticetooninplatformAgent.deployment.envand apply the upgrade. - In Slack, an admin listed in
KUBEAGENTS_DIAL_ADMINSselects Auto-merge proven fixes on the Home tab’s Autonomy dial panel. - For recipe fixes such as
no-pdb, click Request auto-merge on the repository row (or merge an allow rule directly in.kube-agents/automation.yaml).
If an auto-merged no-pdb fix or clusters/<cluster>/ max_risk pull request is still broken after merge, kube-agents opens a revert pull request and a step-down pull request. The step-down pull request adds a deny rule (fix: for recipes, reason: for risk-classified changes) to .kube-agents/automation.yaml (When an auto-merged fix is still broken).
Verify locally and observe Phase 1 signals
Section titled “Verify locally and observe Phase 1 signals”In Phase 1 (Trusted Propose with practice mode), kube-agents proposes fixes as pull requests, classifies risk on every broker-opened pull request, verifies merged no-pdb fixes and clusters/<cluster>/ risk-classified changes, and marks qualifying pull requests with kube-agents:would-auto-merge. Nothing merges unattended.
From the shell sandbox Pod (assuming the default kubeagents-system namespace and platform-agent name), validate .kube-agents/automation.yaml and inspect a pull request’s deterministic risk classification. When testing a max_risk rule inside the sandbox, pass KUBEAGENTS_AUTOMERGE_MAX_RISK=<level> inline because that variable is not forwarded to the sandbox Pod:
kubectl exec -n kubeagents-system platform-agent-shell-0 -c shell -- \ python3 /opt/defaults/scripts/automation_rules.py <checkout> --fix no-pdb --environment dev
kubectl exec -n kubeagents-system platform-agent-shell-0 -c shell -- \ python3 /opt/defaults/scripts/vcs_client.py proposal-classify-risk <pr-number> --repo <owner/name> --format summaryDuring Phase 1, observe four signals:
- Risk labels and commit statuses. Every broker-opened pull request receives a tamper-proof
risk:*label (on GitHub and Gitea) and a SHA-boundkube-agents/riskcommit status citing the base SHA and driving reasons. - Practice labels. Qualifying pull requests receive
kube-agents:would-auto-mergeon GitHub and Gitea. Compare these pull requests against the ones your team reviews and merges. - Post-merge verification. Merged
no-pdbfixes andclusters/<cluster>/risk-classified pull requests receive a post-merge comment confirming whether the reconciler applied the change and the workload is healthy. - Baseline metrics. Record your team’s merge rate and review time on proposed pull requests before considering unattended merges.
Helm YAML and multi-project setup
Section titled “Helm YAML and multi-project setup”On an install.sh install, merge the platformAgent.deployment.env entries into TF_VAR_extra_helm_values in install.env (Operator settings). On a Helm install, set the list directly under platformAgent.deployment.env:
platformAgent: deployment: env: - name: KUBEAGENTS_DIAL value: "on" - name: KUBEAGENTS_DIAL_ADMINS value: "U0123ABCD,U0456EFGH" - name: KUBEAGENTS_POST_MERGE_CHECK value: "report" - name: KUBEAGENTS_AUTOMERGE value: "practice" - name: KUBEAGENTS_AUTOMERGE_MAX_RISK value: "low" - name: GKE_PROJECTS value: "dev-fleet-project,prod-fleet-project"Omit KUBEAGENTS_AUTOMERGE_MAX_RISK if you only want to pilot recipe-based no-pdb fixes. Omit GKE_PROJECTS on a single-project install.
GKE_PROJECTS is separate from spec.scope.projects and replaces GKE_PROJECT_ID when set, so include the management project if it holds target clusters. The credential broker’s service account must be able to list clusters in every listed project, or environment resolution fails closed.
Slack app setup and Hermes migration
Section titled “Slack app setup and Hermes migration”Every current install routes Slack through the A2A gateway (the former spec.mode: next path; spec.mode is deprecated). Confirm your Slack app manifest enables features.app_home.home_tab_enabled: true, subscribes to app_home_opened, and has interactivity turned on (Slack app setup). If allowedUsers is empty, the Home tab also requires the users:read scope.
Apps migrated from the older Hermes Slack listener must drop features.slash_commands and add the Home tab settings (Moving an app made for the Hermes listener). On Slack, the Autonomy dial panel appears above the Home channel panel (The Slack Home tab).
Without Slack
Section titled “Without Slack”Installs that use the Web Console or another chat interface without Slack can control the same three autonomy levels through platformAgent.deployment.env (or spec.deployment.env on a standalone PlatformAgent CR):
| Autonomy level | Environment settings | Behavior |
|---|---|---|
| Explain | KUBEAGENTS_WRITE_MODE=none |
Broker opens no pull requests (audit issues and reads still work). Any misspelt value fails closed to none (details). |
| Propose | Default (KUBEAGENTS_WRITE_MODE unset or propose), plus optional KUBEAGENTS_AUTOMERGE=practice and KUBEAGENTS_POST_MERGE_CHECK=report |
Broker opens pull requests for human review. Practice mode adds kube-agents:would-auto-merge labels without allowing unattended merges. |
| Auto-merge | Leave KUBEAGENTS_DIAL off (off or unset), set KUBEAGENTS_AUTOMERGE=on (plus optional KUBEAGENTS_AUTOMERGE_MAX_RISK and KUBEAGENTS_POST_MERGE_CHECK=report), and commit .kube-agents/automation.yaml |
With KUBEAGENTS_DIAL off, there is no dial ceiling; qualifying pull requests receive the auto-merge signal for your merge pipeline. |
Do not set KUBEAGENTS_DIAL=on — and do not enable the platformAgent.deployment.autonomyPilot Helm preset, which sets KUBEAGENTS_DIAL=on — on an install without Slack. When KUBEAGENTS_DIAL=on, session-kv reports the stored default level (Propose fixes) to the credential broker, and only the Slack Home tab can raise the dial to Auto-merge proven fixes — keeping the install capped at Propose even when KUBEAGENTS_AUTOMERGE=on.
Changing levels without Slack requires editing platformAgent.deployment.env and running an upgrade, which rolls the Pods; there is no one-click instant pause like the Slack dial. To stop unattended merges or all pull requests, set KUBEAGENTS_AUTOMERGE=off or KUBEAGENTS_WRITE_MODE=none and apply the upgrade, or pause your repository’s merge workflow for an immediate halt.
Dial restart behavior
Section titled “Dial restart behavior”The stored default level is Propose fixes. After a credential-broker Pod restart, the broker stays at Explain until session-kv reports the stored level (reported on startup and every minute). Leave the dial at Propose fixes throughout Phase 1.
Reconciler and environment isolation details
Section titled “Reconciler and environment isolation details”- Flat rendered Kubernetes YAML or static Kustomize overlays. Deterministic pull request risk classification inspects rendered Kubernetes manifests and statically renders local Kustomize overlays that use only
resources/bases,patches(Strategic Merge and JSON 6902),images,replicas,namespace, andcommonAnnotations. Unrendered Helm charts (values.yaml), Terraform files, and Kustomize overlays using generators, remote bases, components, replacements, or plugins post anunsupportedkube-agents/riskcommit status and stay human-reviewed. - Supported GitOps reconciler. Post-merge sync verification reads in-cluster Argo CD
Applicationresources, FluxKustomizationandHelmReleaseresources backed by aGitRepository(withreconcileStrategy: Revisionso deployed releases carry the Git commit suffix), and Config SyncRootSyncorRepoSync(Git source). Argo CD support covers single-source and multi-sourcespec.sources(including Helm$valuesref sources) as well asApplicationobjects generated by anApplicationSettargeting the local cluster.HelmReleasechecks require read access tohelmreleases. Non-Git Helm chart repositories (HelmRepository),ChartVersion-only releases without a Git commit link, OCI sources, and remote-cluster Argo CDApplicationresources reportunknownfor post-merge sync checks. - Environment mapping and isolation. Label each GKE cluster with
environment(or fallbackenv,stage, ortier). If your repository organizes manifests by directory or branch instead ofclusters/<cluster>/, declareenvironments:path and branch bindings in.kube-agents/automation.yaml(The environment of a fix). Keepdevandtestsynced paths isolated fromstagingandprodso a non-production rule cannot reach production through a shared directory.
Environment variable reference
Section titled “Environment variable reference”All Earned Autonomy switches ship off by default. Configure them in platformAgent.deployment.env (Helm or Terraform) or spec.deployment.env (standalone PlatformAgent CR). Changing KUBEAGENTS_DIAL, KUBEAGENTS_POST_MERGE_CHECK, or KUBEAGENTS_AUTOMERGE rolls the agent, sandbox, and credential-broker Pods. KUBEAGENTS_AUTOMERGE_MAX_RISK and GKE_PROJECTS apply to the credential-broker Pod, and KUBEAGENTS_DIAL_ADMINS applies to the agent Pod.
| Variable | Default | Phase 1 value | Phase 2 value | Purpose |
|---|---|---|---|---|
KUBEAGENTS_DIAL |
off |
on |
on |
Shows the Autonomy dial on the Slack Home tab and lets the dial bound broker writes. |
KUBEAGENTS_POST_MERGE_CHECK |
off |
report |
report |
Verifies merged no-pdb fixes and clusters/<cluster>/ risk-classified changes against the reconciler and cluster, and comments the result on the pull request. |
KUBEAGENTS_AUTOMERGE |
off |
practice |
on |
Reads .kube-agents/automation.yaml and marks qualifying pull requests (kube-agents:would-auto-merge in practice, kube-agents:auto-merge in on). |
KUBEAGENTS_AUTOMERGE_MAX_RISK |
off |
low (opt.) |
low or medium |
Optional install ceiling for max_risk rules in dev or test. Unset or off disables risk-tier auto-merge even when on is set. |
KUBEAGENTS_DIAL_ADMINS |
(none) | Member IDs | Member IDs | Comma-separated Slack member IDs (U… or W…) allowed to change the dial or toggle per-kind auto-merge. |
GKE_PROJECTS |
(none) | Project IDs | Project IDs | Optional comma-separated GCP project IDs for multi-project fleets when resolving clusters/<cluster>/ environment labels. |
KUBEAGENTS_DIAL_ADMINS accepts Slack member IDs only; emails and display names never match. When unset, the dial panel is read-only for everyone.
Pausing or turning it off permanently
Section titled “Pausing or turning it off permanently”To stop new auto-merge grants without redeploying, an admin in KUBEAGENTS_DIAL_ADMINS moves the Autonomy dial on the Slack Home tab back to Propose fixes (or Explain to pause all pull requests). The credential broker immediately blocks new grants and removes existing ones when a pull request is re-evaluated. For already-eligible open pull requests that must not merge before re-evaluation, hold or close them or pause your merge workflow.
To turn the switches off permanently, set KUBEAGENTS_AUTOMERGE (and optionally KUBEAGENTS_DIAL and KUBEAGENTS_POST_MERGE_CHECK) back to off in platformAgent.deployment.env (or spec.deployment.env on a standalone PlatformAgent CR) and apply the upgrade.