Feature flags screenshot
A hedgehog toggling a feature flag
Feature Flags

Safely roll out features to specific users or groups

Feature Flags is one of the tools that makes your product self-driving: the control layer agents use to roll a change out and roll it back. Built to work natively with product analytics, session replay, experiments, and surveys.

Get started - free

Install with AI in a single prompt

Paste into your terminal or code editor and make AI do the work.

Learn more

MCPWatch a demoTalk to a human

What does it do?

Mobile hog

Feature Flags let you turn features on or off for specific users, groups, or percentages of traffic without redeploying code. Create a flag, check it in your app, then control who sees what from PostHog – phased rollouts, kill switches, multivariate variants, JSON payloads, and beta opt-ins. When something breaks, flip it off. When it works, roll it out wider and measure the impact in analytics and session replay.

Who is it for?

Feature Flags is used across teams depending on your role.

Role
Use cases
Product Engineers
Ship behind a flag, canary to a slice of users, and kill a bad release without a redeploy
Product Managers
Control beta access and rollout percentage once engineering wires the flag into the product
Growth Engineers
Target cohorts, run multivariate variants, and measure impact next to analytics and replays
Platform / DevOps
Gate infrastructure changes and migrations with gradual rollouts and instant rollback
Support Engineers
Enable a fix or workaround for a specific customer without shipping a new build

How do I use it?

There are a few ways to explore Feature Flags.

Manage flags from your editor

Create flags, configure targeting rules, and check rollout status from Cursor, Claude Code, VS Code, or any MCP-compatible agent.

Create flags while building features
Create a new feature flag with rollout percentage, targeting rules, and optional multivariate variants.
Check flags before deploying
Get the full definition of flags, including filters, groups, and payloads.
Clean up stale flags
List all active/inactive feature flags in the current project and find dead code to remove.
Update rollout rules
Update a flag's rollout percentage, targeting rules, or variants.

Install the PostHog MCP

Learn more
npx @posthog/wizard mcp add

Supports Next.js, React, Python, and

Top features

Multivariate feature flags

Boolean & multivariate feature flags

Test or release different versions of a feature with as many variants as you need.

Persist flags across authentication
Persist feature flags across authentication events so that flag values don't change when an anonymous user logs in and becomes identified.
Instant rollbacks
Disable a feature without touching your codebase

AI prompts

Ask PostHog AI to create flags, explain targeting, and clean up stale ones. Works in PostHog AI (in-app chat), PostHog Desktop (our AI code editor), and in your product editor (using the MCP). Already signed in? Click a prompt to try it.

Works with other PostHog tools

Use Feature Flags with these other PostHog apps to maximize shareholder value.

Works with...

  • Product Analytics

    Run any insight filtered by a flag's value, or group by flag to see usage across a flag's variants

  • Experiments

    Run A/B tests on top of the same flags, with statistical significance tracking for each variant

  • Session Replay

    Filter recordings down to only when a feature flag was called, or to a specific value of a flag

Changelog

Recent updates from the Feature Flags Team.

July 2026(4)

June 2026(2)

May 2026(3)

  • May 28

    Test feature flag evaluation

    Feature Flags now has a dedicated testing tab where you can enter a person or distinct ID and see real-time evaluation results with a full…

  • May 15

    Cohort edit history and activity log

    Cohorts now have an activity log. On any saved cohort, a History section shows what changed, who changed it, and when. Track field updates,…

  • May 15

    Test feature flag evaluation with MCP

    A new feature-flags-test-evaluation-create MCP tool lets you test Feature Flags evaluation against specific users directly from a coding…

March 2026(2)

  • Mar 27

    Sub-1% rollout percentages

    Sometimes 1% is too many people. Feature Flags now support decimal rollout percentages, so you can roll out to 0.5%, 0.1%, or wherever you…

  • Mar 21

    Override early access opt-outs

    Early access opt-outs can now be overridden when promoting a feature to general availability. Previously, users who opted out of early…

February 2026(1)

  • Feb 12

    Bulk delete Feature Flags

    It’s like spring cleaning for Feature Flags. Select multiple flags and delete them in one go. We’ll even give you PostHog AI-powered…

Questions?

Answers

There are a few ways you can get answers to specific questions about Feature Flags.

  1. Check the docs

    We have an entire docs-wizard dedicated to docs gardening.

  2. Search the community forums

    With over 100 discussions about Feature Flags, there's a good chance your answer is already answered!

  3. Ask PostHog AI

    It's an incredibly useful AI chat that understands the product, docs, community questions, our codebase, GitHub issues, and industry knowledge.

  4. Talk to a human

    Dedicated humans are standing by and ready to assist. Best for questions about volume pricing, terms, and sexy legal stuff.

Recent discussions

Feature comparison

Optimizely
compare
LaunchDarkly
compare
Flagsmith
GrowthBook
compare
Statsig
compare
Automation
Trigger flag states based on schedules, triggers
Boolean flags
Simple on/off flags to enable or disable features
Early access feature opt-in widget
Allow users to opt in or out of specified features with a built-in widget or custom UI
Payloads
Pass structured data (strings, numbers, or JSON objects) to variants for dynamic configuration without code changes
Multivariate flags
Test multiple variants of a feature in a single flag
Release conditions
Target flags by user properties, cohorts, geographic location, or traffic percentage
Remote config
Replace hard-coded values in your app with remotely configurable parameters
Single-page app support
Use app frameworks like React and Vue
Flag usage logs
Track how many times a feature flag has been called
Implementation
Integrate flags efficiently across platforms
API access
Evaluate flags programmatically using PostHog API
Bootstrapping
Make flags available immediately on page load without waiting for API response
Local evaluation
Cache flag values for faster evaluation and reduced API calls
SDK support
Full support across all major SDKs including JavaScript, Python, Ruby, and more
30+
Targeting
Precisely target who sees each feature
Percentage-based rollouts
Roll out features gradually to a percentage of users
Custom targeting
Target features based on user properties and attributes
Target by cohorts
Target features to specific user segments or behavioral cohorts
Geographic targeting
Limit flags to specific countries or regions based on IP address
Group-level targeting
Run flags at the organization, account, or team level for B2B products
Management
Operate flags safely at scale
Flag approvals
Require approvals to change flags
Scale
Enterprise
Enterprise
Data source
Main source of data used by flags and A/B tests
First-party
First-party
Third-party
Third-party
Flag administration
Control who can modify flags with user roles and permissions
Enterprise
Flag scheduling
Schedule flags to turn on or off automatically at specified times
Enterprise
History and activity feed
See who hit a feature flag, the flag's value, and which page they were on
Instant rollbacks
Disable a feature without touching your codebase
Lifecycle management
Display new and old flags
Enterprise
Multi-environment support
Use the same flag key across PostHog projects for local development or staging
Partial
Flag permissioning
Control who can edit and modify flags
Triggers
Trigger changes based on metrics
Enterprise
Testing
Tools for validating and debugging flags
Flag overrides
Override flag values locally for development and testing
Toolbar integration
Toggle flags directly from the PostHog toolbar while browsing your site
User assignment
Assign specific flag values to test users for manual testing
Experimentation
Use flags to power experiments and measure impact
Experimentation
Run A/B tests with feature flags integrated with experiments
Integration with analytics
View replays attached to a flag, analyze data based on a flag, and measure impact
Advanced
Additional capabilities for robust rollouts
Persist across authentication
Persist feature flags across authentication events so flag values don't change when users log in

Install

SDKs for web, mobile, and backend – or evaluate flags over the API.

Get started – free

No credit card required. You get the first 1,000,000 requests free every month, then pricing starts at $0.0001/request and reduces with volume.

Install with AI

Run this command in your terminal or AI editor.
npx -y @posthog/wizard@latest

Supports Next.js, React, Python, and

Install without AI

Sign up for a free account and follow the install instructions for your stack.

Get started - free