Cloudflare changelogs | Developer platform

Cloudflare changelogs for Developer platform products

马上订阅 Cloudflare changelogs | Developer platform RSS 更新: https://developers.cloudflare.com/changelog/rss/developer-platform.xml

Agents, Workers, Workflows - Run AI-generated code on-demand with Code Sandboxes (new)

2025年6月25日 08:00
AgentsWorkersWorkflows

AI is supercharging app development for everyone, but we need a safe way to run untrusted, LLM-written code. We’re introducing Sandboxes, which let your Worker run actual processes in a secure, container-based environment.

import { getSandbox } from "@cloudflare/sandbox";
export { Sandbox } from "@cloudflare/sandbox";
export default {
async fetch(request: Request, env: Env) {
const sandbox = getSandbox(env.Sandbox, "my-sandbox");
return sandbox.exec("ls", ["-la"]);
},
};

Methods

  • exec(command: string, args: string[], options?: { stream?: boolean })...

剩余内容已隐藏

查看完整文章以阅读更多