Chapter 35. The Worker Platform: Control Plane, Model Routing and Governance
In this section
- Chapter 35. The Worker Platform: Control Plane, Model Routing and GovernanceOne worker is a project; ten workers for three companies need a platform. Build with Claude Code the control plane that manages workers, the router that picks the cheapest model that does each job well, and the governance that enforces in code what each worker may do.
- 35.1 Three jobs above the workerWhat a platform must do that no single worker can: manage the workers, choose the models, and set the boundaries. Why a system prompt is a request, not a permission.
- 35.2 How today's tools realize itWhat Claude Managed Agents, the OpenAI Agents SDK and the open stack give you for the three jobs above the worker, and what each leaves for you to build.
- 35.3 The control planeSpec and build, with Claude Code, a small control plane on Workers and Neon: a worker registry with versioned definitions, create, suspend, resume and retire, assignments routed to the right worker, and usage charged to each.
- 35.4 Model routingA model registry, routes by activity and data class, a rule for when no model is needed, and fallbacks that never send data where it may not go. Built with Claude Code behind AI Gateway, then used to re-price Brightline's worker.
- 35.5 The role contract in codeA versioned role contract for each worker, checked in code on every tool call and every Workflow start, so that delegating never adds authority and every sensitive decision is recorded.
- 35.6 Context on a budget, and seeing the costA context planner that gives each step the smallest context it needs without dropping required evidence, and one correlation ID per assignment that ties every call, tool, process, approval and cost together.
- 35.7 Tenants, connectors and deletionKeep each company's data apart in every store, give each role only the environment and connectors it needs with each company's own sign-in, and delete a conversation from every store with proof, including the part Pi Durable cannot do yet.
- 35.8 When Claude Code gets it wrong, and the limitsThe four mistakes Claude Code makes most often when it builds a platform: trusting a tenant from the model, a fallback that crosses a data boundary, permissions in the prompt, and a store forgotten in deletion. The review checklist, and what this small platform leaves out.
- Lab 35: Two companies, two workers, one platformLab 35: from your own spec and failure tests, have Claude Code build a small control plane, a model router and role contracts in code; run two workers for two companies; measure cost and quality per route; prove one company cannot reach the other's data; and delete one conversation from every store.
- Check yourselfRecall and practice for the whole chapter: the flashcards, and eight questions with outline answers.