Envelope
Envelope researches how predictable the cost of agentic work becomes when a model can invoke programmatic capabilities that advance a task outside its context window.
Standard agent harnesses capture the task as a prompt that is injected into the model’s context window. Everything that occurs in subsequent turns is added to that same context window.
This means cost to accepted completion can be an order of magnitude different from one run to the next for the same task because token spend is an unbounded variable.
Cost per token does not predict cost to accepted completion per task.
A recursive language model (RLM) harness (Zhang, Kraska, and Khattab, 2026) instead captures the task as a variable inside a Read-Eval-Print-Loop (REPL) program, and injects static instructions for interacting with the REPL program into the model’s context window.
Code is how the model examines the REPL program and takes action to advance the task. Code can bring parts of the task into the model’s context window, execute arbitrary actions, and invoke programmatic capabilities available to the model (such as tools and sub-RLMs).
The REPL program runs the model’s code, captures outputs as the code instructed, and returns the requested data into the model’s context window. This loop repeats until accepted completion of the task is achieved.
Envelope extends this design into a runtime that records token spend, persists REPL programs’ state, and hosts the programmatic capabilities available to the model across task runs.
This decomposes a task’s cost to accepted completion into tokens spent (unbounded cost variable) and programmatic capabilities invoked (bounded cost variable).
When a task repeatedly reaches accepted completion with high token spend, the programmatic capabilities available to the model do not yet effectively complete that task, making its cost to accepted completion less predictable across runs.
Envelope’s goal is a runtime where a task can advance through
tokens, programmatic capabilities, or both, with the telemetry needed
to observe which tasks repeatedly reach accepted completion through
high token spend. That identifies tasks that programmatic
capabilities do not yet effectively complete.
Once established, those capabilities are hosted as durable state
outside the model’s context window, so repeated tasks resolve
into invokable, known-cost computation instead of being re-derived
through unbounded token spend on each run.
Envelope’s bet is that cost to accepted completion for agentic work will be lower and more predictable inside its runtime design compared to standard agent harnesses.
NOTEBOOK.md records observations and evidence that shape Envelope’s direction.
Citations
- Zhang, A., Kraska, T., and Khattab, O. (2026). Recursive Language Models. https://arxiv.org/abs/2512.24601
- Zhang, A., and Khattab, O. (2026). Recursive Language Models (blog). https://alexzhang13.github.io/blog/2026/harness/
-
alexzhang13/rlm-minimal, read at commit973f8d4acf3af2c86dc170af91607bf8b0c4d0ea. https://github.com/alexzhang13/rlm-minimal -
alexzhang13/rlm, read at commit72d6940142ddfb84ee6be573dc999a37e633e671. https://github.com/alexzhang13/rlm -
alexzhang13/rlm-examples, read at commit7b91f37e95b2880e5c3315be67c42f8d12d092f2. https://github.com/alexzhang13/rlm-examples