All skills
launchdarkly avatar

/launchdarkly-flag-targeting

@3039201 official

Control LaunchDarkly feature flag targeting including toggling flags on/off, percentage rollouts, targeting rules, individual targets, and copying flag configurations between environments. Use when the user wants to change who sees a flag, roll out to a percentage, add targeting rules, or promote config between environments.

Use this Skill: https://skilld.dev/gh/launchdarkly/agent-skills/launchdarkly-flag-targeting

This session only. Nothing lands on disk.

referencesapproval-workflows.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Approval Workflows

Some LaunchDarkly environments require approval before changes take effect. This is an Enterprise feature configured per environment. When this happens, mutation tools like toggle-flag, update-rollout, update-targeting-rules, update-individual-targets, and copy-flag-config return requiresApproval: true instead of making the change directly.

Detecting Approval Requirements

Any mutation tool response may include these fields when a change is blocked:

  • requiresApproval: true: the change was blocked and needs approval
  • approvalUrl: a URL where the approval can be reviewed (if available)
  • message: a human-readable explanation
  • instructions: the semantic patch instructions that were attempted (use these to create an approval request)

Creating an Approval Request

When a change is blocked, use create-approval-request to submit the change for review:

  1. Use the same instructions returned in the blocked response's instructions field
  2. Provide a clear description explaining what the change does and why
  3. Optionally notify specific team members (notifyMemberIds) or teams (notifyTeamKeys)

Example: Toggle flag with approval

If toggle-flag returns requiresApproval: true:

Tool: create-approval-request
Input:
  projectKey: "my-project"
  flagKey: "new-checkout"
  env: "production"
  instructions: [{"kind": "turnFlagOn"}]
  description: "Enable new checkout flow in production after successful staging test"

Example: Rollout with approval

If update-rollout returns requiresApproval: true with instructions:

Tool: create-approval-request
Input:
  projectKey: "my-project"
  flagKey: "new-checkout"
  env: "production"
  instructions: [{"kind": "updateFallthroughVariationOrRollout", "rolloutWeights": {"var-id-1": 25000, "var-id-2": 75000}}]
  description: "Roll out new checkout to 25% of users in production"

Example: Targeting rule with approval

If update-targeting-rules returns requiresApproval: true:

Tool: create-approval-request
Input:
  projectKey: "my-project"
  flagKey: "new-checkout"
  env: "production"
  instructions: [{"kind": "addRule", "clauses": [{"contextKind": "user", "attribute": "email", "op": "endsWith", "values": ["@company.com"]}], "variationId": "<variation-id>", "description": "Internal users"}]
  description: "Add targeting rule for internal users in production"

Checking Approval Status

Use list-approval-requests to see pending requests for a flag:

Tool: list-approval-requests
Input:
  projectKey: "my-project"
  flagKey: "new-checkout"
  env: "production"

The response shows:

  • status: pending, completed, or failed
  • reviewStatus: pending, approved, or declined
  • reviews: list of reviewer actions with status and comments
  • description: what the change does
  • instructionCount: number of instructions in the request

Applying Approved Requests

Once a reviewer approves the request (reviewStatus is "approved"), use apply-approval-request:

Tool: apply-approval-request
Input:
  projectKey: "my-project"
  id: "<approval-request-id>"
  comment: "Applying approved production rollout"

After applying, verify the change with get-flag.

Important: The agent can apply already-approved requests but must NEVER approve requests itself. Approval is a human decision.

What the Agent Should NOT Do

  • Do NOT auto-approve: The purpose of approvals is human oversight. Never try to approve a request.
  • Do NOT retry the direct change: If a change was blocked, retrying the same mutation will also be blocked. Use the approval workflow.
  • Do NOT skip informing the user: Always tell the user that approval is required and what the next steps are.
  • Do NOT bypass approval: Never use workarounds or alternative API calls to skip the approval process.

Typical Flow

  1. User asks for a targeting change (e.g., "turn on the flag in production")
  2. Agent attempts the change using the mutation tool
  3. Tool returns requiresApproval: true with instructions
  4. Agent informs the user and offers to create an approval request
  5. If the user agrees, agent creates the request with create-approval-request
  6. Agent shares the approval request details (ID, approval URL if available)
  7. A human reviewer approves or declines the request (outside the agent)
  8. If approved, the user or agent can apply it with apply-approval-request
  9. Agent verifies the change with get-flag

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill is safe and authored by the official vendor. It facilitates feature flag management through LaunchDarkly's remote MCP server. It implements strong safety controls, including mandatory human approval workflows for production environments and clear safety checklists. A minor risk of indirect prompt injection exists, as the agent processes flag metadata (like descriptions) which could contain malicious instructions from the LaunchDarkly platform.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    4/5 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3039201. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 days ago.

Activeupdated 2 months ago
compatibility
Requires the remotely hosted LaunchDarkly MCP server
metadata
{
  "author": "launchdarkly",
  "version": "1.1.0-experimental"
}
  • launchdarkly
  • feature-flags
  • targeting
  • rollouts
  • rules
  • mcp-server
  • approval-workflows

README badge

README badge for launchdarkly/agent-skills/launchdarkly-flag-targeting

Manages LaunchDarkly feature flag targeting including toggling flags on/off, setting percentage rollouts, adding targeting rules, and copying configurations between environments. Use when you need to control flag visibility, stage a rollout, add audience rules, or promote flag settings from one environment to another.

Generated from the current SKILL.md.

Does this skill work without the LaunchDarkly MCP server?
No. This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment to use any of the targeting tools.
Can I copy flag configuration between environments?
Yes. The optional `copy-flag-config` tool lets you promote targeting configuration from one environment (like staging) to another (like production).
What happens if I toggle a flag on when it has targeting rules configured?
The flag will begin evaluating its targeting rules and individual targets. If nothing matches, it falls back to the default rule (fallthrough) variation or percentage rollout.
Do I need approval to make flag changes?
Some environments require approval workflows. If a change is blocked, the skill will create an approval request and prompt you to share it for review before the change can be applied.
What takes priority: individual targets, rules, or the default rollout?
Individual targets are highest priority and override all rules. Custom targeting rules are evaluated next, top-to-bottom. The default rule (fallthrough) applies only if nothing else matches.

Generated from the current SKILL.md. These answers refresh after source changes.