Connecting a customer EC2 to brain

Internal operator runbook for onboarding a brand-new customer EC2 into the M8trx brain telemetry fleet end-to-end. Single page; the per-phase docs linked from § References are the source-of-truth for details.

Audience: internal M8trx operator. Assumes AWS console + Terraform familiarity, brain EC2 access, and Tailscale admin rights. Onboard only — customer offboard / decommission is out of scope (see § What this runbook deliberately does not cover).

Prerequisites (one-time fleet setup)

Before any customer onboard, all of these must already exist. Each checklist line has a "verify by" hint. If something is missing, set it up before continuing — don't try to do it lazily during a per-customer onboard.

Per-customer onboard checklist

Run these in order for each new customer. The customer ID must match brain's mint-key.js validation regex /^cust_[a-z0-9_]+$/ — e.g. cust_acme, cust_bigco. Once these steps are done, all future agents launched for this customer auto-connect with zero additional configuration — the cloud-init bootstrap reads the customer's tag and resolves all per-customer secrets from SSM by that ID.

Validation (happy-path smoke)

The 3-command success check.

If all three check out, the customer EC2 is fully onboarded.

If something failed

See agent-artifacts/cloud-init/README.md § Operator debug recipe for the full failure → fix mapping. Common failures it covers:

Don't restate the recipe here — the source-of-truth is one click away.

What this runbook deliberately does not cover

References

Per-phase docs, README first (most operationally relevant), spec for context. Plans are intentionally omitted (implementation history, not operational reference).

Phase What it does README Design spec
B.1 wrapper session.start/end events from the m8trx-claude-isolate wrapper (no README; see modified script at agent-artifacts/m8trx-claude-isolate.modified) 2026-05-03-brain-mvp-ingestion-design.md
B.2 hooks tool_call events from Claude Code PostToolUse hook in the agent-runtime container agent-artifacts/claude-hooks/README.md 2026-05-03-brain-claude-hooks-design.md
B.3 heartbeat host-side liveness + system-stats events every 5 min via systemd timer agent-artifacts/heartbeat/README.md 2026-05-03-brain-host-heartbeat-design.md
B.4 cloud-init one-shot AWS user-data bash that installs deps, joins Tailscale, fetches SSM secrets, writes brain.env, installs heartbeat agent-artifacts/cloud-init/README.md 2026-05-03-brain-cloud-init-bootstrap-design.md