For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • Get started
    • Overview
    • Onboarding
    • Get started
    • Launch Insights
    • LaunchDarkly architecture
    • LaunchDarkly vocabulary
  • AgentControl
    • AgentControl
    • Manage AgentControl
  • Feature flags
    • Create flags
    • Target with flags
    • Flag templates
    • Manage flags
      • The Flags list
      • Comparing and copying flag settings
      • Viewing flags across environments
      • Deprecating flags
      • Archiving flags
      • Deleting flags
      • Flag prerequisites
      • The off variation
      • The default rule
      • Flag statuses and lifecycle stages
      • Flag lifecycle settings
      • Project-level flag settings
      • Vega for flag cleanup
    • Code references
    • Contexts
    • Segments
  • Releases
    • Releasing features with LaunchDarkly
    • Release policies
    • Percentage rollouts
    • Progressive rollouts
    • Guarded rollouts
    • Feature monitoring
    • Release pipelines
    • Engineering insights
    • Release management tools
    • Applications and app versions
    • Change history
    • Restoring previous flag versions
  • Observability
    • Observability
    • Session replay
    • Error monitoring
    • Logs
    • Traces
    • Observability metrics
    • Product analytics events
    • LLM observability
    • Alerts
    • Dashboards
    • Service map
    • Vega for auto-remediation
    • Observability MCP server
    • Search specification
    • Observability settings
    • Observability integrations
  • Experimentation
    • Experimentation
    • Experiment metric types
    • Experiment configuration
    • Managing experiments
    • Analyzing experiments
    • Multi-armed bandits
    • Holdouts
  • Metrics and events
    • Metrics in LaunchDarkly
    • Creating metrics
    • Metric groups
    • Events
    • Autogenerated metrics
  • Warehouse native
    • Warehouse native metrics
    • Setting up external warehouses
    • Creating experiments using warehouse native metrics
  • Infrastructure
    • Connect apps and services to LaunchDarkly
    • LaunchDarkly in China and Pakistan
    • LaunchDarkly in the European Union (EU)
    • LaunchDarkly in federal environments
    • Public IP list
  • Your account
    • Projects
    • Views
    • Environments
    • Tags
    • Teams
    • Members
    • Roles
    • Account security
    • Feature previews
    • Billing and usage
    • Changelog
Sign inTry it free
LogoLogo
On this page
  • Overview
  • Default rules for new flags
  • Update the default rule
Feature flagsManage flags

The default rule

Was this page helpful?
Previous

Flag statuses and lifecycle stages

Next
Built with

Overview

This topic explains how to set the default rule for a flag. LaunchDarkly defines a final default rule, sometimes called the “fallthrough” rule, for any contexts that don’t match any of the previous targeting rules on the flag. The default rule can be a single variation, a guarded rollout, a progressive rollout, a percentage rollout, or an experiment.

Here is an image of a default rule:

A flag's default rule.

A flag's default rule.

You can set the default rule to a specific variation when you create a new flag. If needed, you can later update the default rule to a different variation or to a rollout.

The default rule is different from the fallback value, which is the value that contexts receive if your application cannot connect to LaunchDarkly. To learn more, read Fallback value.

The default rule is also different from the off variation, which is the value LaunchDarkly serves when the flag is off. To learn more, read The off variation.

Default rules for new flags

Here is how LaunchDarkly sets the default rule for new flags:

  • When you create a new boolean flag, the default variation when the flag is on is “true.” You can update this to “false” as part of the flag creation process. You can also change this default to “false” for all new flags using flag templates.
  • When you create a new multivariate flag, the default variation when the flag is on is the first variation on the flag. You can update this to any other variation as part of the flag creation process.

You can later update the default rule to a different variation or to a rollout.

Update the default rule

To update a flag’s default rule:

  1. In the flags dashboard, scroll or search to find the flag you want.
  2. Click the flag’s name to open the flag’s Targeting tab.
  3. If the flag is off and the rules are hidden, click View targeting rules.
  4. In the “Default rule” section, click Edit to configure the default rule to serve a specific variation, a rollout, or an experiment.

In this example, all contexts that have not been targeted by any other rules will receive false.

You can also use the JSON editor

To learn how to set a default rule using JSON, read Default rule or variation.