dcg

LaunchDarkly

featureflags.launchdarkly

Protects against destructive LaunchDarkly CLI and API operations.

  • 11blocking rules
  • 18safe patterns
  • 6Critical
  • 5High
~/.config/dcg/config.toml
[packs]
enabled = ["featureflags.launchdarkly"]

Evaluated when a command contains ldcli, launchdarkly.

Blocking rules

Each rule ID is featureflags.launchdarkly:<name>. Use it in allowlists and [policy.rules].

  1. launchdarkly-api-delete-environments

    Critical

    DELETE request to LaunchDarkly API removes environments.

    Explanation
    API DELETE calls to environments immediately invalidate SDK keys and remove all flag configurations for that environment. Connected applications will lose flag evaluations. Safer alternatives: - Use ldcli for better confirmation prompts - GET the environment config first - Rotate SDK keys before deletion
  2. launchdarkly-api-delete-flags

    Critical

    DELETE request to LaunchDarkly API removes feature flags.

    Explanation
    API DELETE calls permanently remove flags without archive recovery options. All targeting rules, variations, and prerequisites are lost across all environments. Safer alternatives: - Use ldcli flags archive for soft-delete - GET the flag configuration first - Use the LaunchDarkly UI for visibility
  3. launchdarkly-api-delete-projects

    Critical

    DELETE request to LaunchDarkly API removes projects.

    Explanation
    API DELETE calls to projects remove ALL resources: flags, environments, segments, metrics, and SDK keys. This is the most destructive operation and cannot be undone. Safer alternatives: - Export project configuration completely - Use ldcli for confirmation prompts - Contact LaunchDarkly support for assistance
  4. ldcli-environments-delete

    Critical

    ldcli environments delete removes an environment and all its flag configurations.

    Explanation
    Deleting an environment removes all flag configurations, targeting rules, and SDK keys for that environment. Applications using this environment's SDK key will fail to connect. Safer alternatives: - Rotate SDK keys before deletion - Export environment configuration - Turn off all flags in the environment first
  5. ldcli-flags-delete

    Critical

    ldcli flags delete permanently removes a feature flag. This cannot be undone.

    Explanation
    Deleting a LaunchDarkly flag permanently removes it from all environments. SDKs will return default values, potentially breaking feature gates. Targeting rules, prerequisites, and experiment data are lost. Safer alternatives: - ldcli flags archive: Soft-delete with recovery option - Turn off the flag in all environments first - Export flag configuration before deletion
  6. ldcli-projects-delete

    Critical

    ldcli projects delete removes an entire project and all its flags, environments, and settings.

    Explanation
    Deleting a project removes ALL flags, environments, segments, and metrics within it. This is irreversible and affects all applications using this project's SDK keys. Safer alternatives: - Export project configuration first - Archive flags individually to preserve recovery options - Migrate critical flags to another project
  7. launchdarkly-api-delete-generic

    High

    DELETE request to LaunchDarkly API can remove resources.

    Explanation
    Generic DELETE requests to the LaunchDarkly API can remove various resources including webhooks, integrations, teams, and access tokens. Review the specific endpoint before executing. Safer alternatives: - Verify the exact resource being deleted - Use the LaunchDarkly UI for better visibility - GET the resource first to confirm
  8. launchdarkly-api-delete-segments

    High

    DELETE request to LaunchDarkly API removes segments.

    Explanation
    API DELETE calls to segments remove user groupings immediately. Flags using this segment will lose targeting rules, changing feature behavior for those users. Safer alternatives: - Check segment dependencies first - Update flag targeting before deletion - Export segment membership
  9. ldcli-flags-archive

    High

    ldcli flags archive soft-deletes a feature flag. While recoverable, this affects all environments.

    Explanation
    Archiving a flag removes it from the flag list and evaluation. While archived flags can be restored, SDKs will stop receiving the flag and return defaults immediately across all environments. Safer alternatives: - Turn off the flag before archiving - Verify no code paths depend on the flag - Document the flag's purpose before archiving
  10. ldcli-metrics-delete

    High

    ldcli metrics delete removes a metric and its experiment data.

    Explanation
    Deleting a metric removes the metric definition and all associated experiment results. Historical experiment data for this metric is lost and cannot be recovered. Safer alternatives: - Export experiment results first - Archive the metric if possible - Document metric findings before deletion
  11. ldcli-segments-delete

    High

    ldcli segments delete removes a user segment and its targeting rules.

    Explanation
    Deleting a segment removes user grouping rules across all environments. Flags targeting this segment will lose that targeting, changing which users receive which variations. Safer alternatives: - Review which flags use this segment - Update flag targeting before deletion - Export segment configuration

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • ldcli-flags-list
  • ldcli-flags-get
  • ldcli-flags-create
  • ldcli-flags-update
  • ldcli-projects-list
  • ldcli-projects-get
  • ldcli-projects-create
  • ldcli-environments-list
  • ldcli-environments-get
  • ldcli-environments-create
  • ldcli-segments-list
  • ldcli-segments-get
  • ldcli-segments-create
  • ldcli-metrics-list
  • ldcli-metrics-get
  • ldcli-help
  • ldcli-version
  • launchdarkly-api-get