All work

Reliability & Automation

The Agent Org Chart & Dispatcher

Work used to stop at the task board and wait for me to open a terminal. Now it starts itself, a manager reviews it, and the only thing that comes back to me is a decision that is actually mine.

Designed, built, and operatePythonClaude Code agentstmuxsystemd scopesJSON task board
  • A task starts within a minute of being assigned, whether or not I am at a keyboard.
  • Unattended work flows down the chart. The only ways across it are three lanes written into code, and every crossing is a logged task.
  • When an agent needs me, I get a question with options and a recommendation, not a transcript to read.

The problem

Defining specialist agents is the easy part. The toil is in between them: someone has to notice a task is waiting, start a session for it, check on it, notice it stalled, and decide what happens next. Before this existed, that someone was me, so the agents only ever worked while I was watching.

An org chart is the oldest answer anyone has to that problem. It says who assigns work, who reviews it, and who gets interrupted when it goes wrong. It turns out to be a good shape for agents too, mostly because it is a good shape for limiting them.

The chart

Each role is a written agent definition with its own scope, tools and personality. The reporting line lives in one roster file, and that file is the authority: the hub page, the permission checks and the dispatcher all read it rather than keeping their own copy.

Owner
└── CEO
    ├── Incident Commander · Agent Operations · QA · Finance & Billing
    ├── CSO ──── Security Guardian · Response Guardian · Detection Engineer
    │            AppSec Reviewer · Compliance Officer
    ├── CIO ──── Head of Engineering ── Product · Regulated Apps · Tools
    │            NOC · SRE / Platform · Mail & DNS · Database · Onboarding
    │            WordPress Remediation · Helpdesk Manager ── Helpdesk Agent
    ├── CMO ──── Design · SEO Squad · Content & Social · Sales · Customer Success
    └── Recovery Exec ── Recovery TPM ── Prospecting Rep · Recovery Inbox
The reporting lines as they stand. Managers own a branch, and a manager can only assign work inside it. The CEO's branch is the whole company, so cross-department work goes up a level before it comes back down.

Filling the chart

The first chart had fifteen seats, and the task board showed where it was thin. One engineer held every code task across unrelated repos, regulated and not, and the dispatcher runs one session per role, so everything queued behind one seat. Nobody took command of an incident that crossed departments: the NOC, the security agents and the helpdesk each worked their own piece with no one running the timeline.

So I had three AI reviewers benchmark it against how real companies run operations: one from ITIL and managed-service practice, one from SRE and incident command, one from a security organisation and the business side. Their view was that most of the gaps were duties nobody owned rather than missing people. Problem management, change approval, capacity, disaster-recovery drills, vendor review and customer offboarding went into existing roles. The seats that earned their place were the ones with recurring work or a separation-of-duties reason: an incident commander, an engineer who is the only one allowed to touch the regulated apps, a reviewer who checks that engineer's work, a detection engineer, a compliance officer, and an agent-operations lead whose job is auditing the other agents.

The incident commander got its own lane in code, built by the agent org itself the same day the seat was added. Declaring an incident opens an incident id, files a task for the commander and for each responder it pages, parks those responders' other work, pauses the manager rounds above them, freezes routine changes on the affected hosts, and pages me on a Sev1. Responders check in on a timer, and a scribe timeline builds itself from their notes.

The dispatcher

A service makes one pass a minute. It keeps every running session supervised, and if there is room, it starts a fresh session for the next eligible task in its own terminal, under its own memory cap, with the Terminal Brain committee reading the screen.

Supervision covers the ways a session ends badly: it never started, it crashed, it went idle, or it ran past a hard time limit. Each one is a failed attempt. Three failed attempts and the task is blocked with the reason, instead of being retried forever.

Managers are not sessions left open all day, filling their context with stale state while they wait. A manager is a short session started when there is something to manage: on a schedule while its branch has open work, and early when one of its reports finishes or blocks. It reads the board, re-queues, delegates, escalates, closes the round with a one-line report, and exits.

Who can hand work to whom

Task text becomes an unattended prompt, and that is the security problem with the whole idea. If any agent could assign work to any other, one confused or manipulated agent could write a prompt that runs on its own in a peer's session, with the peer's tools.

So the dispatcher only starts tasks that the owner created, or that a manager above the assignee created. Everything else waits on the board for a person. Three lanes cross the chart on purpose: any agent can file a security request to the security team, with the CEO copied; a program lead can task the named specialists on its team, with their managers copied; and during a declared incident the incident commander can task any responder. Nothing else crosses. An agent also can't borrow someone else's name to get across: who it is comes from the sandbox the dispatcher started it in, so a session filing work as its manager is refused and the attempt is logged off the box. Identity the kernel enforces is the next step, with per-role keys from the secrets vault after it.

The same reasoning sets the limits: a small number of sessions live at once, one per role, a daily budget, a free-memory floor, and a pause switch that stops new work on the next pass, with separate switches for rounds and for incidents.

Asking the owner

Customer-facing actions and anything that spends money always need me. The cheap way to build that is an agent that stops and writes a paragraph. The useful way is a question with labelled options, each saying what will happen, one marked as the recommendation, and a comment box. My answer re-queues the task with the choice written into its notes, so the next session starts from the decision instead of from the question.

Watching the watcher

An idle dispatcher and a dead one look identical: an empty board. On one day the screen-reading committee had made no reading for fourteen hours and nothing said so, because a restart elsewhere had quietly detached it.

Both are now covered by a fleet invariant that runs on a schedule and fails loudly if the dispatcher has not reported in within five minutes or the committee cannot reach the sessions it is supposed to watch. A pause shows as a skip with its reason, so a deliberate stop never reads as a healthy one.

Engineering decisions

The calls I made, and what each one cost.

Unattended work only flows down the chart.

Anything that becomes a prompt is an injection path. Tying dispatch to the reporting line means a compromised agent can at worst bother its own reports, and the check is one function reading one file.

Managers run in rounds, not as standing sessions.

A manager sitting open all day spends budget to wait and reasons over a picture of the board that went stale hours ago. A fresh session per round starts from the current board every time.

The dispatcher never approves permission prompts.

It can start work and it can watch work. Letting it approve what a session asks to do would turn one bad task into whatever the session wanted, so that stays a per-session human call.

Failures block with a reason after three tries.

A task that fails the same way three times needs a person or a better task, not a fourth attempt that burns budget and fills the log with the same error.

More systems

I'm looking for Incident Commander, SRE and AIOps roles.

If your team is drowning in toil, alert noise, or incidents that never quite close. That is the work I do.

Get in touch