Two Vendors, One Sandbox: The Agent Tooling Layer Is Quietly Deleting Its Own Catalog
CryptoSignal
92.8%. That is the input-token reduction Bifrost reports after it deleted its MCP tool catalog and replaced it with four generic tools. Cloudflare, working independently through its Agents SDK, landed on the same architecture and reported roughly 81%. Two vendors, two runtimes, one conclusion, shipped within months of each other without a shared memo.
I have watched this movie before. In 2017 I spent three weeks reverse-engineering a Solidity vesting schedule for an ICO that had raised on narrative and shipped on hope. The bug was an integer overflow. Nobody had audited it because everyone was reading the whitepaper instead of the contract. The lesson was not "audit more." The lesson was that the interface everyone optimizes for is rarely the interface that determines the outcome.
The agent tooling layer just made the same move. It stopped optimizing the interface it advertises and started optimizing the one that executes.
The traditional agent architecture is a phone book. An LLM is handed a catalog of tools — dozens, then hundreds of functions, each with a name, a description, a JSON schema, and sometimes a dependency chain.
This works until it doesn't. Catalogs grow with capability. Every new integration adds description tokens to every single request. The cost is not theoretical: it scales linearly with catalog size, and it is paid on every turn, including the turns where the agent uses none of it. Latency follows. Context windows fill with documentation instead of task state. The phone book becomes the bottleneck.
Bifrost, the open-source AI gateway from Maxim AI, shipped Code Mode in February 2025. Instead of hundreds of tool definitions, it exposes four generic tools and a Starlark sandbox. Starlark is a Python subset built for safe, deterministic execution — no I/O surprises, no ambient state, bounded semantics. The agent writes code instead of selecting functions.
Cloudflare took a different runtime to the same destination. Its Code Mode, part of the open-source Agents SDK, landed in February 2025 and has been revised through October 2026. Here the LLM writes TypeScript against a typed SDK and executes inside a sandboxed Worker via the Dynamic Worker Loader API. Production-grade serverless, not a Python interpreter with a seatbelt.
Anthropic's engineering team noted in November 2025 that code execution with MCP is a natural extension of the tool-use paradigm. Bifrost and Cloudflare went further. They made code execution the primary interface and demoted the catalog to a fallback.
Strip the marketing and what changed is an accounting fix with security consequences.
Under a catalog, the marginal cost of adding a tool is paid by every agent that never uses it. Under code generation, the marginal cost of a tool is paid only when the agent writes the line that touches it. The dependency inverts. Cost stops scaling with surface area and starts scaling with actual work.
Three things follow, and only one of them is the one being sold.
First, context is reclaimed. A 92.8% cut in input tokens is not a rounding error; it is the difference between a four-turn agent and a twelve-turn agent inside the same window. Second, the abstraction collapses. The agent no longer needs a schema for a tool it has never seen, provided the tool is reachable through code. Third, and this is the part nobody puts in the launch post, the whitelist is gone.
A tool catalog is a permissions list. The model can only call what is enumerated. Code mode replaces enumeration with a runtime. The blast radius is now defined by what the sandbox allows, not by what the catalog listed.
I learned this the expensive way. In 2020 I ran a Python script across Uniswap V2 and Compound that executed 4,200 arbitrage trades in three months for $18,000 in captured fees. The logic was correct. It was also irrelevant. A gas spike during a Sushiswap fork incident ate 40% of the gains in one hour, and the only thing that saved the position was that I could pull funds manually. Theoretical yield models do not survive network congestion. Neither do sandbox assumptions.
Starlark and TypeScript Workers are not equivalent security postures. Starlark's determinism is a real constraint: no arbitrary filesystem, no network calls outside the declared surface, reproducible execution. A TypeScript Worker with a typed SDK is more expressive and closer to production, which means the audit surface is larger and the failure modes are richer. Cloudflare's runtime is the better product. It is also the harder one to reason about.
Code doesn't lie. It also doesn't forgive. Measures what matters, not what feels good — the token number is measurable, the sandbox escape is not, until it happens.
This connects to the infrastructure bottleneck thesis: memory, execution, tooling, governance. Tooling is the layer that sets the exchange rate between agent capability and agent cost. Get it wrong and every downstream layer inherits the tax.
The consensus read is that this is a cost story. It is not. Cost advantages get arbitraged. If code generation saves 80-90% of input tokens, every gateway ships it within four quarters and the savings become table stakes rather than alpha. Token savings are a yield, and yield is just delayed volatility. What survives the arbitrage is the security debt.
Here is the blind spot. Prompt injection against a tool catalog is a bounded failure: the attacker can invoke listed tools with attacker-controlled arguments. Prompt injection against a code-generation agent is an arbitrary-execution failure. The attacker does not need a tool to exist. They need the model to write the line that reaches it.
The vendors know this. That is why both shipped sandboxes rather than shells. But a sandbox is a smart contract in disguise: only as good as its last audit, and brittle in exactly the places where the spec was vague. The catalog was a weak defense that was easy to verify. The sandbox is a strong defense that is hard to verify. Trading verifiability for expressiveness is a trade I have made before. It cost me money.
The question is no longer whether agents should write code instead of calling tools. Both vendors settled that. The question is who audits the runtime, and what the sandbox's default network egress actually is.
Watch the governance layer next. When the tooling layer standardizes this fast, the governance layer standardizes slower — and the gap is where the losses live. Which runtime wins matters less than which one publishes its escape tests.