Markdown Editor

Feature Flag Policy Template (OpenFeature)

Feature flag standard: flag types and lifetimes, naming, metadata, lifecycle, rollout stages, kill switches, change control, testing, privacy, flag debt

소프트웨어 및 엔지니어링전체OpenFeature specification v0.9.0Apache-2.0 (spec); CC BY 4.0 (docs)featureflagpolicy

사용법: Use it when teams use feature flags and you need common rules for creating, changing and removing them. Fill the flag types with maximum lifetimes and the production change rules first. The main pitfall is flags that are never removed, so every flag gets an owner and expiry at creation.

미리보기

Feature Flag Policy: [Organisation or product line]

Standard for using feature flags safely: flag types and their maximum lifetimes, naming and required metadata, lifecycle and expiry, targeting and evaluation context, defaults and failure behaviour, kill switches, change control and audit, testing, observability, security and privacy, and the management of flag debt. Evaluation terms (provider, evaluation context, targeting key, hooks, events, resolution reasons and error codes) follow the OpenFeature specification, release v0.9.0 (July 2026), so the policy stays independent of the flag vendor or in-house service in use. Replace every [bracketed] value and every row marked Example.

Document control

FieldValue
Document ID[STD-FF-001]
Version[0.1]
Status[Draft / Approved / Superseded]
Owner[@platform-engineering-lead]
Approvers/reviewers[@vp-engineering], [@sre-lead], [@appsec-lead], [@head-of-product], [@privacy-officer]
Last updatedYYYY-MM-DD
Classification[Internal]
Applies to[All services, web and mobile clients that evaluate flags]
Flag platform[Vendor product or in-house service, version]
SDK abstraction[OpenFeature SDKs for languages in use / in-house client]
Effective fromYYYY-MM-DD
Next scheduled reviewYYYY-MM-DD

Approvals

RoleNameDecisionDate
VP Engineering[@name][Approve / Approve with conditions / Reject]YYYY-MM-DD
SRE lead[@name][Decision]YYYY-MM-DD
Application security lead[@name][Decision]YYYY-MM-DD
Head of Product[@name][Decision]YYYY-MM-DD
Privacy officer[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft
1.0YYYY-MM-DD[@name]Example: Approved; release flags limited to 90 days
1.1YYYY-MM-DD[@name]Example: Two-person approval added for kill switches on payment paths

Contents

1. Purpose, scope and principles

1.1 Purpose

Feature flags let [Organisation] separate deployment from release, roll out gradually, run experiments and switch off failing functionality without a deploy. The same power creates risk: every flag doubles the number of code paths, a flag change can break production as surely as a bad deploy, and forgotten flags turn into hidden configuration nobody understands. This standard keeps the benefits and limits the risk.

1.2 Scope

In scope: every runtime switch that changes application behaviour for some or all users and is evaluated from a flag platform, a configuration service or an environment-specific rule set, in back-end services, web front ends and mobile apps.

Out of scope: static build-time configuration that requires a redeploy, infrastructure configuration managed as code, and licence enforcement inside commercial products we buy. Runtime configuration values (limits, thresholds) delivered by the same platform follow section 8 when they act as operational controls and the Configuration Reference (docs/configuration-reference) otherwise.

1.3 Principles

  • A flag is temporary unless it is explicitly typed as long-lived.
  • The default value is the safe value, and the code works when the flag platform is unreachable.
  • Flag changes in production are changes: authorised, recorded, observable and reversible.
  • Entitlements and security decisions are enforced on the server, never only by a client-side flag.
  • Code reads flags through one abstraction (OpenFeature SDK or an in-house wrapper), never by calling a vendor API directly from business logic.

2. Roles and responsibilities

ActivityFlag owner (team)Product managerSRE / on-callPlatform engineeringAppSecPrivacy
Create flag with metadataA/RCII--
Plan and run rolloutA/RCCI--
Change targeting in productionA/RCII--
Operate kill switch during an incidentCIA/RI--
Remove flag and dead codeA/RI-I--
Operate flag platform, SDKs and audit logI-CA/RC-
Approve new evaluation context attributesR--CCA
Approve exceptions (section 14)RCCACC

R = responsible, A = accountable, C = consulted, I = informed. The flag owner is a team, not a person, so ownership survives staff changes.

3. Policy statements

IDStatementEnforced by
FF-01Every flag MUST have a type, owning team, description, linked ticket and expiry date (or review date for long-lived types) at creation.Flag platform required fields
FF-02Flag keys MUST follow the naming convention in section 5.1.Platform validation; CI lint
FF-03Release and experiment flags MUST NOT exceed the maximum lifetime in section 4 without an approved extension.Expiry report; platform alerts
FF-04Code MUST pass a safe default value to every evaluation and MUST behave correctly when the default is returned.Code review; tests in section 10
FF-05Production flag changes on Tier 1 services MUST be made through the flag platform with audit logging; changes to Tier 1 kill switches and to rules reaching 100% of users MUST have a second approver as set in section 9.1, except during a declared incident (section 8).Platform approval workflow
FF-06Evaluation context MUST contain only attributes on the approved list (section 12.2); personal data MUST NOT be sent to a third-party flag service unless the privacy assessment approves it.Context schema; privacy review
FF-07Permission and entitlement decisions MUST be enforced server-side; client-side flags MAY only hide or show UI.Security review
FF-08Secrets, credentials and personal data MUST NOT be stored in flag values or variants.Platform scanning; review
FF-09Both the on and off paths of a flag MUST be covered by automated tests while the flag exists.CI
FF-10Flag evaluations SHOULD emit telemetry that identifies flag key, variant and reason, so incidents can be correlated with flag changes.OpenFeature hook; observability review
FF-11A flag fully rolled out or abandoned MUST be removed from code and platform within the cleanup window in section 6.3.Flag debt report
FF-12Operational kill switches MUST be tested in production-like conditions at least [quarterly].Game day records

4. Flag types and lifetimes

TypePurposeTypical change frequencyMaximum lifetime (Example)Who changes in production
ReleaseHide unfinished or unreleased work; progressive delivery of a new featureSeveral times during rollout, then never90 days from creationFlag owner team
ExperimentAssign users to variants for an A/B or multivariate testSet at start and end of the testTest duration plus 30 daysFlag owner with product manager
Operational (kill switch, degradation)Turn off or degrade a non-essential function under load or failureRarely, often during incidentsLong-lived; review every 6 monthsOn-call SRE and flag owner
Permission (entitlement)Grant features to plans, tenants or beta cohortsWhen contracts or plans changeLong-lived; review every 6 months, or move to the entitlement serviceProduct operations through a controlled process
MigrationSwitch between old and new implementations or data paths during a migrationDuring the migrationEnd of migration plus 30 daysFlag owner team

A release flag that has to stay longer than its lifetime is either an unfinished project (extend under section 14) or a disguised permission or operational flag (change its type, owner and review cadence).

5. Naming and metadata

5.1 Naming convention

Format: <team>.<area>.<type-prefix>-<short-description> in lower case, words separated by hyphens, no personal names and no dates.

TypePrefixExample key
Releaserelcheckout.payments.rel-apple-pay-express (Example)
Experimentexpstorefront.search.exp-ranking-model-v3 (Example)
Operationalopscheckout.fraud.ops-disable-third-party-scoring (Example)
Permissionpermstorefront.reports.perm-advanced-analytics (Example)
Migrationmigorders.storage.mig-read-from-new-ledger (Example)

Keys are never reused. A removed key stays reserved in the platform archive.

5.2 Required metadata

FieldRule
KeyPer 5.1
TypeOne of the types in section 4
DescriptionWhat the flag changes for the user, in one sentence
Owning teamA team handle, not a person
TicketLink to the work item or experiment plan
CreatedDate, set by the platform
Expiry or review dateRelease, experiment and migration: expiry. Operational and permission: next review date
Default valueThe safe value returned when evaluation fails
VariantsNames and values; booleans need no extra names
TierTier of the most critical service that evaluates it
DependenciesOther flags this flag requires or excludes

5.3 Flag register extract

Flag IDKeyTypeOwnerDefaultCreatedExpiry or reviewState
FLG-0412 (Example)checkout.payments.rel-apple-pay-expressReleaseteam-checkoutoff2026-08-042026-11-02Rolling out (25%)
FLG-0398 (Example)checkout.fraud.ops-disable-third-party-scoringOperationalteam-riskoff (scoring on)2025-11-10Review 2026-11-10Active
FLG-0377 (Example)storefront.search.exp-ranking-model-v3Experimentteam-searchcontrol2026-07-012026-09-30Expired, cleanup overdue
[FLG-NNNN][Key][Type][Team][Default]YYYY-MM-DDYYYY-MM-DD[State]

FLG-0412 was created on 2026-08-04; 90 days later is 2026-11-02, the expiry shown.

6. Lifecycle and expiry

6.1 States

A flag moves through the states below. Operational and permission flags skip the rollout states and stay LongLived until they are no longer needed; every other type is expected to reach Removed.

6.2 Expiry handling

  1. The platform notifies the owning team [14] days before a flag's expiry and again on the day.
  2. On expiry the flag appears on the flag debt report (section 13) and the team's dashboard.
  3. An extension needs a reason and new date, approved by the engineering manager (first extension) or platform engineering (second and later).
  4. A flag expired for more than [30] days blocks new flag creation by the owning team in the same service until resolved, unless an exception is approved.

6.3 Cleanup

  • Cleanup window (Example): release and migration flags are removed within 30 days of reaching FullyOn or RolledBack (abandoned); experiment flags within 30 days of the decision.
  • Removal is a normal code change: remove the flag check, delete the losing branch and its tests, then archive the flag in the platform after the code is deployed everywhere, including the oldest supported mobile app version.
  • Create the cleanup ticket at the same time as the flag, so the work is planned rather than remembered.

7. Evaluation, targeting and rollout

7.1 Evaluation through OpenFeature concepts

  • Application code calls the flag evaluation API with a flag key, a typed default value (boolean, string, number or structure) and, where needed, an evaluation context.
  • A provider connects the API to the flag platform. Code never depends on a provider directly, so the platform can be replaced.
  • The evaluation context carries the targeting key (a stable identifier such as a pseudonymous user ID or tenant ID) and approved attributes (section 12.2).
  • Evaluation details include a resolution reason, such as STATIC, DEFAULT, TARGETING_MATCH, SPLIT, CACHED, DISABLED, UNKNOWN, STALE or ERROR, and on failure an error code, such as PROVIDER_NOT_READY, FLAG_NOT_FOUND, PARSE_ERROR, TYPE_MISMATCH, TARGETING_KEY_MISSING, INVALID_CONTEXT, PROVIDER_FATAL or GENERAL. Log and measure these (section 11).
  • Hooks run code at the before, after, error and finally stages of an evaluation; use them for telemetry and validation, not for business logic.
  • Applications wait for the provider ready event, or use the safe default until it arrives, and handle error and stale events.
  • Experiment and rollout metrics MAY be recorded through the OpenFeature tracking API (added in specification v0.9.0), using the same evaluation context as the evaluation, so variants and outcomes such as conversions or errors join cleanly. Tracking events follow the same attribute allow list as the context (section 12.2).

7.2 Failure behaviour

SituationRequired behaviour
Provider not ready at startupUse defaults; do not block startup longer than [2] seconds
Platform unreachableServe last known values from the SDK cache; fall back to defaults when no cache exists
Flag not found or type mismatchReturn default; log error code; alert if the rate exceeds the threshold in section 11
Malformed targeting rule pushedPlatform validation rejects it; if it reaches clients, evaluation returns default with reason ERROR

7.3 Targeting and rollout

  • Percentage rollouts MUST bucket on the targeting key with consistent hashing so a user keeps the same variant as the percentage grows.
  • Use the tenant or account ID as the targeting key when the whole tenant must see one behaviour (B2B features, billing).
  • Roll out in stages with guardrail checks between stages.
StageExposure (Example)Minimum soak (Example)Guardrails checked
0Internal staff tenant1 business dayError rate, latency p95, support tickets
11% of traffic24 hoursError rate within 0.1 percentage points of control; no new Sev 1 or 2
210%24 hoursSame, plus conversion not below control by more than the agreed margin
350%48 hoursSame
4100%7 days stabilisation before cleanupSame

Experiment flags follow the sample size, duration and stopping rules of their A/B Test Plan (product/ab-test-plan) instead of this staged rollout.

7.4 Flag dependencies

Avoid flags that depend on other flags. Where unavoidable, record the dependency in metadata (section 5.2), evaluate the prerequisite first, and test the allowed combinations. A combination that must never happen is enforced by the platform's prerequisite rules, not by convention.

8. Kill switches and operational flags

  • Every external dependency on a Tier 1 user path that can fail independently (third-party scoring, recommendations, non-essential widgets) SHOULD have an operational flag that degrades it gracefully.
  • Kill switches are listed in the service runbook (dev/runbook) with the expected effect, the metric that shows it worked and how to restore.
  • Kill switches evaluate locally from cached rules, so they work when the flag platform is slow or down. Critical kill switches MAY also have a static configuration fallback.
  • During a declared incident the incident commander or on-call SRE may flip a kill switch without second approval; the change is recorded in the incident timeline.
IDFlag keyEffect when onProof it workedLast tested
KS-007 (Example)checkout.fraud.ops-disable-third-party-scoringCheckout uses in-house rules only; third-party call skippedThird-party call rate drops to 0 within 60 seconds; checkout success rate stable2026-09-18 game day
KS-011 (Example)storefront.home.ops-disable-recommendationsHome page shows static bestseller listRecommendation service traffic drops; home p95 latency falls2026-08-21
[KS-NNN][Key][Effect][Metric]YYYY-MM-DD

Kill switches are exercised in the Game Day Plan (ops/game-day-plan).

9. Change control, access and audit

9.1 Access

EnvironmentWho can change flagsApproval
Development and testAny engineer on the owning teamNone
StagingOwning teamNone
Production, Tier 2 and 3Owning teamSelf, with change note
Production, Tier 1Owning teamSecond approver from the owning team or SRE for rules reaching 100% of users and for kill switches outside incidents
Production, permission flagsProduct operations roleLinked customer or plan change

Access is granted through single sign-on groups with least privilege; there are no shared accounts. Platform API tokens used by automation are scoped to one project and environment and rotated.

9.2 Change records

  • The platform audit log records who changed which flag, what changed, when, and the change note, and is retained for at least [1 year] (Example; align with the security logging standard).
  • Flag changes are exported to the observability stack as change events, so dashboards show them next to deployments.
  • A flag change that alters behaviour for all users of a Tier 1 service is a standard change under Change Request (ops/change-request), pre-approved by this policy when it follows section 7.3.
  • Flags MAY be managed as code (definitions in a repository, applied by a pipeline). When they are, the repository review replaces platform approval, and emergency changes in the platform are reconciled back to code within one business day.

9.3 Freeze periods

During change freezes (for example peak trading days), only kill switches and rollbacks are allowed on Tier 1 flags.

10. Testing

  • Unit and integration tests cover both values of a boolean flag and every variant of a multivariate flag that can reach production.
  • At least one end-to-end suite runs with all flags at their default values, which is what users get when the platform fails.
  • Tests set flags through an in-memory test provider or the SDK's testing utilities, never against the shared production platform.
  • When two flags interact, test the combinations that production rules allow; document disallowed combinations as prerequisites (section 7.4).
  • Removing a flag removes its tests for the deleted path in the same change.

11. Observability

SignalSourceUseAlert (Example)
Flag change eventsPlatform audit log exportOverlay on service dashboardsNone (context only)
Evaluation count by flag, variant and reasonOpenFeature after hook, aggregated metricRollout progress, detect stale flags (zero evaluations for 30 days)None
Evaluation errors by error codeOpenFeature error hookDetect provider outages and type mismatchesError ratio above 1% for 5 minutes on a Tier 1 service
Provider events (ready, error, stale, configuration changed)SDK event handlersDetect platform connectivity problemsProvider error or stale for more than 5 minutes
Variant on tracesSpan attribute or eventCorrelate errors and latency with variantsThrough service SLO alerts

The OpenTelemetry semantic conventions for feature flag evaluations are at Development status as of October 2026; use them for attribute names where your stack supports them and check the current status at opentelemetry.io. Do not record the full evaluation context; record the flag key, variant and reason.

12. Security and privacy

12.1 Security rules

  • Client-side SDKs receive only the flags and evaluated values that client needs; flag keys and descriptions visible to clients must not reveal confidential plans.
  • Permission flags gate UI only on clients; the server enforces the entitlement on every request (FF-07).
  • Flags never hold secrets (FF-08); secrets come from the secrets manager.
  • The flag platform is a production control plane: protect it with SSO, multi-factor authentication, least privilege and audit, and include it in threat models of the services that depend on it (Threat Model, security/threat-model).
  • Client-side flag payloads are treated as user-controllable: a user can change what their client evaluates, so never rely on a client flag for a security decision.

12.2 Evaluation context attributes

AttributeClassificationAllowed for third-party platformNotes
targetingKey (pseudonymous user ID) (Example)Pseudonymous personal dataYes, if covered by the data processing agreementNever e-mail address or name
tenantId (Example)Business identifierYes
plan (Example)Business attributeYes
country (Example)Coarse locationYesCountry only, no city or coordinates
appVersion, platform (Example)TechnicalYesNeeded for mobile rollouts
E-mail, name, IP address, precise locationPersonal dataNoEvaluate in-house if required
[Attribute][Class][Yes/No][Notes]

New attributes need privacy approval (FF-06). Where the platform is a third-party service, the vendor is a processor and the data processing agreement and transfer basis must cover the attributes sent.

13. Flag debt and cleanup

The platform team publishes a monthly flag debt report per team: expired flags, flags fully rolled out but not removed, flags with zero evaluations for 30 days, and flags without an owning team. Teams plan cleanup in the next iteration; the engineering manager reviews it in the monthly operational review.

Worked example (Example): Corvid's checkout team owns 46 flags. Of these, 30 are release or experiment flags and 16 are long-lived. Seven release or experiment flags are past expiry, so the expired ratio is 7 / 30 x 100 = 23.3%, above the 10% target in section 15. The team schedules removal of FLG-0377 and the six other expired flags in the next iteration and blocks new release flags in the checkout service until the ratio is below target.

Flag debt that cannot be removed quickly because of old mobile app versions is recorded in the Technical Debt Register (architecture/tech-debt-register) with the minimum app version that will allow removal.

14. Exceptions

An exception names the statement (section 3), the flag or service, the reason, compensating controls, approver and expiry, at most [6] months ahead.

IDStatementFlag or serviceReasonCompensating controlsApproverExpires
EXC-FF-004 (Example)FF-03FLG-0352 orders.storage.mig-read-from-new-ledgerLedger migration extended by finance year-end freezeWeekly review in migration stand-up; both paths tested in CIPlatform engineering lead2027-02-28
EXC-FF-005 (Example)FF-11Mobile app flags for versions below 7.28% of active devices still on old versionsForced-upgrade prompt planned for 2027-01; flags documented in tech debt registerHead of mobile2027-03-31
[EXC-FF-NNN][FF-NN][Flag][Reason][Controls][@name]YYYY-MM-DD

15. Compliance measurement

IDMetricFormulaTarget (Example)
FF-M01Metadata completenessflags with all required metadata / all flags x 100100%
FF-M02Expired temporary flagsrelease, experiment and migration flags past expiry / all such flags x 100Below 10%
FF-M03Median age of release flags at removalmedian days from creation to removal for release flags removed in the period60 days or fewer
FF-M04Production changes with approval where requiredapproved Tier 1 changes / Tier 1 changes requiring approval x 100100%
FF-M05Kill switches tested on schedulekill switches tested in the last quarter / kill switches x 100100%
FF-M06Incidents caused by flag changesincidents with a flag change as a contributing factor, count per quarterTrend down; each one reviewed in a postmortem
FF-M07Evaluation error ratioevaluations with reason ERROR / all evaluations x 100, per Tier 1 serviceBelow 0.1%

Incidents linked to flag changes are analysed with the Postmortem template (dev/postmortem).

16. Review cycle

  • Scheduled review every 12 months by the policy owner with SRE, AppSec, product and privacy.
  • Early review after: an incident caused by a flag change or a stale flag; a change of flag platform or SDK abstraction; a new OpenFeature specification release that changes stable sections used here; a new class of client (for example a new mobile platform).
  • Review outcomes are recorded in the revision history.

17. Glossary and references

17.1 Glossary

TermMeaning
Feature flagA runtime switch that selects between code paths or values without a deploy
VariantOne of the possible values a flag can return
ProviderThe OpenFeature component that connects the evaluation API to a flag platform
Evaluation contextAttributes about the user, tenant or environment used for targeting
Targeting keyThe stable identifier used for targeting and percentage bucketing
Resolution reasonWhy a value was returned, for example a targeting match or the default
Kill switchAn operational flag that turns off a function to protect the service
Flag debtFlags and dead code paths that should have been removed
Progressive deliveryReleasing a change to growing audiences with checks between stages

17.2 References

ReferenceUse
OpenFeature specification, release v0.9.0 (July 2026), openfeature.dev/specification and github.com/open-feature/spec; sections carry their own status (Experimental, Hardening, Stable)Evaluation API, providers, context, hooks, events, tracking, reasons and error codes (sections 7 and 11)
OpenTelemetry semantic conventions for feature flags (opentelemetry.io/docs/specs/semconv/feature-flags/), status Development, checked October 2026Telemetry attribute names (section 11)
Pete Hodgson, Feature Toggles (aka Feature Flags), martinfowler.com, 2017Background on toggle categories (inspiration only; no text reused)
System Design: configuration and feature flag service (system-design/design-config-feature-flag-service)Platform architecture
A/B Test Plan (product/ab-test-plan)Experiment design
Versioning and Release Policy (dev/versioning-release-policy), Branching Strategy (dev/branching-strategy), CI/CD Pipeline Design (dev/ci-cd-pipeline-design)Deployment and release separation
Change Request (ops/change-request), Runbook (dev/runbook), Game Day Plan (ops/game-day-plan), Postmortem (dev/postmortem)Operations
Threat Model (security/threat-model), Technical Debt Register (architecture/tech-debt-register), Configuration Reference (docs/configuration-reference)Security, debt and configuration

Standard and licence note

Based on the OpenFeature specification, release v0.9.0 (July 2026), a Cloud Native Computing Foundation project; the specification repository is licensed under Apache-2.0 and the openfeature.dev documentation under CC BY 4.0. Concept, type, reason and error-code names are cited from OpenFeature with attribution; the explanations are original and no specification text is reproduced. OpenTelemetry is cited by name for the status of its feature flag conventions. The feature toggle categories reflect common industry practice; the article by Pete Hodgson is cited as background only. Check the current OpenFeature specification and the status of each section at openfeature.dev before relying on this standard. Vendor flag platforms are trademarks of their owners; this template is not affiliated with or endorsed by them. Original text written for this collection. Template licence: MIT.

관련 템플릿