Cloudflare Dynamic Workers are small, sandboxed programs that another program creates while it’s running, so it can execute code that wasn’t written in advance, such as code from an AI agent. The security benefit is control: your application decides what that code can see, call and reach.

In plain terms

Think of a visiting contractor at your plant. You don’t hand over the master key. You issue a badge for one job, open only the doors that job needs and collect the badge afterward.

A Dynamic Worker treats unfamiliar code the same way. It runs in an isolate, a walled-off space inside the JavaScript engine Chrome uses. This is lighter than a container, which is closer to building the contractor a separate workshop for each visit. See Cloudflare’s Dynamic Workers documentation.

What are the security benefits?

Control Analogy What it protects against
Isolated sandbox A guarded weld cell Code reading memory that belongs to other programs
Bindings (approved connections) A tool crib that issues only the tools on the work order Code using data or services you didn’t hand it
Network blocking or filtering A phone that dials approved numbers or none Data being sent to unknown places
Credential injection A receptionist who stamps the company account number on outgoing orders Code seeing and leaking passwords or API keys
Resource limits A breaker on a single circuit Runaway code consuming too much
Logs The visitor sign-in sheet Activity nobody can review later

These controls only help if they’re configured. For example, a developer can block all outbound network access by setting globalOutbound to null. Set it deliberately and don’t rely on the default.

Example

Here’s a hypothetical. A distributor’s quoting assistant writes a short script to check stock for a buyer. The script runs in a Dynamic Worker that has one connection: read-only inventory lookup. Its internet access is off.

If someone tricks the assistant into writing code that emails out the customer list, that code has no customer list and no way out. It’s a temp worker locked in the stockroom with a clipboard. They can count parts, but the sales office is closed to them.

What don’t they protect against?

A sandbox isn’t a guarantee. If you give the code write access to your pricing, it can change your pricing. A badge that opens every door isn’t much of a badge.

Isolates also carry a different risk than full virtual machines. Cloudflare says in its launch post that security bugs are more common in V8, the engine behind isolates, than in typical hypervisors, and it adds further layers of defense for that reason.

Why it matters for manufacturers

You probably won’t build one yourself. A software vendor or developer might, when adding an AI assistant to a quoting tool, customer portal or CRM connection. Ask them:

  • What data and actions can the AI-written code reach?
  • Can it connect to the internet, and to which addresses?
  • Does it ever see our passwords or API keys?
  • Which actions need a person’s approval?
  • What gets logged, and who reviews it?

Related terms

Frequently asked questions

Are Dynamic Workers the same as regular Cloudflare Workers?

They use the same underlying technology. A regular Worker is deployed ahead of time, like a permanent employee. A Dynamic Worker is created at runtime by another Worker, like a temp called in for a specific job.

Do Dynamic Workers make AI-generated code safe?

They make it safer by limiting what it can reach. They don't check that the code is correct, and they can't protect anything you've deliberately given it permission to change.


Written by: Jake Lett
Jake Lett is a B2B marketing consultant with over 15 years of experience in the digital marketing industry. He specializes in SEO, HubSpot, and PPC campaign management. Jake has a proven track record of helping businesses increase their online visibility and drive more traffic, leads and sales. He is a Certified Google Ads Specialist and a Certified HubSpot Developer.

Related posts
Have a question?
Email me your quesiton