CCloud Releases
Home
Following

Cloud Releases

Service catalogues and updates come from each provider's public product listing and announcements.

Explore

  • Home
  • Latest updates
  • Following

About

  • About
  • Contact
  • Privacy Policy
  • Terms of Use

Providers

  • Amazon Web Services
  • Microsoft Azure
  • Google Cloud
  • Cloudflare

Not affiliated with any cloud provider. Product names and logos belong to their owners.

  1. Providers
  2. ›Cloudflare
  3. ›Agents
  4. ›Update

Feature•Apr 13, 2026

Secure credential injection and dynamic egress policies for Sandboxes

AgentsCloudflare · Developer platform

Outbound Workers for Sandboxes and Containers now support zero-trust credential injection, TLS interception, allow/deny lists, and dynamic per-instance egress policies. These features give platforms running agentic workloads full control over what leaves the sandbox, without exposing secrets to untrusted workloads, like user-generated code or coding agents.

Credential injection

Because outbound handlers run in the Workers runtime, outside the sandbox, they can hold secrets the sandbox never sees. A sandboxed workload can make a plain request, and credentials are transparently attached before a request is forwarded upstream.

For instance, you could run an agent in a sandbox and ensure that any requests it makes to Github are authenticated. But it will never be able to access the credentials:

export class MySandbox extends Sandbox {} MySandbox.outboundByHost = { "github.com": (request: Request, env: Env, ctx: OutboundHandlerContext) => { const requestWithAuth = new Request(request); requestWithAuth.headers.set("x-auth-token", env.SECRET); return fetch(requestWithAuth); }, };

You can easily inject unique credentials for different instances by using ctx.containerId:

MySandbox.outboundByHost = { "my-internal-vcs.dev": async ( request: Request, env: Env, ctx: OutboundHandlerContext, ) => { const authKey = await env.KEYS.get(ctx.containerId); const requestWithAuth = new Request(request); requestWithAuth.headers.set("x-auth-token", authKey); return fetch(requestWithAuth); }, };

No token is ever passed into the sandbox. You can rotate secrets in the Worker environment and every request will pick them up immediately.

TLS interception

Outbound Workers now intercept HTTPS traffic. A unique ephemeral certificate authority (CA) and private key are created for each sandbox instance. The CA is placed into the sandbox and trusted by default. The ephemeral private key never leaves the container runtime sidecar process and is never shared across instances.

With TLS interception active, outbound Workers can act as a transparent proxy for both HTTP and HTTPS traffic.

Allow and deny hosts

Easily filter outbound traffic with allowedHosts and deniedHosts. When allowedHosts is set, it becomes a deny-by-default allowlist. Both properties support glob patterns.

export class MySandbox extends Sandbox { allowedHosts = ["github.com", "npmjs.org"]; }

Dynamic outbound handlers

Define named outbound handlers then apply or remove them at runtime using setOutboundHandler() or setOutboundByHost(). This lets you change egress policy for a running sandbox without restarting it.

export class MySandbox extends Sandbox {} MySandbox.outboundHandlers = { allowHosts: async (req: Request, env: Env, ctx: OutboundHandlerContext ) => { const url = new URL(req.url); if (ctx.params.allowedHostnames.includes(url.hostname)) { return fetch(req); } return new Response(null, { status: 403 }); }, noHttp: async () => { return new Response(null, { status: 403 }); }, };

Apply handlers programmatically from your Worker:

const sandbox = getSandbox(env.Sandbox, userId); // Open network for setup await sandbox.setOutboundHandler("allowHosts", { allowedHostnames: ["github.com", "npmjs.org"], }); await sandbox.exec("npm install"); // Lock down after setup await sandbox.setOutboundHandler("noHttp");

Handlers accept params, so you can customize behavior per instance without defining separate handler functions.

Get started

Upgrade to @cloudflare/containers@0.3.0 or @cloudflare/sandbox@0.8.9 to use these features.

For more details, refer to Sandbox outbound traffic and Container outbound traffic.

Read the original announcement↗

More from Agents

All Agents updates →
  1. Cloudflare API MCP server sends Workers Issues as MCP Events

    Workers Issues provides built-in error monitoring for Cloudflare Workers. It detects production failures and groups related failures into issues without an SDK or application wrapper.

    Agents•Feature•Oct 13, 2026
  2. New persistent browser tool in the Agents SDK, with tabs and logins that last between turns

    The Cloudflare Agents SDK now provides a browserTool that gives your agent a Browser Run browser it can return to on later turns.

    Agents•Feature•Oct 13, 2026
  3. New web_fetch tool in the Agents SDK for reading webpages and documents, with automatic markdown conversion

    The Cloudflare Agents SDK now provides a web_fetch tool that reads webpages, PDFs, and supported Office documents, using Workers AI Markdown Conversion to turn them into text the model can read.

    Agents•Feature•Oct 12, 2026
  4. Run OpenCode 2.0 on Cloudflare with the Agents SDK

    The Agents SDK now supports OpenCode 2.0 through the experimental OpenCodeHarness. Run OpenCode inside a plain Durable Object, with sessions stored in SQLite and Lifecycle jobs that wake interrupted work after eviction.

    Agents•Feature•Oct 12, 2026
  5. New web_search tool in the Agents SDK, powered by the Cloudflare Web Search API

    The Cloudflare Agents SDK now provides a web_search tool that searches the public web through the Cloudflare Web Search API, powered by ceramic.ai, Exa, and Linkup.

    Agents•Feature•Oct 12, 2026