> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fix a Prompt

> Open any LLM span in the Prompt Playground to iterate on prompts using real production data

See a bad response? Open the LLM span directly in the **Prompt Playground** with its exact inputs pre-loaded — iterate using real production data, not synthetic examples.

## How to do it

1. Open a trace and click into an **LLM span**
2. Click **Open in Playground** in the span toolbar
3. The Playground opens with the prompt template, input variables, and model settings pre-filled
4. Edit the prompt, adjust parameters, click **Run** to compare
5. **Save to Prompt Hub** for version control and deployment

\[screenshot: prompt playground with a span's data pre-loaded]

> [!TIP]
>
> Works with any LLM span that has prompt template data. Auto-instrumentation captures prompt templates automatically for most providers.

> [!NOTE]
>
> The Prompt Playground is designed for **single LLM call iteration** — editing prompt templates, adjusting parameters, and comparing outputs. It does not support replaying full agentic workflows (multi-step tool calls, agent chains). For agentic debugging, use the [Find issues](/docs/ax/observe/find-issues.md) and [Agent Trajectory](/docs/ax/observe/tracing/agents) views to understand the full execution path, then fix individual LLM prompts in the Playground.

## What you can change

* **Prompt template** — rewrite instructions, add constraints, change tone
* **Model** — switch providers or versions to compare behavior
* **Parameters** — temperature, max tokens, top-p
* **Input variables** — swap in different values to test edge cases

## Save and deploy

1. **Save to Prompt Hub** to version the prompt
2. Your app pulls the latest version from Prompt Hub automatically
3. Run an [experiment](/docs/ax/develop/datasets-and-experiments) to validate the change before deploying
