Heisenberg Lab

Stories

What I built, how the lab got here, and what broke along the way.

Case studies

Problems I solved while building the lab, and the decisions behind them.

2 agents, hook-enforced rules

AI agents that run the lab, with guardrails

Two AI agents administer the lab day to day, bounded by rules that hooks enforce rather than politely request.

I run the lab with two agents. “flynn” is a Claude Code instance in its own container, and I drive it from my phone or laptop through Remote Control. “Tuco” is a Hermes agent I talk to in Discord for quick checks and documentation.

flynn works as an orchestrator. The main session plans, decides and reviews. Cheap read-only work goes to small Haiku subagents or to Tuco, Sonnet executes plans I have approved, and an auditor subagent checks every change before it is reported done.

The interesting decision was where to put the rules. Written instructions drift, so the important ones are enforced by guard hooks that run before each tool call: snapshot before risky changes, no hard deletes, secrets never printed. The agent cannot talk its way around them.

A separate sandbox VM, “superlab”, is top secret and tightly jailed.

The result is that I can ask for a change from my phone and get a snapshot, a verified change and a log entry, with a hard ceiling on the damage a mistake can do.

Claude CodeHermes AgentDiscordProxmox VE 9Python hooks

32 GB VRAM, 6 models

Local LLM inference on a 32 GB GPU

A single AMD workstation GPU serves chat, agents and dictation cleanup entirely on my own hardware, with nothing sent to a cloud.

I built a private inference stack around an AMD Radeon AI PRO R9700 with 32 GB of VRAM, passed through to a dedicated container named todd (AI inference).

llama-swap sits in front as an OpenAI-compatible endpoint and starts one container per model on demand. A main chat model and a small fast model stay loaded together, while an image generator and an embeddings model load only when asked. Open WebUI gives me a chat interface, and my agents and local dictation apps call the same endpoint.

The tradeoff I like most is the fallback. The primary engine is much faster, but I also keep a llama.cpp Vulkan route for the same model, accepting roughly a quarter of the speed in exchange for not depending on one runtime. Loading the big image model evicts the chat model, so I treat swaps as a cost and plan around them.

The dictation clients clean up my speech through this endpoint in a fraction of a second, with a raw-text fallback if it is unreachable. Everything stays on my network.

AMD Radeon AI PRO R9700llama-swapllama.cppOpen WebUIDocker

24 alert rules, 19 monitors

Observability: know before I notice

Metrics, logs and uptime checks across every service, with alerts that reach me in Discord before a user would complain.

I wanted the lab to tell me when something is wrong, so one container, hank (monitoring), runs Prometheus, Grafana and Uptime Kuma, and another, gomez (logs), runs Loki.

Prometheus scrapes hosts, the GPU and the AI services. Loki collects logs from nearly every service, labelled by machine and service. Uptime Kuma runs about 19 checks on user-facing endpoints and DNS. Grafana holds 24 alert rules, grouped by area such as AI, hardware and individual apps, and routes them to a Discord channel.

One design choice is checking from the outside in. A metrics alert says a component is unhealthy, while an uptime check says whether a person can actually use the service, and the “service down” alert fires on the second. Backup and agent jobs also report in through Uptime Kuma push monitors, so a job that silently stops running turns into an alert.

An AI agent reads the logs for a daily error digest and a weekly report, so I get a summary instead of a wall of text.

PrometheusGrafanaLokiUptime KumaDiscord

Nightly, restore-tested

Backups that are proven by restoring

Nightly backups, snapshots before risky changes and automated restore tests, because an untested backup is only a hope.

I treat a backup as real only after I have restored it. Every service gets a nightly vzdump in snapshot mode, compressed with zstd, and a short retention to protect the host’s disk.

Before any risky change, the rule is a snapshot first. For the two services that share the vault mount and cannot be snapshotted, a vzdump is taken instead.

A restore-tester agent takes the newest backup of a service, restores it into an isolated scratch ID range, boots it, checks it and tears it down. I have used it on the admin agent’s own container.

The bug that taught me the most: after I renumbered services, retention pruned by ID, so the old IDs’ backups became orphans that were never cleaned up and slowly filled the host’s disk until jobs failed. I found it, documented the cleanup procedure and added it to the renumbering checklist.

The knowledge vault is a git repository auto-committed every 15 minutes and mirrored nightly to my Git server, behind a secret scanner that blocks the push if anything sensitive appears.

Proxmox vzdumpzstdGitGiteaBash

One CA, one front door

Edge, DNS and an internal CA

Every internal web service gets a friendly name and trusted HTTPS through one reverse proxy, with secure remote access over Tailscale.

I wanted every service reachable by a clean name with real HTTPS, even though nothing is exposed to the internet.

gus (reverse proxy) runs Caddy and acts as an internal certificate authority, issuing certificates for all internal sites. AdGuard Home (DNS) maps those names to the proxy with wildcard-style rewrites, so adding a service is one DNS entry and one proxy block. ed (subnet router) runs Tailscale, so my phone and laptops reach the lab from anywhere, with split DNS sending internal names to AdGuard.

Addressing follows a rule I enforce: services live in role blocks of ten, and a service’s ID is 100 plus the last part of its address. Looking at an ID tells me where it lives, and I renumbered everything to match. The Proxmox firewall is default-deny.

The cost of an internal CA is that every device must trust the root certificate before sites load. That caught me on a phone once (see the lessons), so installing it is now a documented runbook step.

CaddyAdGuard HomeTailscaleInternal CAProxmox firewall

Git-versioned, 15-minute commits

Knowledge as code: a shared vault

An Obsidian vault, versioned in git, is the memory and source of truth shared by me and both agents.

Agents forget between sessions, so I gave them a shared memory: an Obsidian vault of plain Markdown on the Proxmox host, mounted into both agents’ containers.

It has a fixed structure. An inbox holds raw input that is never edited after intake. A wiki describes hosts, services and runbooks. Dated decision records capture what I chose and why, and dated logs record every change with how it was verified and which snapshot protects it. A hook loads the vault’s current state when an agent session starts.

The decision I care about is ownership. Each agent owns specific folders, and edits to the other’s notes go through a proposal in the inbox. Helper scripts do targeted edits that must match exactly once, and they refuse text that looks like a secret.

The vault is auto-committed to git every 15 minutes, so a bad edit is a revert away. The result is that I, a future agent or a recruiter can reconstruct why the lab looks the way it does.

ObsidianMarkdownGitBind mountsHooks

Build timeline

How the lab got to where it is, in order.

  1. Safety-net plan and internal CA

    I decided to back up off the production host, set a snapshot-before-change rule, and stood up a private certificate authority.

  2. Lab audit and agent boundaries

    A full audit produced the renumbering plan, and I set the rule that the IT-assistant agent never gets root SSH.

  3. Renumbering and default-deny firewall

    Every service moved to the ID-to-address scheme, one service migrated from container to VM, and the firewall went default-deny.

  4. Backup disk-full bug found

    Orphaned backups from the old IDs filled the host disk and failed nightly jobs, which led to a documented cleanup procedure.

  5. Claude Code joins as lab admin

    flynn arrived in its own container, driven through Remote Control, sharing the Obsidian vault with the other agent.

  6. Restore testing automated

    A restore-tester subagent now proves backups boot by restoring them into an isolated scratch ID and tearing them down.

  7. Orchestrator model for agents

    The main agent plans and reviews while cheaper subagents do the legwork, with an auditor checking each change.

  8. Nightly vault and config backup

    A job pushes the vault history and sanitized configs to my Git server, blocked automatically by a secret scanner.

  9. Internal CA fix for phones

    A phone failing over Tailscale turned out to lack the root certificate, so I documented a CA install runbook.

  10. Local dictation on the GPU

    Dictation apps on my laptop and PC now clean up transcripts through the local model server.

  11. This showcase

    I decided to publish Heisenberg Lab, a sanitized public view of the lab, with the sandbox VM shown only as top secret.

Lessons learned

Things that broke, why they broke, and what changed afterwards.

Nov 23, 2026 Internal sites failed on my phone, but DNS was fine Hours of network debugging ended at a missing root certificate on one device.

Problem

Away from home over a VPN, my phone could not load any internal site and a password manager app showed a generic error. DNS resolved correctly, and one site seemed to work.

Cause

The phone had never trusted my internal certificate authority, so every TLS handshake ended with the client rejecting the certificate. The site that “worked” was only a cached page.

Fix

I installed the root certificate on the phone and marked it fully trusted. The step is now a runbook. A packet capture on the subnet router showed the signature: handshake completes, then a small client alert and close.

Lesson

When one device fails on every internal site while DNS is fine, check certificate trust before blaming the network. Always test with a URL the browser has never cached.

Nov 23, 2026 A correct timestamp made the scheduler skip jobs Hand-editing a job's next-run time in UTC tripped a timezone safety check, so scheduled runs were silently skipped.

Problem

After I set the next-run times of two recurring agent jobs by hand and restarted the service, the jobs did not run at their scheduled times.

Cause

I wrote the instants in UTC, but the scheduler is configured for a local timezone. Its repair guard saw the offset mismatch, compared wall-clock times naively, and decided the runs were in the future.

Fix

I stopped editing the job file directly. The safe options are to use the agent’s own scheduling tools, restart so it recalculates, or write local time with the local offset.

Lesson

A value can be correct and still break a system that interprets it differently. Use the tool that owns the data, and record the failure so the next session does not repeat it.

Nov 12, 2026 Renumbering the lab left backups behind Moving services to a tidy ID scheme broke backup retention in a way that took a week to surface.

Problem

A week after I renumbered every service to the ID-to-address scheme, the host’s disk was almost full and nightly backups were failing every night.

Cause

Retention prunes backups by service ID. Backups under the old IDs were orphans that nothing would ever prune, and they had grown to tens of gigabytes.

Fix

I measured the orphans, wrote a keep-list covering services I wanted to retain, and had a cleanup list reviewed before any deletion. I then added orphan pruning to the renumbering checklist.

Lesson

An ID change is a data migration for everything keyed on that ID, including retention. Add a backup-health check after any such change, and alert on failing jobs.