You hire a new junior developer and give them their first task: “Fix the login bug.” You also hand them the entire 5-million-line codebase, the complete architectural diagrams for every service, the full 5-year backlog of all bugs ever reported, and the company’s 10-year financial projections. You then expect them to productively fix the bug.
This is, of course, absurd. No human works this way. We’d give them a link to the specific bug ticket, pointers to the relevant files in the authentication service, and a quick overview of the immediate goal. We provide context progressively, as needed.
Yet, when we work with AI agents, we often do the equivalent of this data dump. We front-load the prompt with every piece of information the agent might possibly need for a multi-step task, hoping it can correctly parse, prioritize, and apply the right information at the right time. This “everything up front” approach is a primary source of agent failure.
To build reliable agents, we must adopt a strategy of progressive disclosure, staging the delivery of context to align with the agent’s current focus.
When we provide too much information at once, we trigger a cascade of failure modes:
We are, in effect, forcing the agent to do its own information foraging and prioritization, a complex cognitive task that even humans struggle with.
The most common manifestation of this problem is the “God Prompt”—a single, massive prompt template designed to handle every possible stage of a complex workflow. It contains placeholders for the mission, the plan, the scratchpad, the full tool documentation, user profiles, style guides, and more.
The harness’s job is simply to fill in all the placeholders and send this behemoth to the model for every single step. The hope is that the model will learn to navigate this complex structure, paying attention only to the relevant sections.
This rarely works for long-running tasks. The structure itself consumes a huge number of tokens, and the model’s ability to “pay attention” to the right part of the prompt degrades as the filled-in data grows. It’s a brittle, inefficient, and unreliable way to manage context.
The solution is to design an agent harness that acts as a context manager, implementing progressive disclosure. The harness, not the model, is responsible for managing the task’s state and providing the model with only the information needed for the current stage.
This leads to a multi-phase design, where different stages of the task use entirely different prompt structures.
Consider a simple “write code and open a pull request” agent. A monolithic approach would put everything in one prompt. A progressive disclosure approach would break it into distinct phases:
Phase 1: Planning
list_files(path)).auth-service code. 2. Identify the bug. 3. Write a fix. 4. Write a test. 5. Open a PR.”Phase 2: Implementation (repeated for each step)
read_file, write_file, edit_file).Phase 3: Review and Pull Request
git_diff, github_create_pr).github_create_pr tool with a well-written title and description.In this model, the harness is a state machine. The completion of one phase triggers the transition to the next, and with it, a completely new, purpose-built context for the model.
plan.md. The code from the Implementation phase is written to .py files. This makes the state transitions clean and decouples the phases.Progressive disclosure is about changing our mental model of agent interaction. We are not programming by dumping data into a context window. We are having a structured dialogue with the model, where each turn in the conversation is carefully staged to provide focus and clarity.
By taking on the burden of context management, our agent harnesses can dramatically improve reliability. We stop asking the model to be a master of prioritization and instead empower it to be a master of execution for a series of well-defined, tightly-scoped tasks. This shift—from a single, monolithic god prompt to a dynamic, multi-phase conversation—is a fundamental step in the evolution from brittle toys to reliable, production-ready AI agents.
The principle of progressive disclosure is a core tenet of context engineering, ensuring that an agent receives the right information at the right time, and nothing more.
Context is a Staged, Not Monolithic, Resource. Information should not be treated as a single, front-loaded block. A well-designed harness delivers context in stages, aligning the information provided with the agent’s current phase of work (e.g., planning vs. execution vs. review). This respects the model’s limited instruction budget and prevents cognitive overload.
Harness as a State Machine. The agent harness should be architected as a formal state machine. Each state or phase of a workflow must correspond to a distinct prompt template and a curated set of tools, ensuring the agent is always operating within a purpose-built, minimal context for the task-at-hand.
Artifact-Driven State Transitions. The transitions between states should be driven by the creation of durable artifacts. The completion of a plan.md file by the “planning” phase is the explicit, auditable signal that triggers the transition to the “implementation” phase. This makes the workflow transparent, recoverable, and less dependent on ephemeral in-memory state.