Ideas from AI Engineer talks Curated by Alex Vidal (@dobleio) and Borja Pérez (@borjaperfra) 76 ideas · 101 talks · 5 events

The Engineering Brief

Cloudflare lets agents use its whole API by writing typed code in a sandbox

Matt Carey (Cloudflare) explains why one tool per endpoint could not cover Cloudflare's API, and how its Code Mode instead gives the model generated TypeScript types to write code against, run in an isolated worker with no secrets and controlled network access.

Matt CareyCloudflareAIE Europe 20262 min read
Watch from 2:47

Recording by AI Engineer.

The idea

The speaker’s argument, in our words.

Cloudflare wanted agents to reach its whole API, about 2,600 endpoints by Carey's count. One MCP tool per endpoint would not fit in context, and splitting the API into product servers left coverage gaps and made users pick a server in advance. Carey treats this as a loading problem, since MCP does not require a client to put every tool in context. Rather than a CLI the agent explores with help commands (which needs a shell) or tool search (which still loads definitions the model will not use), he argues for generating TypeScript types from the OpenAPI spec and letting the model write a short program against them. One program can loop over and combine calls that would otherwise take many tool turns.

The catch is that someone has to run code nobody has read. Cloudflare creates a V8 isolate per execution; in the demo the session's authorization was read-only even though the code could address the whole API. Carey adds that APIs then need rate limits built for agents running programs in loops across many sandboxes.

What they found

From the talk. Figures are self-reported unless stated.
  • Naive tools generated from every endpoint of Cloudflare's OpenAPI spec would take over a million tokens; splitting into 16 product servers cut context but left gaps, which he illustrates with a product suite that might have six tools against about 30 endpoints.

    Cloudflare's own figures, spoken, not shown with method. The transcript gives both 2.3 million and 1.1 million tokens in one sentence, so only 'over a million' is used. Endpoint gap example at 4:00.

    Vendor claim

    3:21
  • Generate TypeScript types from the OpenAPI spec and let the model write code against that typed SDK; types are a concise way to describe inputs and outputs.

    Recommendation shown with a demo listing and deploying workers.

    Technical recommendation

    7:42
  • In a live demo, generated code ran in a dynamic worker that saw no environment secrets and was refused internet access until the host enabled it; Cloudflare's MCP server allows only specific domains.

    Demo of Cloudflare's own product; no security testing described.

    Case study

    12:25

Why it matters

Our reading. Not said in the talk.

GitHub, Apify and Cloudflare all describe tool overload as a loading problem and put the fix in different places: the server's defaults, a CLI on the client, or typed code. Teams that take Cloudflare's route inherit two jobs: running model-written code with no ambient authority, and protecting their own API from it.

What one could try

  • For a large API, try generating a typed client from its OpenAPI spec and measure how many tokens the agent needs with that versus per-endpoint tools.
  • If you execute model-written code, run it where it has no ambient secrets and network access is allow-listed per domain.
  • Check the rate limits on any API agents will call from generated code, since a loop can issue many requests at once.

Limitations

  • Vendor talking about its own platform; the token figures are not shown with method and the transcript is garbled on the spec size.
  • Isolation is shown in a demo, not tested against attacks in the talk.
  • No comparison of task success or cost between code mode, tool search and CLIs.

Original sources

This is our synthesis of the talk, checked against the transcript at the linked moments.

Related ideas