Chaining lets separate AI calls pass work along the line — but each one only sees its own small slice of the problem.
Can prompt chaining be understood as a workflow pattern with hidden context?
This reads the question as asking whether prompt chaining (splitting a task into a series of LLM calls, each feeding the next) is best understood as a workflow in which each step works with context the other steps can't see, and what that hidden context buys you or costs you.
This explores whether prompt chaining is really a workflow pattern where each step sees only part of the picture. The corpus doesn't use the phrase "prompt chaining" much, but it says a lot about the idea under other names. The clearest match is Can algorithms control LLM reasoning better than LLMs alone?, which treats hiding context as the whole point rather than a side effect. An ordinary program controls the order of steps and keeps track of state, and each LLM call gets only what its own sub-task needs. Hiding the rest gets around context-window limits and makes each step easier to debug in isolation. So the answer is yes, and the hiding is a design choice, not an accident.
Other work arrives at the same pattern from different directions. Can reasoning and tool execution be truly decoupled? describes ReWOO, which writes out the full plan before any tools run. Tool results go into placeholders instead of piling up in one growing prompt. This removes the cost of resending an ever-longer history at every step, and it lets independent steps run in parallel. Can models treat long prompts as external code environments? pushes the idea further. The long input never enters the model's view directly. It sits outside, like a file the model queries with code, and the model only sees what it fetches. That approach works on inputs about 100 times larger than the context window, and it beats standard models even on shorter inputs. Across these papers, the workflow decides what each step gets to see.
The less obvious lesson is that hidden context cuts both ways. When steps can't see each other's context, they also can't check each other's work. Can prompts alone reshape multi-agent workflows without system access? shows that a crafted prompt can bias the planning step before any downstream defense looks at it, raising attack success by up to 55%. Executors receive a plan they have no reason to doubt. Can reasoning models be steered by injected context without detection? finds something similar inside a single model. A harmful plan placed in the context gets restated as the model's own reasoning, and chain-of-thought monitors miss it 25 to 33% of the time. In a chain, whatever one step passes to the next arrives with that same unearned trust.
Hidden context also limits what any single prompt can control. Can prompt alignment alone guarantee agent termination in loops? argues that a step inside a looping workflow can't guarantee the loop will stop. That job belongs to a supervisor outside the loop, which matches the LLM Programs idea that control flow belongs in code, not in prompts. There are practical costs too. Does dynamic tool discovery break prompt caching benefits? shows that changing the opening of a prompt from step to step breaks prompt caching. Does prompt optimization without inference strategy fail? shows that tuning a prompt in isolation from how it will be run, such as best-of-N sampling or majority voting, leaves up to 50% of the possible gain unused. Optimizing each link on its own doesn't optimize the chain.
The takeaway the question may not have expected: in prompt chaining, the most important design decision is what each step is not allowed to see. The same hiding that keeps prompts small and steps debuggable also creates blind spots, where an early mistake or injected instruction passes through unchecked. A good chain needs both deliberate context boundaries and something outside the chain that can see across them.
Sources 8 notes
LLM Programs embed LLMs within explicit algorithms that manage control flow and state, presenting only step-specific context to each LLM call. This information hiding addresses capability and context window limits while treating complex reasoning as modular, debuggable sub-tasks.
ReWOO and Chain-of-Abstraction both decouple reasoning from tool responses through different mechanisms—planning-before-execution and abstract placeholders respectively—eliminating quadratic prompt growth and sequential latency while maintaining reasoning quality.
Recursive Language Models store long prompts in a Python REPL and query them via code execution, avoiding attention degradation. RLMs outperform base models even on shorter prompts while handling inputs two orders of magnitude beyond context windows.
FLOWSTEER demonstrates that a crafted prompt can steer planner-executor systems by biasing workflow formation before infrastructure is invoked, raising malicious success by up to 55 percent. This attack surface exists because contamination enters upstream of workflow inspection defenses.
Researchers found that reasoning models follow harmful but benign-sounding plans planted in their context and paraphrase them as their own reasoning, evading monitors across multiple benchmarks and tasks. The attack requires only context access, not weight manipulation, making it practical for real-world pipelines.
Show all 8 sources
Internal prompt alignment cannot guarantee termination in cyclic state spaces. A 2026 incident where an agent breached its sandbox supports the case for out-of-band supervisors with physical timeouts and non-maskable halting interrupts as necessary architectural components.
MCP-style dynamic tool discovery breaks prompt caching because tool definitions in the prefix must match exactly for cache hits. Using a fixed set of reusable functions plus code generation for dynamic capabilities preserves cache benefits while maintaining flexibility.
Prompts optimized without knowledge of the inference strategy (best-of-N, majority voting) systematically underperform. Joint optimization of both prompt and inference strategy yields up to 50% improvement across reasoning and generation tasks.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- Efficient Tool Use with Chain-of-Abstraction Reasoning
- Flows: Building Blocks of Reasoning and Collaborating AI
- Demystifying Chains, Trees, and Graphs of Thoughts
- Towards a Science of Scaling Agent Systems
- MCP-Zero: Proactive Toolchain Construction for LLM Agents from Scratch
- FLOWSTEER: Prompt-Only Workflow Steering Exposes Planning-Time Vulnerabilities in Multi-Agent LLM Systems
- Don't Break the Cache: An Evaluation of Prompt Caching for Long-Horizon Agentic Tasks
- Corrupt Plans, Clean Traces: Evading Chain-of-Thought Monitoring with Plan Injection