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
      • Custom flags
      • Release flags
      • Kill switch flags
      • Experiment flags
      • AI prompt flags
      • AI model flags
      • Migration flags
    • Manage flags
    • 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
  • About experiment flags
  • Create experiment flags
  • Modify the experiment flag template
Feature flagsFlag templates

Experiment flags

Was this page helpful?
Previous

AI prompt flags

Next
Built with

Overview

This topic explains how you can use experiment flags to test a hypothesis. These flags help you validate the impact of features you roll out to your app or infrastructure.

About experiment flags

Experiment flags are temporary flags. In the most common use case, you wrap an experiment flag around code for a new or improved feature that impacts end users. Experiment flags can be either boolean or multivariate, so that the experiment can test multiple values. You can pair flags with metrics to compare context or system behavior between two or more flag variations. To learn more, read Experimentation.

Create experiment flags

To create an experiment flag:

  1. Click Create and choose Flag. The “Create flag” dialog appears.
  2. Enter a unique, human-readable Name. A suggested key auto-populates from the name you enter, but you can customize it if you wish.
  3. (Optional) Click Edit key to update the flag key. You’ll use this key to reference the flag in your code.
  4. (Optional) Enter a Description of the flag. A brief, human-readable description helps your account members understand what the flag is for.
  5. (Optional) Click No template and select Experiment. The flag type updates to String.
  6. (Optional) Click + to add additional variations.
  7. (Optional) Change the default on and default off variations if needed.
  8. (Optional) Click on your member name to change the flag maintainer.
  9. (Optional) Click the tag icon to add one or more tags.
  10. (Optional) Click the views icon to add the flag to a view.
  11. (Optional) Click All SDKs to make the flag unavailable to client-side or mobile SDKs. Flags are available to all SDKs by default.
  12. (Optional) Click Temporary to change the flag from temporary to permanent.
  13. Click Create flag.

The flag Targeting tab appears.

After you create a flag, you can make further changes to it as needed, such as to update flag targeting.

To learn more, read Creating new flags.

Then, run experiments on the flag. To get started, click Add experiment the flag’s right sidebar. To learn more, read Creating experiments.

Modify the experiment flag template

To modify your experiment flag template:

  1. Click the project dropdown. The project menu appears:

The project menu.

The project menu.
  1. Select Project settings.
  2. Select Flags. The Flags settings list appears.
  3. In the “Flag templates section, click the pencil icon next to “Experiment.”
  4. In the “Tags” section, type to add tags to each new flag by default.
  5. Click Save.

Verify that the updated default template settings are correct by navigating to the Flags list and creating a new experiment flag.