Feature Flags for the AI Era: Introducing Flagship
Key point
Cloudflare has unveiled Flagship, an OpenFeature-compatible service built on Workers/KV/DO.
Details
In an era where AI generates more code, and agents even handle deployment, testing, and rollout, safe autonomy becomes as important as speed. To address this, Cloudflare announced Flagship, a native feature flag service built on OpenFeature that works across Workers, Node.js, Bun, Deno, and browsers. In particular, on Workers, flags are evaluated within the Cloudflare network, making it the fastest option, according to Cloudflare.
In existing Workers environments, it was common to either hardcode flag logic directly in code or send HTTP requests to an external service. The former becomes hard to manage and audit as flags grow in number, while the latter incurs network round trips on every request, adding significant latency. Local evaluation SDKs are another alternative, but Worker isolates aren't long-lived processes, so assumptions about maintaining state don't hold.
Flagship solves this problem using Workers, Durable Objects, and KV. Changes are first written atomically to a Durable Object, then synced to Workers KV within seconds. When a request comes in, it reads directly from KV at the edge, and the evaluation engine inside the isolate computes targeting rules and percentage rollouts to return a variation. No external origin or third-party service sits in the evaluation path.
The Workers integration is provided via bindings. By specifying a FLAGS binding and app_id in wrangler.jsonc, you can evaluate flags directly within a Worker using getBooleanValue(), getStringValue(), getNumberValue(), getObjectValue(), and the various *Details() APIs. Evaluation errors are safely handled with default values, but type mismatches are treated as code bugs and throw exceptions.
The SDK is designed to be OpenFeature-native. Unlike existing flag SDKs that lock you into a proprietary interface, evaluation code remains largely unchanged even if you switch providers. In general server environments, you use FlagshipServerProvider with appId, accountId, and authToken, while in Workers, you simply pass the binding directly.
Functionally, it provides the scope expected of a typical flag service.
- Value types: boolean, string, number, JSON object
- Rule evaluation: multiple rules are evaluated in priority order, with the first match winning
- Condition combination: supports AND/OR nesting up to 5 levels
- Percentage rollouts: consistent hashing on the same context attributes enables stable gradual rollouts
- Operational features: audit trail, dashboard integration, team-based flag coordination
Cloudflare believes this service will become increasingly important as AI-generated code goes into production more frequently. Teams can use flags to limit blast radius, roll back immediately when issues arise, and gradually expose new code paths. Flagship is currently in private beta, and you can get started by applying for access and through the documentation, SDK, and source code.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.