# 22.18 Designing a hosted worker: the four disciplines (/building-ai-workers/hosted-agents/designing-a-hosted-worker)

---
type: Document
title: "22.18 Designing a hosted worker: the four disciplines"
description: "Context, harness, graph and loop design on a hosted worker: what hosting runs for you, and what you still decide."
status: stable
order: 322.18
ksor:
  owner: team:panaversity
  audience: [ public ]
  approval:
    by: process:panaversity
    at: 2026-11-06T13:18:01Z
chapter: "22"
part: III
expert_status: builder-only
concepts: [ "22.18" ]
last_verified: 2026-11-05
generated:
  at: 2026-11-06T13:18:01Z
  by: process:panaversity
trust_tier: unverified
build_id: sha256:21db26ecbf7fc84b043f434d194e035ffe0481398b00a039c42d852801046bca
dirty: true
ksor_version: 0.0.60
---

*The design guide for everything before it. Its last table is a map of the whole chapter, best read after the Milestone 1 and 2 reading. Each discipline gets three answers: do you need it on a hosted platform, how you design it there, and where the lab builds it.*

**In everyday life.** A company hires a contracting firm to staff its warehouse night shift. The firm supplies the workers, the forklifts and the building's security guard. The company still writes the job sheet each worker reads, sets the site rules, decides whether one worker or a crew with a supervisor does the job, and decides when each shift starts and who inspects the work. Hiring the firm removed the hiring and the equipment. It did not remove a single one of those decisions. In this concept, the firm is the hosting platform, and the job sheet, site rules, crew and shifts are the four disciplines.

**What you will learn.** What hosting does and does not decide for the four kinds of design that shape a worker, and how to write down who decided each part.

**Why it matters.** Hosting removes code, not decisions. What the worker sees, what limits it, how its work is split and what starts it are still yours to design.

**One request, start to finish.** Before the worker is sold, Brightline's controller asks the builder for one page: "How is this worker designed, and who decided each part?" The builder fills in one row per discipline:

1. **What it sees (context):** the worker contract's rules in the instructions, the invoice-triage skill for method, the connector's four tool descriptions, and one question per session. Decided with the AP expert (Task 1).
2. **What surrounds it (harness):** three file tools and the four read-only connector tools, everything else off, one open door on the network, connector tools on "allow" only after review, and a budget on every run. Decided by the builder, checked by `check:agent-config` (Tasks 2, 5, 6).
3. **How the work is split (graph):** one agent, in one session. No helpers yet, because nothing measured says they are needed. A month-end review may add an outcome (Task 21b).
4. **Who prompts it next (loop):** a person's question in the portal, or the morning schedule, a check by code, two rounds at most, and "needs review" after that (Task 18).

The controller reads the page and asks one more question: "So what did the platform decide?" The builder's answer: "Nothing on this page. It runs what the page says."

### What does a hosted platform remove?

A hosted platform removes code, not design. Four kinds of design decide how a worker behaves: context (what it sees), harness (what surrounds it), graph (how its work is split) and loop (who prompts it next). On a hosted platform you design each one in configuration, files and your product, not in code you write yourself.

![A table drawn as boxes, four rows and three columns. Columns: the discipline, what hosting runs, and what you decide. Context: hosting keeps the session's history and files. You decide what the worker sees: instructions, skill, tools, one task per session. Harness: hosting runs the tools, the sandbox and the policies. You decide how to constrain, inform, verify, correct and escalate. Graph: hosting can run helpers and workflows. You decide on one agent, or a measured reason to split the work. Loop: hosting runs the inner cycle of one session. You decide the trigger, done, the check by code, feedback and stop, and the record.](img/chapter-22-four-disciplines.png)

*Figure 22.24. Hosting runs the machinery of each discipline. Every design decision is still yours.*

### What is each discipline, in one line?

Context: you put everything the worker reads there. Harness: the platform runs it, and you decide what it allows, with [21.9](../agent-sdks/what-an-sdk-still-leaves-to-you.md)'s five verbs, constrain, inform (give it what it needs to know), verify, correct and escalate (hand a decision to a person). Graph: split the work only when one agent is not enough, and say why. Loop: a worker people pay for is a loop, as [22.15](schedules-and-webhooks.md) and [22.16](loops-check-feedback-and-stop.md) set out. The full design guide for each, with its questions and Brightline examples, is on the companion page. The map below gives one row per discipline.

### What are the stages of a worker's life?

The four disciplines design the worker. Its whole life has eight stages. This chapter builds the first six, and starts the last two:

| Stage | What happens | Where this chapter does it |
| --- | --- | --- |
| **Define the role** | The owner says what the worker may answer, decline and spend | The worker contract (Task 1) |
| **Configure** | The agent, environment, tools, policies and network, as files | [22.2](four-resources.md), [22.4](resources-as-code.md) and [22.6](what-travels.md) to [22.8](permission-policies.md), Tasks 2 to 8 |
| **Evaluate** | Prove it behaves before people rely on it | The session matrix ([22.11](one-session-one-person-one-company.md), Tasks 12 and 12b), checks by code (22.16) |
| **Deploy** | Put it where people reach it, with its own identities | [22.9](three-identities-never-one.md), [22.10](a-vault-per-person-and-company.md) and [22.13](keys-that-expire-and-no-keys-at-all.md), Tasks 9, 10a, 13 and 21 |
| **Execute** | Do the work, one person and company per run, within a budget | [22.5](a-budget-on-every-run.md), 22.11 and [22.14](when-a-refresh-is-refused.md) to 22.16, Tasks 10b, 10c, 11 and 18 |
| **Observe** | Read what it did, hear when runs stop, catch what was missed | [22.3](reading-a-session.md), 22.15, Tasks 3, 17 and 18 |
| **Improve and govern** | Change it through reviewed files, keep its limits, answer for it | 22.4, 22.5, the owner's sign-off |
| **Retire** | Pause its schedules, archive its agent and vaults, revoke its keys | A company's offboarding (S6), pausing the schedule (Task 18) |

### What do you design for each discipline?

| | Do you need to understand it to build hosted workers? | What you design on a hosted platform | Where the lab builds it |
| --- | --- | --- | --- |
| **Context engineering** | Yes, fully | Instructions, skills, tool descriptions, session boundaries, retrieval | Tasks 1, 2 and 5 |
| **Harness engineering** | Yes, as configuration | Tools, policies, network, budgets, and where each check lives | Tasks 2, 5, 6, 8 |
| **Graph engineering** | When one agent is not enough | Whether to split, how, and with which budget | Task 21b |
| **Loop engineering** | Yes, most of all | Trigger, done, check, feedback, stops, state | Tasks 17, 18 |

Four more rows, for the topics in Beyond this chapter (a nervous system, an agent-to-agent protocol, scheduled coding-agent runs and vendor standing assistants), are on the companion page.

**At work.** In [Lab 22](lab.md), Task 21, Claude Code updates `docs/deploy.md`. Add one table to it, the controller's page: one row per discipline, what was decided, who decided it, and the file or check that holds the decision.

**The operating rule:** a hosted platform runs what your design says, and nothing more. Write the design down, one row per discipline, each held in a file or a check.

### Part E in one minute

Add helpers, workflows, an advisor or an outcome only for a measured reason, and host the loop yourself only when a rule or a cost demands it ([22.17](patterns-and-when-to-host-it-yourself.md)). Hosting runs the machinery, but the context, the harness, the graph and the loop are still yours to design (22.18).

**Now do Lab 22, Sitting 5** on the lab page: Tasks 20 and 21, and the optional Tasks 19 and 21b (about 1 hour 5 minutes, or 2 hours with both extensions). It ends with your reviewed pull request. Then come back for [22.19](how-todays-tools-realize-it.md) and Check yourself.
