Skip to content

Feature flag naming conventions: a format that works in every tool, and how to enforce it

How to name feature flags: a portable key format, what each tool allows (characters, length, renaming), which tools can enforce a pattern, a tested check of which names break over OFREP, and a CI script that rejects keys that break your convention.

9 min read

Short answer: Use lowercase snake_case keys that start with the flag's type and say what the flag does, such as release_new_checkout or ops_disable_recommendations. Use only lowercase letters, digits and underscores, start with a letter, and stay within 64 characters: that fits every documented key rule we found, survives URLs, and matters early because many tools can't rename a key.

What format should flag keys use?

A format that fits every documented rule below:

<type>_<what it does>[_<detail>]

release_new_checkout
experiment_pricing_page_annual_discount
ops_disable_recommendations
permission_beta_reports
  • Start with the type. Release, experiment, ops and permission flags live for very different times. Martin Fowler's site describes these four categories, noting that release toggles "are transitionary by nature" while permission toggles can be "very-long lived" (Feature Toggles). With the type in the key, a search for release_ lists the flags that should be gone soon (see stale feature flags).
  • Say what it does, not who asked. LaunchDarkly's guide advises against team names in a flag's name or key, since teams change (flag conventions). release_new_checkout makes sense to whoever reads it next year.
  • Name the "on" state. ops_disable_recommendations is clear about what true means; recommendations_flag isn't.
  • Underscores rather than hyphens. Firebase Remote Config documents keys as starting with a letter or underscore and including numbers, with no mention of hyphens; AWS AppConfig requires a lowercase first letter. Lowercase letters, digits and underscores pass both, and GrowthBook's and Unleash's rules too. If you never use Firebase, kebab-case (release-new-checkout) works in the other tools we checked; pick one separator and never mix them, because some SDKs transform keys (LaunchDarkly warns that converting keys, as its React SDK does to camel case, "can cause collisions if two flags have similar keys") (LaunchDarkly).
  • Put the rest in metadata. Owner, ticket, expiry date and description belong in the tool's description, tags or owner fields, where they can change, not in the key.

What does each tool allow in a flag key?

From each tool's documentation, checked on 15 November 2026. Most tools let you change a display name freely; the key (or name, where there's only one) is what code uses.

Tool Allowed in keys Key can be changed? Built-in enforcement
LaunchDarkly Not stated No; the name can change Project flag key convention: camel, Pascal, snake or kebab case, plus an optional required prefix, enforced for new flags in the UI, imports and the API
Unleash "URL-friendly", 1 to 100 characters, unique per instance Not stated Project naming pattern (a regular expression, with example and description), Enterprise; the full name must match
Flagsmith Not stated No, "Features cannot be renamed after creation" Project "Feature Name RegEx", anchored automatically, for new flags
GrowthBook Letters, digits, _, -, ., : and | No Custom hooks that validate features on create and publish (self-hosted Enterprise)
AWS AppConfig Starts with a lowercase letter, then letters, digits, _ or -; up to 64 characters No; the flag name can change Fixed by AppConfig's feature flag schema, not configurable
Firebase Remote Config Starts with a letter or underscore, can include numbers; up to 256 characters Not stated Not stated
Azure App Configuration Feature names can't contain % or :; keys are stored under the .appconfig.featureflag/ prefix Not stated Not stated
PostHog Not stated Yes, with a warning and confirmation Not stated
DevCycle Not stated; code reads variable keys, suggested in kebab case Yes, feature name, key and type in the feature's settings Not stated
ConfigCat Not stated (separate name and key) Not stated Not stated
Harness Feature Flags Not stated Not stated Custom OPA policies receive the flag identifier
flagd Any string of at least one character (JSON schema) Edit the file Not built in

Sources: LaunchDarkly new flags and project flag settings, Unleash feature flags, Flagsmith naming conventions, GrowthBook features and custom hooks, AWS AppConfig feature flag reference and creating flags, Firebase parameters, Azure CLI feature commands and managing feature flags, PostHog creating flags, DevCycle features and variables, ConfigCat main concepts, Harness policy engine for flags, flagd schema.

The documented rules overlap in one set: lowercase letters, digits and underscores, starting with a letter, up to 64 characters. That set passes AWS AppConfig, Firebase, GrowthBook and Unleash, and contains none of the characters Azure forbids. If you might move between tools, or use OpenFeature with more than one provider, stay inside it.

Which flag names break, and where?

Documentation rarely says what happens to a key with a colon, a slash or a space, so we tested. We tried to create the same 21 keys in Unleash 8.3.1 through its admin API, loaded them into flagd v0.18.2 and GO Feature Flag v1.58.1, and evaluated each one: in process with the flagd Node.js provider 0.18.0; through the OFREP single-flag endpoint, with the key in the URL path encoded by encodeURIComponent, as the official OFREP JavaScript client (@openfeature/ofrep-core 2.3.0) does; with encodeURI, which leaves characters such as : and / unencoded; and through OFREP bulk evaluation. We also applied the documented AWS AppConfig, GrowthBook and Firebase rules to the same keys.

Key Unleash 8.3.1 (create) In process (flagd) OFREP, flagd OFREP, GO Feature Flag GO Feature Flag, unencoded AppConfig rule GrowthBook rule Firebase rule
new_checkout Created Works Works Works Works Valid Valid Valid
new-checkout Created Works Works Works Works Valid Valid Invalid
newCheckout Created Works Works Works Works Valid Valid Valid
NEW_CHECKOUT Created Works Works Works Works Invalid Valid Valid
checkout.new-flow Created Works Works Works Works Invalid Valid Invalid
team:checkout Rejected Works Works Not found Works Invalid Valid Invalid
checkout/new Rejected Works Not found Not found Works Invalid Invalid Invalid
team@checkout, plan+pro, a,b, a;b, a=b, a&b, price$ Rejected Works Works Not found Works Invalid Invalid Invalid
new checkout Rejected Works Works Works Works Invalid Invalid Invalid
nuevo-pago-ñ Rejected Works Works Works Works Invalid Invalid Invalid
release|checkout Rejected Works Works Works Works Invalid Valid Invalid
2026-q4-checkout Created Works Works Works Works Invalid Valid Invalid
100 characters Created Works Works Works Works Invalid Valid Valid
101 and 300 characters Rejected Works Works Works Works Invalid Valid Valid (101), invalid (300)

What we saw:

  • Unleash rejected keys outside letters, digits, -, . and _, and keys over 100 characters, with HTTP 400 at creation, so its "URL-friendly" rule means RFC 3986's unreserved characters in practice.
  • Every key evaluated in process and appeared in OFREP bulk responses from flagd and GO Feature Flag.
  • GO Feature Flag didn't decode reserved characters in the path. Keys with :, /, @, +, ,, ;, =, & or $ returned FLAG_NOT_FOUND when percent-encoded, as the OFREP client sends them, and worked unencoded. OFREP defines the key as a plain string path parameter, and percent-encoding it is what a client should do, so this looks like an implementation issue in GO Feature Flag rather than OFREP behavior. We reported it with a fix (issue #6504, pull request #6505).
  • flagd failed only on the slash: checkout/new returned 404 whether or not the slash was encoded.
  • The failure is quiet in application code. OFREP server-side providers request one flag at a time, so such a key would evaluate to your default value. In the OpenFeature Node.js SDK, a failed evaluation doesn't throw or log by default: get...Value returns the default, and only get...Details (its errorCode) or an error hook shows it. Client-side providers use bulk evaluation and wouldn't be affected. We didn't run an OFREP provider itself; this follows from the requests above and the SDK's documented behavior.

The probe script, its runner, the key list, the raw results and the documented-rule check are published; the runner needs Docker and Node.js.

How do I enforce a naming convention?

Enforce it where flags are created, and again in code review:

  1. In the tool, where it's supported: LaunchDarkly's flag key convention, Unleash's project naming pattern (Enterprise) and Flagsmith's Feature Name RegEx reject new flags that don't match, and GrowthBook's custom hooks (self-hosted Enterprise) can validate them. Unleash's docs show a pattern like ^(red|blue|green)\.[a-z-]+\.[0-9]+$ for <team>.<feature>.<ticket>; for the format above, use ^(?=.{1,64}$)(release|experiment|ops|permission)_[a-z0-9]+(_[a-z0-9]+)*$.
  2. In CI, for tools without enforcement and for keys typed in code. This script finds string keys passed to OpenFeature's get...Value and get...Details methods, including calls split across lines, and fails the build when one doesn't match:
// Fails CI when a flag key in code doesn't match the naming convention.
// Usage: node check-flag-names.mjs src
import { lstatSync, readdirSync, readFileSync } from 'node:fs'
import { join } from 'node:path'

const CONVENTION = /^(?=.{1,64}$)(release|experiment|ops|permission)_[a-z0-9]+(_[a-z0-9]+)*$/
// get...Value / get...Details calls with a string literal as the first argument, across lines
const CALL = /\bget(?:Boolean|String|Number|Integer|Double|Object)(?:Value|Details)\(\s*(['"`])((?:(?!\1).)*)\1/gs
const SKIP = new Set(['node_modules', 'dist', 'build', 'out', 'coverage'])

function* files(dir) {
  for (const name of readdirSync(dir)) {
    if (SKIP.has(name) || name.startsWith('.')) continue
    const path = join(dir, name)
    const stat = lstatSync(path) // don't follow symlinks
    if (stat.isDirectory()) yield* files(path)
    else if (stat.isFile() && /\.(c|m)?[jt]sx?$/.test(name)) yield path
  }
}

let failures = 0
for (const file of files(process.argv[2] ?? '.')) {
  const source = readFileSync(file, 'utf8')
  for (const match of source.matchAll(CALL)) {
    const key = match[2]
    if (match[1] === '`' && key.includes('${')) continue // dynamic key: check where it's built
    if (!CONVENTION.test(key)) {
      const line = source.slice(0, match.index).split('\n').length
      console.error(`${file}:${line}: flag key "${key}" doesn't match the naming convention`)
      failures++
    }
  }
}
process.exit(failures ? 1 : 0)

On our failing sample it reported newCheckout, a hyphenated key split across two lines, a key containing an apostrophe and a 76-character key, each with file and line, skipped a dynamic template key and a dist folder, and exited with 1; on the passing sample it exited with 0 (output). Limits: it covers JavaScript and TypeScript files and OpenFeature's method names, so adjust CALL for other SDKs (for example variation( or isEnabled(), and keys built by concatenation are only partly seen.

If your keys live in a constants file, which makes them easier to find and rename, point the check at that file instead: test every string exported from it against CONVENTION.

What else helps keep flag names useful?

  • Keep keys in one place in code, as constants, so replacing a flag means changing one line.
  • Use tags or projects for grouping (team, area, release train) rather than encoding it in the key; most tools can filter by tag.
  • Write the "why" in the description: the expected removal date, the ticket and the owner. Flagsmith's guide suggests descriptions explain why a flag exists (naming conventions).
  • Don't reuse keys. An old app version or a stale cache still reading a deleted flag's key would pick up the new flag's values. Some tools allow reuse: PostHog, for example, frees the key when an experiment-linked flag is deleted.

For removing flags once they're done, see stale feature flags; for approvals and audit trails, approvals and audit logs. All tools are in the directory.