---
title: "LEGION"
url: "https://toddpaulbrownjr.com/builds/legion/"
author: "Todd Paul Brown Jr."
description: "LEGION is the multi-agent operating system Todd runs Adroit on: Claude Code sessions doing real work inside tiered rules the tooling itself enforces."
kind: "build"
updated: "2026-09-26T02:50:15+00:00"
---

# LEGION

## What it is

LEGION is the system I run Adroit on. It's a repository of instructions, state files, session prompts, skills and scripts that Claude Code sessions work from. When I start a session, the agent reads a generated status panel, the current strategy and my backlog, then executes the item I've pointed it at. It deploys our apps, checks production health, runs WordPress commands on our website, writes the code for our products and keeps its own records.

It holds 64 capability packages across five folders, and it operates Adroit's hosted systems: [Content Ops](/builds/content-ops/) and [Sadyr](/builds/sadyr/) in production, and the company website.

## Why it exists

I wanted agents to do real work on real infrastructure without being able to do real damage. I first tried to build it in April 2025 and kept failing, by several different routes, for most of a year. It came together in March 2026 (the first working files are dated 13 March), once I'd learned to work with coding agents and the models had caught up. The idea didn't change in those eleven months. My skill and the tools did.

## How it's governed

Four rules, and the important part is where they live.

- **Observe freely.** Reading logs, checking health, listing what's deployed: any time, no gate.
- **Change only with a flag.** A deploy or a write to production needs the explicit flag the script demands (`--yes`, `--confirm`). The rule is in the tool's contract, not just in a policy document, so it holds whether or not the agent remembers it that day.
- **Destructive is mine.** Delete, reset, rotate a secret, push a database to live: never run by an agent. It hands me the exact command instead.
- **No standing autonomy.** Sessions run the backlog I set. LEGION documents and operationalizes strategy I've approved. It doesn't author strategy, and when direction is unclear it stops and asks.

This got tested by accident. A session needed two hosted consoles and found both signed out. It didn't try to sign in. It finished everything else on the list and handed me one line: log in here.

## What broke

**Documentation drift.** Agents trust whatever the docs say. So LEGION keeps machine-derivable facts (versions, test counts, git state, whether a file exists) in one generated file, regenerated by a small script, and keeps judgment in files only a person edits. A second run has to print "already in sync". It still missed something: the hand-typed source it quotes said Sadyr had 1,175 tests when the deployed commit had 1,334. The panel only protects what it derives. I caught that one by hand.

**A rule it kept breaking.** My instructions ban shell heredocs because they kept mangling scripts. In one session the agent used one three times anyway, apologising each time. So it wrote a 40-line hook that checks every shell command before it runs, then tried a heredoc and got blocked. A rule an agent has to remember is a suggestion. A rule the tooling checks is a boundary.

## Receipts

| Figure | What | Source |
|---|---|---|
| 64 | capability packages across five folders | `state/repo-state.md` inventory, measured 2026-09-25 |
| 2026-03-13 | first working files on disk | file creation times |
| 1,175 vs 1,334 | stale declared Sadyr test count vs the deployed commit | manifest cross-check, 2026-09-21 |
| 3 | heredoc violations in one session before the hook | session record, 2026-09-21 |

All measured. More on the [receipts page](/receipts/).
