# Playbook registry - scenarios composed from the primitive vocabulary. # # A playbook is DATA, not a document. It binds primitives to a phase sequence # and to parameters. The meta-structure is: # # identity -> trigger -> phases -> steps(primitive + params) -> evidence # # Because every step names a primitive declared in primitives.yaml, the doctor # can prove closed-world conformance: a playbook that invents a verb is a # finding. Because approval and reversibility are properties of the primitive, # governance is inherited rather than restated per scenario. # # The point: nine scenarios below use ONE vocabulary of 35 primitives. A tenth # scenario is a composition, not a new document. # # Consumed by: neo4j/collect-registries.sh # Doctor checks: playbook_step_unknown_primitive, playbook_without_evidence, # playbook_without_approval_gate metadata: version: "0.1.0" status: draft created: "2026-10-06" ticket: [HITL] governed_by: catalogue: NIST SP 800-53B High shell: ISO/IEC 27001:2022 playbooks: # ------------------------------------------------------- the generic case - key: incident-response name: Incident response class: incident owner: founder controls: [IR-4, IR-5, IR-6, AU-6] summary: > The generic incident lifecycle. Every specific incident playbook is this shape with different bindings, which is why the specialised ones below are short. phases: [prepare, detect, assess, contain, resolve, recover, verify, communicate, learn] steps: - { phase: prepare, primitive: query-registry, with: { registry: service, key: "{{trigger.target}}" } } - { phase: prepare, primitive: snapshot, with: { target: "{{trigger.target}}", kind: pre-change } } - { phase: detect, primitive: collect-state, with: { target: "{{trigger.target}}", sources: [health, logs, registry] } } - { phase: detect, primitive: read-logs, with: { source: loki, window: 30m, query: "{{trigger.target}}" } } - { phase: detect, primitive: classify-severity, with: { signal: "{{trigger.signal}}", model: risk-tiers } } - { phase: detect, primitive: declare-incident, with: { severity: "{{severity}}", summary: "{{trigger.summary}}", owner: founder } } - { phase: detect, primitive: notify, with: { tier: "{{severity}}", channel: escalate-by-tier, message: "{{trigger.summary}}" } } - { phase: assess, primitive: scope-impact, with: { entry: "{{trigger.target}}", depth: 3 } } - { phase: assess, primitive: log-decision, with: { decision: containment-plan, rationale: "{{impact}}", consequences: recorded } } - { phase: contain, primitive: gate-approval, with: { tier: "{{severity}}", approver: founder, question: "Approve containment plan?" } } - { phase: contain, primitive: contain, with: { target: "{{trigger.target}}", policy: least-capability } } - { phase: resolve, primitive: isolate, with: { target: "{{trigger.target}}", method: caddy-deny, duration: bounded } } - { phase: recover, primitive: restore-backup, with: { backup: latest-clean, target: "{{trigger.target}}", point-in-time: last-known-good } } - { phase: verify, primitive: verify-health, with: { target: "{{trigger.target}}", endpoint: /health } } - { phase: verify, primitive: verify-absence, with: { condition: "{{trigger.signal}}", method: re-run-detector, window: 24h } } - { phase: verify, primitive: record-evidence, with: { artefact: evidence-chain, source: incident, chain: "{{incident-id}}" } } - { phase: learn, primitive: postmortem, with: { incident: "{{incident-id}}", template: governance-aligned } } - { phase: learn, primitive: promote-control, with: { lesson: "{{root-cause}}", check: new-doctor-check, owner: founder } } - { phase: learn, primitive: close-incident, with: { incident: "{{incident-id}}", disposition: resolved } } # ------------------------------------------------------- credential loss - key: credential-compromise name: Credential compromise class: incident owner: founder controls: [IA-5, AC-2, AU-6] summary: A secret or credential is believed exposed. Assume use, not just exposure. phases: [detect, assess, contain, resolve, verify, communicate, learn] steps: - { phase: detect, primitive: collect-state, with: { target: "{{credential}}", sources: [openbao-audit, auth-logs] } } - { phase: assess, primitive: scope-impact, with: { entry: "{{credential}}", depth: 4 } } - { phase: assess, primitive: classify-severity, with: { signal: credential-exposure, model: risk-tiers } } - { phase: contain, primitive: gate-approval, with: { tier: "{{severity}}", approver: founder, question: "Revoke now? This is not reversible." } } - { phase: contain, primitive: revoke-credential, with: { credential: "{{credential}}", subject: "{{holder}}", reason: suspected-compromise } } - { phase: resolve, primitive: rotate-secret, with: { secret: "{{credential}}", scope: all-consumers, grace: 0 } } - { phase: resolve, primitive: apply-loadout, with: { node: "{{node}}", loadout: core, version: current } } - { phase: verify, primitive: verify-health, with: { target: "{{credential-family}}", endpoint: gateway-auth } } - { phase: verify, primitive: re-run-evidence, with: { check: openbao-audit-since-revocation, baseline: zero-use } } - { phase: communicate, primitive: notify, with: { tier: "{{severity}}", channel: escalate-by-tier, message: credential-revoked } } - { phase: learn, primitive: postmortem, with: { incident: "{{incident-id}}", template: governance-aligned } } - { phase: learn, primitive: promote-control, with: { lesson: exposure-path, check: openbao-audit-alert, owner: founder } } # ------------------------------------------------------------ data loss - key: data-loss-restore name: Data loss and restore class: recovery owner: founder controls: [CP-9, CP-10, IR-4] summary: Data is lost or corrupt. Prove the restore before declaring recovery. phases: [detect, assess, recover, verify, learn] steps: - { phase: detect, primitive: collect-state, with: { target: "{{datasource}}", sources: [registry, volume-state] } } - { phase: detect, primitive: classify-severity, with: { signal: data-loss, model: risk-tiers } } - { phase: assess, primitive: scope-impact, with: { entry: "{{datasource}}", depth: 3 } } - { phase: assess, primitive: query-registry, with: { registry: datasource, key: "{{datasource}}" } } - { phase: recover, primitive: gate-approval, with: { tier: "{{severity}}", approver: founder, question: "Restore to {{point-in-time}}? This overwrites." } } - { phase: recover, primitive: restore-backup, with: { backup: "{{backup}}", target: "{{datasource}}", point-in-time: "{{point-in-time}}" } } - { phase: verify, primitive: verify-restore, with: { target: "{{datasource}}", assertions: [row-count, checksum, smoke-query] } } - { phase: verify, primitive: record-evidence, with: { artefact: restore-proof, source: restore-run, chain: "{{incident-id}}" } } - { phase: learn, primitive: update-registry, with: { registry: datasource, key: "{{datasource}}", changes: { last_restore_verified: today } } } # ------------------------------------------------------------ node loss - key: node-failure name: Node failure class: recovery owner: founder controls: [CP-10, SC-36, SI-4] summary: A node is unreachable. Decide whether to repair in place or rebuild from declarative source. phases: [detect, assess, recover, verify, learn] steps: - { phase: detect, primitive: query-registry, with: { registry: node, key: "{{node}}" } } - { phase: detect, primitive: verify-health, with: { target: "{{node}}", endpoint: tailnet-ping } } - { phase: assess, primitive: scope-impact, with: { entry: "{{node}}", depth: 4 } } - { phase: assess, primitive: classify-severity, with: { signal: node-unreachable, model: risk-tiers } } - { phase: recover, primitive: failover, with: { service: "{{carried-loadout}}", from: "{{node}}", to: standby } } - { phase: recover, primitive: rebuild, with: { target: "{{node}}", source: declarative-loadouts } } - { phase: verify, primitive: verify-health, with: { target: "{{node}}", endpoint: node-exporter } } - { phase: verify, primitive: check-conformance, with: { check: service_without_loadout } } - { phase: learn, primitive: update-registry, with: { registry: node, key: "{{node}}", changes: { reachable: true } } } # --------------------------------------------------- agent misbehaviour - key: agent-misbehaviour name: Agent misbehaviour class: incident owner: founder controls: [AC-6, SI-4, AU-6, IR-4] summary: > The operator agent holds root. This is the playbook for containing the thing that usually does the containing, which is why the human gate comes first rather than last. phases: [detect, assess, contain, resolve, verify, learn] steps: - { phase: detect, primitive: read-logs, with: { source: hermes-gateway, window: 2h, query: tool-invocations } } - { phase: detect, primitive: query-registry, with: { registry: agent, key: "{{agent}}" } } - { phase: assess, primitive: scope-impact, with: { entry: "{{agent}}", depth: 5 } } - { phase: assess, primitive: classify-severity, with: { signal: agent-outside-envelope, model: risk-tiers } } - { phase: contain, primitive: gate-approval, with: { tier: "S1", approver: founder, question: "Suspend the agent? The agent may be reading this." } } - { phase: contain, primitive: revoke-credential, with: { credential: "{{agent}}-token", subject: "{{agent}}", reason: envelope-breach } } - { phase: contain, primitive: contain, with: { target: "{{agent}}", policy: read-only } } - { phase: resolve, primitive: snapshot, with: { target: agent-trace, kind: forensic } } - { phase: verify, primitive: verify-absence, with: { condition: unauthorised-tool-use, method: audit-review, window: full } } - { phase: verify, primitive: record-evidence, with: { artefact: tool-invocation-trace, source: gateway, chain: "{{incident-id}}" } } - { phase: learn, primitive: promote-control, with: { lesson: envelope-gap, check: agent-blast-radius-check, owner: founder } } # ------------------------------------------------------ certificate expiry - key: certificate-expiry name: Certificate expiry class: change owner: founder controls: [SC-17, SC-12] summary: A certificate is expiring or invalid. The cheapest incident is the one prevented by a check. phases: [detect, assess, resolve, verify] steps: - { phase: detect, primitive: collect-state, with: { target: caddy, sources: [acme-state, cert-store] } } - { phase: detect, primitive: classify-severity, with: { signal: cert-expiry, model: risk-tiers } } - { phase: assess, primitive: scope-impact, with: { entry: "{{interface}}", depth: 2 } } - { phase: resolve, primitive: rotate-secret, with: { secret: "{{cert}}", scope: gateway, grace: overlap } } - { phase: verify, primitive: verify-health, with: { target: "{{interface}}", endpoint: tls-handshake } } - { phase: learn, primitive: promote-control, with: { lesson: expiry-surprise, check: cert-expiry-window, owner: founder } } # -------------------------------------------------- supply chain compromise - key: supply-chain-compromise name: Supply chain compromise class: incident owner: founder controls: [SR-3, SR-4, SA-12, RA-5] summary: An upstream image or dependency is compromised. The clean-room rewrite is the remediation, not a rebuild. phases: [detect, assess, contain, resolve, verify, learn] steps: - { phase: detect, primitive: query-registry, with: { registry: technology, key: "{{technology}}" } } - { phase: detect, primitive: collect-state, with: { target: "{{technology}}", sources: [sbom, image-digest, provenance] } } - { phase: assess, primitive: scope-impact, with: { entry: "{{technology}}", depth: 4 } } - { phase: assess, primitive: classify-severity, with: { signal: upstream-compromise, model: risk-tiers } } - { phase: contain, primitive: gate-approval, with: { tier: "S1", approver: founder, question: "Stop affected services?" } } - { phase: contain, primitive: stop-service, with: { service: "{{service}}", reason: compromised-dependency } } - { phase: resolve, primitive: rebuild, with: { target: "{{technology}}", source: clean-room-rewrite } } - { phase: verify, primitive: hash-artefact, with: { artefact: "{{image}}", algorithm: sha256 } } - { phase: verify, primitive: check-conformance, with: { check: unregistered_technology } } - { phase: verify, primitive: verify-absence, with: { condition: compromised-artefact, method: digest-compare, window: 24h } } - { phase: verify, primitive: record-evidence, with: { artefact: supply-chain-evidence, source: rebuild-run, chain: "{{incident-id}}" } } - { phase: learn, primitive: postmortem, with: { incident: "{{incident-id}}", template: governance-aligned } } # ------------------------------------------------------------- rehearsal - key: restore-drill name: Restore drill class: rehearsal owner: founder controls: [CP-9, CP-4, AT-3] summary: > The rehearsal that makes the recovery playbooks credible. Decision 34 made a proven restore a hard gate, so this runs on a cadence, not after a loss. phases: [prepare, detect, recover, verify, learn] steps: - { phase: prepare, primitive: open-ticket, with: { title: scheduled-restore-drill, owner: founder, due: cadence } } - { phase: prepare, primitive: snapshot, with: { target: drill-environment, kind: baseline } } - { phase: detect, primitive: collect-state, with: { target: "{{datasource}}", sources: [backup-catalogue] } } - { phase: recover, primitive: restore-backup, with: { backup: "{{backup}}", target: drill-environment, point-in-time: "{{point-in-time}}" } } - { phase: verify, primitive: verify-restore, with: { target: drill-environment, assertions: [row-count, checksum, smoke-query] } } - { phase: verify, primitive: record-evidence, with: { artefact: drill-proof, source: scheduled-drill, chain: drill-log } } - { phase: learn, primitive: update-registry, with: { registry: datasource, key: "{{datasource}}", changes: { restore_tested: true, restore_tested_on: today } } } # ------------------------------------------------------------ provisioning - key: node-onboarding name: Node onboarding class: change owner: founder controls: [CM-2, CM-3, AC-2, IA-3] summary: Bring a new node into the fleet. The same primitives, a different phase order, which is the point. phases: [prepare, resolve, verify, communicate, learn] steps: - { phase: prepare, primitive: open-ticket, with: { title: onboard-node, owner: founder, due: none } } - { phase: prepare, primitive: gate-approval, with: { tier: S3, approver: founder, question: "Approve join for {{node}}?" } } - { phase: resolve, primitive: apply-loadout, with: { node: "{{node}}", loadout: core, version: "{{version}}" } } - { phase: resolve, primitive: apply-loadout, with: { node: "{{loadout}}", loadout: "{{loadout}}", version: "{{version}}" } } - { phase: verify, primitive: verify-health, with: { target: "{{node}}", endpoint: node-exporter } } - { phase: verify, primitive: check-conformance, with: { check: loadout_without_core } } - { phase: communicate, primitive: notify, with: { tier: S4, channel: operational, message: "{{node}} joined with loadout {{loadout}}" } } - { phase: learn, primitive: update-registry, with: { registry: node, key: "{{node}}", changes: { reachable: true, loadouts: "{{loadout}}" } } } # ------------------------------------------------------------ schema change - key: schema-change name: Schema change class: change owner: founder controls: [CM-3, CM-4, CM-5, SI-10] summary: > A database schema change taken through declaration, review, approval, application and verification. Written because the platform runs ten databases with no schema-change governance, and because the assessment of third-party migration platforms concluded that the governance belongs in the primitive vocabulary rather than in an external product. phases: [prepare, assess, resolve, verify, learn] steps: - { phase: prepare, primitive: query-registry, with: { registry: datasource, key: "{{database}}" } } - { phase: prepare, primitive: open-ticket, with: { title: "schema change {{database}} {{version}}", owner: founder, due: none } } - { phase: prepare, primitive: snapshot, with: { target: "{{database}}", kind: pre-migration } } - { phase: assess, primitive: hash-artefact, with: { artefact: "{{migration-file}}", algorithm: sha256 } } - { phase: assess, primitive: gate-approval, with: { tier: S3, approver: founder, question: "Approve migration {{version}} on {{database}}?" } } - { phase: resolve, primitive: migrate-schema, with: { database: "{{database}}", version: "{{version}}", direction: up } } - { phase: verify, primitive: verify-schema, with: { database: "{{database}}", expected-version: "{{version}}" } } - { phase: verify, primitive: record-evidence, with: { artefact: migration-record, source: migration-run, chain: "{{ticket}}" } } - { phase: learn, primitive: update-registry, with: { registry: datasource, key: "{{database}}", changes: { schema_version: "{{version}}" } } } # ------------------------------------------------------- agent authority model # Written after assessing Open Instinct (adoption.yaml: open-instinct SKIP, # open-instinct-policy-guard BUILD). Every agent currently enters the fleet by # being declared in the interface registry, with a runtime and a skill list # and no capability boundary. These two playbooks make the tier and the grant # lifecycle explicit, so the guard has something authoritative to enforce. # Full assessment: /opt/prodg/open-instinct-integration-plan.md - key: agent-onboarding name: Agent onboarding class: change owner: founder controls: [AC-2, AC-6, IA-3, AU-6] summary: > Bring an agent into the fleet with an explicit tier and a scoped credential, and prove the boundary holds. The interface registry says an agent exists; this says what it is allowed to do, which is the claim that actually needs evidence. phases: [prepare, resolve, verify, communicate, learn] steps: - { phase: prepare, primitive: open-ticket, with: { title: "onboard agent {{agent}}", owner: founder, due: none } } - { phase: prepare, primitive: gate-approval, with: { tier: S3, approver: founder, question: "Admit {{agent}} at tier {{tier}} with scopes {{scopes}}?" } } - { phase: resolve, primitive: provision-agent-identity, with: { agent: "{{agent}}", handle: "{{handle}}", scopes: "{{scopes}}" } } - { phase: resolve, primitive: set-trust-tier, with: { principal: "{{agent}}", tier: "{{tier}}", rationale: "{{rationale}}" } } - { phase: verify, primitive: verify-health, with: { target: "{{agent}}", endpoint: /health } } - { phase: verify, primitive: verify-capability, with: { principal: "{{agent}}", forbidden: "{{out-of-tier}}", method: negative-test } } - { phase: verify, primitive: check-conformance, with: { check: agent_without_interface } } - { phase: verify, primitive: record-evidence, with: { artefact: agent-admission-record, source: onboarding-run, chain: "{{ticket}}" } } - { phase: communicate, primitive: notify, with: { tier: S4, channel: operational, message: "{{agent}} admitted at tier {{tier}}" } } - { phase: learn, primitive: update-registry, with: { registry: agent, key: "{{agent}}", changes: { tier: "{{tier}}", scopes: "{{scopes}}" } } } - key: capability-grant-review name: Capability grant review class: change owner: founder controls: [AC-2, AC-6, AU-6, CM-3] summary: > Review the standing capability grants, renew the ones whose reason still holds and withdraw the ones whose reason has passed. A grant that outlives its purpose is an unmanaged privilege, and an expiry nobody reads is not an expiry. phases: [prepare, assess, resolve, verify, learn] steps: - { phase: prepare, primitive: query-registry, with: { registry: agent, key: "{{principal}}" } } - { phase: prepare, primitive: read-logs, with: { source: policy-decisions, window: 30d, query: "grants {{principal}}" } } - { phase: assess, primitive: scope-impact, with: { entry: "{{principal}}", depth: 4 } } - { phase: resolve, primitive: grant-capability, with: { principal: "{{principal}}", capabilities: "{{still-needed}}", scope: "{{scope}}", expires-at: "{{new-expiry}}" } } - { phase: resolve, primitive: revoke-capability, with: { principal: "{{principal}}", capabilities: "{{no-longer-needed}}", reason: purpose-passed } } - { phase: verify, primitive: verify-capability, with: { principal: "{{principal}}", forbidden: "{{revoked}}", method: negative-test } } - { phase: verify, primitive: record-evidence, with: { artefact: grant-review-record, source: review-run, chain: "{{ticket}}" } } - { phase: learn, primitive: update-registry, with: { registry: agent, key: "{{principal}}", changes: { grants_reviewed_on: today, grants: "{{still-needed}}" } } }