AgentControl lets you manage model configuration and instructions for your AI agents outside of your application code. With AgentControl, you can update prompts and models without redeploying.
By the end of this quickstart, you will have:
This quickstart focuses on AgentControl configs in completion mode, which lets you configure prompts with messages and roles for single-step model responses. Completion mode supports multi-message prompts, including chat-style prompts. Completion mode does not map to a specific provider API, so you can use it with any provider LaunchDarkly supports.
AgentControl configs can also be created in agent mode, which uses instructions to define multi-step workflows. Agent mode is documented separately in Agents.
Follow the steps below to incorporate AgentControl configs into your app, or use the in-app onboarding to set up your first config directly in the LaunchDarkly UI.
To complete this quickstart, you need the following:
This quickstart uses LangChain as the agent framework. You can adapt the same configuration code to the OpenAI Agents SDK, Strands, or the Claude Agent SDK. For an end-to-end code sample showing different frameworks and model providers, read the example code.
This procedure documents the process of installation through the built-in onboarding experience.
You can set up AgentControl by giving a prompt to your coding assistant. In the quickstart workflow, select Install with AI, choose your LLM provider, and give it the prompt available in the UI.
You can connect your app to LaunchDarkly with an AI agent or with a manual installation process. The procedure below explains how to connect to LaunchDarkly manually.
First, install the LaunchDarkly server-side SDK and AI SDK, as well as the agent framework you want to use.
To get started with other frameworks or model providers, read the AgentControl guides.
Initialize the client to connect LaunchDarkly to your app. To do this, you must have your LaunchDarkly SDK key. To find your SDK key, read SDK credentials.
Create an agent-based config to store your model settings and instructions. You can do this through the LaunchDarkly UI, or agentically using the LaunchDarkly MCP server from your AI coding assistant. For example, Claude Code and Cursor can both perform this task.
To create the config in the UI:
In the left navigation, click Agents. The AgentControl menu appears.
Click Configs.
Click Create config. The “Create config” dialog opens, with Completion selected by default.

Enter a name for your config, and optionally assign a maintainer.
When you name your config, a key generates automatically. Copy and save this key now. You’ll use it in Step 5.
After you create the config, the Variations tab appears.
Then, create a variation. Every completion-based config has one or more variations. Each variation includes a model configuration and, optionally, one or more messages.
Here’s how:
{{ example_variable }} or {{ ldctx.example_context_attribute }} within the message. The LaunchDarkly AI SDK will substitute the correct values when you customize the config from within your app.
Here’s an example of a completed variation:

Here’s the variation message for this example. You can copy this if you’re working through this quickstart in your own project:
To learn more about configuring agent variations, read Agents.
When you’re ready to add more config variations, come back to this step and set up additional targeting rules. If you are familiar with LaunchDarkly’s flag targeting, the process is very similar: with AgentControl, you can target individuals or segments, or target contexts with custom rules. To learn how, read Config targeting.

Your agent-based config is now active. When your application calls the SDK, LaunchDarkly evaluates the targeting rules and returns the variation you configured.
To learn more, read Config targeting.
First, retrieve the agent-based config in your application. Replace your-agent-config-key with config Key you saved in Step 3:
Next, pass the model name and instructions from config into your agent framework. The example below uses LangChain:
Finally, run the agent:
For an equivalent setup with the OpenAI Agents SDK, Strands, or the Claude Agent SDK, read Example code.
One of the key benefits of AgentControl is that you can update your model or prompt at any time without redeploying your application.
To update without redeploying:
LaunchDarkly immediately serves the updated configuration to your application. The next time your application calls the SDK, it receives the new model and instructions without needing to redeploy.
In the config page, click the Monitoring tab. When end users use your application, LaunchDarkly monitors config performance. Metrics update approximately every minute.
To learn more, read Monitor config performance.
Congratulations! You now have an agent-based config that can:
From here, add a judge, run evals, log traces, and explore the managed AI SDKs.
This section shows an end-to-end code sample with different frameworks and model providers.
Evaluation results appear on the Monitoring tab as metrics such as accuracy, relevance, and toxicity.
To learn more about evaluation patterns and programmatic usage, read Online evaluations.
Now that you have a working config and can read its evaluation results, you can continue to build complexity on that config or create another to do something else.
Here are some options:
The following sections provide answers to common questions about working with AgentControl.
In AgentControl, LaunchDarkly does not handle the integration to the AI provider. The LaunchDarkly AI SDKs provide your application with model configuration details for providers and frameworks such as OpenAI, Amazon Bedrock, and LangChain, including customized messages and model parameters such as temperature and tokens. It is your application’s responsibility to pass this information to the AI provider or framework.
The LaunchDarkly AI SDKs provide methods to help you track how your AI model generation is performing, and in some cases, these methods take the completion from common AI providers as a parameter. However, it is still your application’s responsibility to call the AI provider. To learn more, read Tracking AI metrics.
To request a new model, click the Give feedback option and let us know what models you’d like to have included.
LaunchDarkly does not send any of the information you provide to any models, and does not use any of the information to fine tune any models.
You should follow your own organization’s policies regarding if or when it may be acceptable to send end-user data either to LaunchDarkly or to an AI provider. To learn more, read AgentControl and information privacy.