Team runbooks
Store operational runbooks in Git as Markdown files with YAML frontmatter using the Open Knowledge Format (OKF) v0.2 specification. Keeping runbooks in Git gives every procedure version history, pull-request review, and a stable path that kube-agents can inspect and index without anyone pasting stale steps into chat.
Where runbooks live
Section titled “Where runbooks live”Put runbooks under knowledge/runbook/ in your GitOps repository (the repository with role: gitops in spec.integration.repositories). knowledge/ sits outside the deployment paths (clusters/<cluster>/ and fleet/), so Argo CD, Flux, Config Sync, and apply pipelines never apply runbooks to a cluster.
<gitops-repo>/├── clusters/<cluster>/├── fleet/├── knowledge/│ ├── index.md│ ├── log.md│ └── runbook/│ └── drain-stuck-node.md├── .kube-agents/│ └── intent.yaml└── CODEOWNERSThe reference GitOps repository layout ships a starter knowledge/ tree you can fork.
Configuring knowledge paths with .kube-agents/intent.yaml
Section titled “Configuring knowledge paths with .kube-agents/intent.yaml”.kube-agents/intent.yaml at the repository root holds a paths: list that controls where pre-action runbook lookup and declaring fleet audits search, and sets the root directories Curator loads decision and lesson records from:
paths: - knowledge/Pre-action runbook lookup (runbook_lookup.py) always searches knowledge/ recursively and adds any validated, non-symlink relative paths listed in paths: (up to 16 roots total). It matches .md files declaring type: runbook or type: playbook anywhere under those roots, including nested subdirectories.
Include knowledge/ in paths: whenever you keep decision or lesson records there, because a non-empty paths: list replaces Curator’s default knowledge root rather than appending to it. Scheduled repo_memory broker snapshots only unpack knowledge/ and the fixed external-doc prefixes below, and Curator’s runbook indexing ignores intent.yaml to scan only those fixed directories. Without .kube-agents/intent.yaml, or when a listed path does not exist at the audited commit, declaring audits fall back to scanning the whole repository under their content-mode file and byte caps.
Using a separate read-only runbook repository
Section titled “Using a separate read-only runbook repository”If your runbooks already live in a dedicated repository in the same GitHub organization (or on another configured forge such as GitLab, Bitbucket, or Gitea), attach it with role: context in spec.integration.repositories. The credential broker serves read-only snapshots of context repositories and refuses every write verb against them. Private GitLab and Bitbucket context repositories require a read-token key in the forge Secret, whereas Gitea context snapshots run unauthenticated and cover public repositories only.
Two mechanisms read runbooks across gitops, managed, and context repositories using different path rules. Pre-action runbook lookup (runbook_lookup.py) walks knowledge/ and any relative paths declared in .kube-agents/intent.yaml recursively, including subdirectories, and does not scan docs/runbooks/ or runbooks/ unless they appear in intent.yaml. By contrast, Curator’s scheduled repo_memory indexing and decision-memory index ignore intent.yaml and scan only top-level .md files (skipping subdirectories) in these fixed directories:
knowledge/runbook/(canonical singular) andknowledge/runbooks/docs/runbooks/anddocs/playbooks/runbooks/andplaybooks/
Putting runbooks directly inside knowledge/runbook/ works for both pre-action lookup and Curator’s scheduled indexing without extra configuration. If a context repository stores runbooks under docs/runbooks/ or runbooks/, list that path in .kube-agents/intent.yaml so pre-action lookup reads it too, and keep files directly inside that directory if you want Curator to index them.
Reserved filenames
Section titled “Reserved filenames”index.md (navigation) and log.md (history) are reserved at every level of knowledge/. Neither file declares a type key in frontmatter, and index and log must never be used as type values or entry filenames. At the knowledge/ root, README.md and STATE_OF_BEING.md are also permitted without type frontmatter and are skipped by record ingestion. Pre-action runbook lookup skips those four filenames plus template.md and 0000-template.md at any depth.
Minimum OKF v0.2 frontmatter
Section titled “Minimum OKF v0.2 frontmatter”Every entry file under knowledge/ requires YAML frontmatter delimited by --- with a non-empty string type. For a runbook, set type: runbook.
---type: runbooktitle: Drain a node blocked by a PodDisruptionBudgettags: [gke, upgrades, pdb]status: stablesources: - https://wiki.example.com/sre/node-drain-pdbgenerated: by: platform-sre at: 2026-09-15verified: by: alice at: 2026-09-18stale_after: 2027-03-15---
# Drain a node blocked by a PodDisruptionBudget
## Preconditions
Confirm the node is cordoned and identify which pods hold the eviction back.
## Steps
1. Run `kubectl get pdb --all-namespaces` and find budgets with `ALLOWED DISRUPTIONS = 0`.2. Check whether the owning workload is degraded before changing any budget.The recommended OKF v0.2 provenance and lifecycle fields are optional, and the OKF validator checks their shape whenever they appear:
| Field | Expected shape | Purpose |
|---|---|---|
type |
Required non-empty string (never index or log) |
Entry category (runbook for operational procedures). |
sources |
Non-empty list of non-empty strings or mappings | Upstream docs, tickets, or wikis the procedure came from. |
generated |
Mapping with non-empty by and ISO-8601 date (YYYY-MM-DD) or timezone-qualified timestamp at |
Who authored or exported the file and when. |
verified |
Mapping (or non-empty list of mappings) with by and ISO-8601 date or timezone-qualified timestamp at |
Who reviewed or tested the runbook and when. |
status |
draft, stable, or deprecated for runbook and other non-decision/lesson OKF docs |
Lifecycle state enforced by pre-action lookup and semantic indexing. |
stale_after |
ISO-8601 date (YYYY-MM-DD) or timezone-qualified timestamp |
Review-by date enforced at lookup time by runbook_lookup.py. |
decision and lesson notes under knowledge/decision/ and knowledge/lesson/ use a separate lifecycle vocabulary (proposed, active, rejected, superseded, retired) for Decision Memory. All other OKF types, including runbook, use draft, stable, and deprecated.
declares: frontmatter vs. the runbook body
Section titled “declares: frontmatter vs. the runbook body”Three distinct mechanisms share knowledge/, and keeping them separate prevents unexpected audit suppressions or blocked pushes.
The Markdown body of a runbook holds human-readable procedures, diagnostic commands, and escalation steps for engineers, pre-action lookup, and semantic recall. Fleet audits never parse prose to suppress findings, and narrative instructions never grant permissions.
An entry under .kube-agents/intent.yaml paths may also carry a declares: list in frontmatter for intentional cluster postures. Each item names check, namespace ("" for cluster-scoped objects), and object (Kind/name), plus optional cluster (<project>/<location>/<name> or project/<id>) and optional expires (YYYY-MM-DD UTC). The declaring fleet audits (obtainability-audit, compliance-audit, security-patch-orchestrator, fleet-wide-cost-analysis, stockout-prevention, gce-compute-fleet-audit, and gcp-networking-fabric-audit) read declares: and move matching postures under Declared intent with the file path. After expires passes, the posture returns as a finding with a Declared intent expired line naming the note and date.
Pre-push manifest assertions (scope and guard.expect) belong in knowledge/decision/ (DEC-YYYY-NNN) and knowledge/lesson/ (LES-YYYY-NNN), where the credential broker evaluates them deterministically on /v1/vcs/publish. Keep machine-checked manifest guards in decision and lesson records rather than inside narrative runbooks.
Versioning, review, and lifecycle
Section titled “Versioning, review, and lifecycle”Treat knowledge/ with the same change control as cluster configuration. Every addition, edit, or retirement lands through a pull request with commit history and line-by-line review.
Add /knowledge/ and /.kube-agents/ to CODEOWNERS (matching examples/gitops-repo/CODEOWNERS.example) and require code-owner review in branch protection. Both paths need review because a declares: item under knowledge/ moves an audit posture off the findings ledger, and removing .kube-agents/intent.yaml widens declared-intent scanning to the whole repository.
Move runbooks through draft, stable, and deprecated as their review state changes. New procedures start at status: draft, which pre-action lookup withholds as non-active and external-doc indexing maps to proposed so unreviewed drafts stay out of active-only recall. Reviewed procedures move to status: stable (active for pre-action lookup and mapped to active in the kube-agents-decisions bank; omitting status is also treated as active). When a procedure is replaced, set status: deprecated in a pull request and link to its replacement. Pre-action lookup filters deprecated (as well as superseded, retired, obsolete, rejected, or unrecognized values) into stale without returning the body. External-doc indexing maps deprecated to superseded, dropping the runbook from active-only semantic recall (status:active) while keeping Git history and links intact.
Set stale_after to the next scheduled review date so your team can audit aging procedures on a regular cadence. At lookup time, runbook_lookup.py compares stale_after against the current UTC date or timestamp. When stale_after is in the past (or unparseable), the lookup withholds the runbook body and reports the entry under stale with a stale_reason so the agent surfaces staleness instead of following the procedure. Pull-request CI checks stale_after syntax via the OKF validator, whereas no scheduled background watchdog alerts proactively on aging runbooks outside lookup time (unlike declares[].expires, which declaring fleet audits surface on their schedule).
Validating knowledge/ in your GitOps CI
Section titled “Validating knowledge/ in your GitOps CI”kube-agents does not install a CI workflow into your GitOps repository automatically. To catch malformed frontmatter and broken links before merge, run scripts/check_okf_knowledge.py against your knowledge/ directory in pull-request CI, keeping its sibling helper scripts/check_docs_links.py in the same directory (standard library plus PyYAML): python3 scripts/check_okf_knowledge.py knowledge.
The validator enforces these checks across every file under knowledge/:
- no symbolic links inside
knowledge/; - no
typekey on reserved files (index.md,log.md, and rootREADME.mdorSTATE_OF_BEING.md); - valid YAML mapping frontmatter with a non-empty, non-reserved
typeon every entry; - valid shapes for
sources,generated,verified,stale_after, and per-typestatus; - valid relative Markdown links and
#fragmentanchors inside the body.
What kube-agents does with a runbook today
Section titled “What kube-agents does with a runbook today”Shipped behaviour
Section titled “Shipped behaviour”Before planning a remediation, proposing a GitOps change, or diagnosing a workload, the Platform Agent and Cluster Agents run runbook_lookup.py (also exposed as decision_memory.py runbook). With no --repo flag, the lookup fetches live, read-only broker snapshots across every registered gitops, managed, and context repository and walks knowledge/ plus any validated relative paths declared in .kube-agents/intent.yaml. It matches type: runbook and type: playbook files by resource (resource, resources, or scope.resources), tags, title, and body text, filtered by target cluster when declared, and never reads agent scratch files, memory/, or past reports.
When an active runbook matches (status: "found"), runbook_lookup.py returns its sanitized body inside an <untrusted_runbook_data> block. The agent names the runbook path and steps it follows in its plan, applies those steps within its existing permissions, and cites the path and sources in the pull request body and task result. Entries marked draft, proposed, deprecated, superseded, retired, obsolete, rejected, or unrecognized — and entries past or with an unparseable stale_after date in UTC — are returned under stale without their bodies. The agent treats the live snapshot as authoritative, reports the stale path and stale_reason in its response without following the procedure, and proceeds with standard GKE and Kubernetes practices.
The declaring fleet-audit streams read declares: frontmatter from .md files under .kube-agents/intent.yaml paths in the GitOps repository (or --repo on a one-off run) and any GitHub context repositories, citing the matching file path under Declared intent.
On installs running with --memory=hindsight, the 10-minute github-repo-watcher runs the repo_memory sweep (DECISION_MEMORY_REPO_SCAN defaults to true; see Autonomous watchdogs). When the Curator binary is available alongside NATS_URL or HINDSIGHT_API_URL, it snapshots gitops, managed, and context repositories and indexes top-level runbooks from the fixed runbook directories verbatim into the kube-agents-decisions bank. Active (stable) runbooks then surface in decision-memory semantic checks (check --semantic) and Curator recall.
When asked about a documented procedure or repository path in chat, the Platform Agent reads files from registered gitops, managed, or context repositories through the inspect-repository skill and cites the repository, branch or ref, and commit SHA.
Not shipped yet
Section titled “Not shipped yet”Direct connectors that read Google Docs, Confluence, OneDrive, or Google Drive — or convert external docs and PDFs into OKF pull requests — do not ship yet. Proactive background alerts for runbooks that pass stale_after are also not built yet: stale_after is enforced at lookup time by runbook_lookup.py rather than by a scheduled watchdog.
What a runbook will never do
Section titled “What a runbook will never do”A runbook never widens the agent’s permissions. Kubernetes RBAC (read-only on workloads and cluster state), GCP IAM (read-only by default), the credential broker’s command policy, and the GitOps pull-request boundary (no merge or approve) are enforced outside the model. runbook_lookup.py fences every returned runbook body inside <untrusted_runbook_data> as untrusted data rather than executable authority. The agent refuses any directive to skip human approval, bypass pull request review, weaken Decision Memory guards, or run mutating kubectl or gcloud commands directly, and names the refused runbook in its reply; see Security & IAM.
Records indexed from role: context repositories stay read-only and untrusted. Curator tags them role:context and trust:untrusted, strips guard.expect, caps severity: block at warn, and wraps recalled chunks in <untrusted_memory_data> blocks so the agent reads them as reference data rather than executable instructions. Because knowledge/ sits outside reconciler roots (clusters/ and fleet/), runbooks are never applied to clusters.
Bringing in runbooks from Docs, Confluence, or Drive
Section titled “Bringing in runbooks from Docs, Confluence, or Drive”Because direct connectors do not ship today, bring existing runbooks from Google Docs, Confluence, or Drive into Git through a manual export and pull-request review:
- Export each procedure to plain Markdown (in Google Docs, use File → Download → Markdown; in Confluence or Drive, export or copy as Markdown).
- Put one operational procedure per file directly under
knowledge/runbook/<slug>.md(or underdocs/runbooks/in arole: contextrepository, addingdocs/runbooks/to.kube-agents/intent.yamlso pre-action lookup finds it), replacing terminal screenshots with plain text commands and expected output. - Strip pasted tokens, credentials, or one-off cluster secrets, then add OKF frontmatter with
type: runbook,title,status: draft,sourcespointing back to the original document URL,generated, and an initialstale_afterdate. - Open a pull request so the owning team reviews the converted procedure under
CODEOWNERS, addsverified, and switchesstatustostablebefore merging.
Avoid pasting long runbooks into chat threads as a substitute for Git. Chat pastes go stale, bypass review, and cannot be cited as a stable file path in pull requests or audit ledgers.
Where to go next
Section titled “Where to go next”- Declarative workflow — how
submit-suggestion,fleet-audit, and repository roles work together. - Governance SOPs — the built-in fleet audit procedures shipped in the agent image.
- Security & IAM — the enforced RBAC, IAM, and broker boundaries.
- PlatformAgent CRD → Adding repositories — how to register
gitops,managed, andcontextrepositories.