EngineeringMay 27, 2026Updated: May 27, 20264 min read

Cloudflare Flagship: Feature Flags Built for the Age of AI Agents

Cloudflare Flagship brings native feature flag evaluation to Workers with no external round-trips. Here's what it means for teams shipping AI-assisted code.

L

Lugon

Vibe Engineer

Share article
Cloudflare Flagship: Feature Flags Built for the Age of AI Agents

AI agents are writing and deploying code faster than ever. But the harder question isn't speed — it's safety. When an AI agent can push code to production autonomously, how do you prevent it from breaking real users?

Cloudflare's answer is Flagship, a native feature flag service built on Workers, Durable Objects, and KV. It lets AI agents ship behind flags, test in production, observe results, and ramp rollouts without waiting for a human at every gate. For builders shipping AI-assisted code, this is the missing infrastructure piece.

The core problem Flagship solves

Most feature flag tools assume a long-lived process. They download flag rules into memory, evaluate locally, and assume the SDK instance persists between requests. That model breaks on Workers — every request could spin up a new isolate, and there's no persistent connection to keep flag configs warm.

Cloudflare solved this by building on primitives it already owns. When you create a flag, the control plane writes atomically to a Durable Object — a SQLite-backed, globally unique instance that serves as the source of truth. Within seconds, the flag config syncs to Workers KV, which is already distributed across Cloudflare's network. Evaluation happens locally on the edge, with no outbound request per flag check.

The result is sub-millisecond flag evaluation inside Workers, without reaching back to an external service on every user request.

How AI agents use Flagship as a safety layer

The workflow is designed for agentic deployment:

  • An agent writes a new code path behind a flag — the flag is off, so nothing changes for users.
  • The agent enables the flag for itself or a small test cohort, exercises the feature in production, and observes metrics.
  • If results look good, it ramps the rollout. If something breaks, it disables the flag. The blast radius is contained.
  • Human developers set the boundaries — rollout percentages, targeting rules, and abort conditions. The agent operates within those constraints. This decouples deployment from release and decouples human attention from every shipping step.

    The targeting model

    Flagship supports eleven comparison operators and logical AND/OR grouping. You can serve different flag values based on user attributes, request headers, geolocation, or arbitrary context. Flag variations can be booleans, strings, numbers, or structured JSON objects — useful for delivering entire configuration blocks as a single flag.

    Percentage rollouts use consistent hashing, so the same user always gets the same flag value, even as the percentage changes.

    OpenFeature compatibility

    Flagship is compatible with OpenFeature, the CNCF open standard for feature flag evaluation. The @cloudflare/flagship SDK works from Workers, Node.js, Bun, Deno, and the browser — swap providers without changing evaluation code. The native Workers binding is fastest, but the OpenFeature path means you're not locked in.

    import { FlagshipServerProvider } from '@cloudflare/flagship';
    

    await OpenFeature.setProviderAndWait(
    new FlagshipServerProvider({ binding: env.FLAGS })
    );

    What this means for builder teams

    Feature flags are not new. But native flag evaluation inside Workers — with no latency penalty, no external round-trip, and agent-safe blast radius control — is a meaningful step for teams building AI-assisted products.

    If you're building with AI coding tools and deploying to Cloudflare Workers, Flagship closes the loop between "agent writes code" and "agent ships safely." The flag becomes the contract between autonomous code and controlled user experience.

    Cloudflare Flagship is available in closed beta.

    FAQ

    Does Flagship work outside of Cloudflare Workers?

    Yes — via the OpenFeature SDK, which works in Node.js, Bun, Deno, and browsers. But evaluation is fastest inside Workers, where flag configs are cached locally on the edge.

    How does Flagship compare to LaunchDarkly or Split on Workers?

    Traditional flag SDKs make an outbound HTTP request per evaluation, which adds latency and requires an external service. Flagship evaluates locally from KV with no outbound request, matching the latency model of Workers.

    Can AI agents create and manage flags programmatically?

    Yes. The control plane API lets agents create, update, enable, and disable flags without a human gate. Human developers define the rules and boundaries; the agent operates within them.

    Is there a cost for Flagship?

    Pricing details are available on Cloudflare's plan pages. Workers KV usage and Durable Object operations both factor into the cost model.
    cloudflareflagshipfeature-flagsai-agentsworkersdevopsengineering
    Share article
    Start Your Project

    Ready to transform?

    Discover how TeguFy can help your business simplify, amplify, and fortify with AI, Blockchain, and cutting-edge technology.

    Cloudflare Flagship: Feature Flags Built for the Age of AI Agents