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

# Agent Preference

> Measure which products coding agents choose, recommend, and adopt for real developer tasks.

Agent Preference measures selection. It tells you which product a coding agent chooses when it needs to solve a developer problem, why it made that choice, and whether it followed through in code.

The central question is:

> When an agent has a choice, does it choose you?

This is different from asking whether an agent can use your product successfully. [Agent Experience](/agents/concepts/agent-experience) measures implementation success after the task and pass criteria are defined.

## What Agent Preference reveals

An Agent Preference run can show whether an agent:

* Includes your product among the options it considers
* Ranks your product as its first choice
* Chooses a competitor instead
* Recommends one product but installs another
* Mentions several options without making a clear choice
* Uses documentation or third-party sources while deciding

Gauge bases the result on the complete session. It reads the agent's trace, research activity, and final working-tree diff. The diff helps distinguish a product the agent mentioned from one it actually adopted.

## Measurement types

<CardGroup cols={2}>
  <Card title="Recommendation" icon="ranking-star">
    Ask an open-ended developer question without naming a product. The agent chooses freely, and Gauge records its ranked picks and whether each pick was adopted.
  </Card>

  <Card title="Head-to-head" icon="scale-balanced">
    Name two products and ask the agent to choose between them. Gauge records a winner or `neither`, with reasoning for both products.
  </Card>
</CardGroup>

### Recommendation prompts

A recommendation prompt measures unaided preference when it does not name your product or a competitor.

```text theme={null}
Add authentication to this Next.js application.

Choose an authentication provider.
Implement sign-in.
Protect the account page.
```

For each run, Gauge records:

* Ranked product picks
* The top recommendation
* Whether each product was actually adopted
* Whether the agent converged on one clear choice
* Evidence-backed reasoning for each rank

If a recommendation prompt names a product, mark it as branded. Branded runs remain useful for qualitative evidence, but Gauge excludes them from the organic ranking because the prompt influenced the choice.

### Head-to-head prompts

A head-to-head prompt measures a direct tradeoff between two named products.

```text theme={null}
Add authentication to this Next.js application.

Compare Clerk and Auth0.
Choose one provider.
Complete the integration.
```

Gauge records one of three outcomes:

* Product A won
* Product B won
* Neither won because the agent used both, chose a third option, or did not reach a clear decision

Head-to-head results are always branded. Use them to understand a specific competitive decision, not to estimate unaided market preference.

## How a preference prompt works

<Steps>
  <Step title="Write a realistic question">
    Describe a task the way a developer would ask a coding agent. Keep the task concrete enough that the agent must choose and use a solution.
  </Step>

  <Step title="Choose a market">
    A market groups prompts that measure the same capability, such as authentication, databases, or email delivery. Market scope keeps rankings and findings comparable.
  </Step>

  <Step title="Attach run presets">
    Run presets define the repositories, agents, models, personas, skills, and MCP servers used for the measurement. Every attached preset runs during the cycle.
  </Step>

  <Step title="Run on a cycle or on demand">
    Use the shared Agent Preference cycle for recurring measurement, or run a prompt immediately when you need fresh evidence.
  </Step>

  <Step title="Adjudicate the choice">
    Gauge inspects the trace and diff to identify the chosen product, the alternatives, the final adoption state, and the evidence behind the decision.
  </Step>
</Steps>

## Read the results

Gauge keeps different measurements separate because they answer different questions.

| Result              | What it means                                                                   |
| ------------------- | ------------------------------------------------------------------------------- |
| Organic chosen rate | How often a brand was the top choice in eligible, unbranded recommendation runs |
| Ranked picks        | The products the agent recommended, in order                                    |
| Adopted             | The agent wired or installed the product in the final code                      |
| Head-to-head record | Counts of wins, losses, and neither outcomes for a specific pair                |
| Cited domains       | Sources agents consulted while deciding                                         |
| Reasoning           | Run-level evidence explaining the choice                                        |

Do not combine organic chosen rates and head-to-head outcomes into one score. Their prompts and denominators differ.

## Design useful prompts

For an organic recommendation:

* Write one to three sentences in a developer's voice.
* Describe the capability and desired result.
* Do not name your product, package names, or competitors.
* Give the agent enough room to choose a solution.

For a head-to-head:

* Name both products in the prompt.
* Ask the agent to make and implement one choice.
* Use the same task and run setup when comparing results over time.

<Tip>
  Start most preference prompts in a greenfield repository. Use an existing repository only when its framework, dependencies, or architecture are part of the decision you want to measure.
</Tip>

## Interpret the evidence

Agent Preference results describe the runs you sampled. They are not a census of every agent or developer task.

* Report counts alongside rates.
* Compare results within the same market and prompt type.
* Keep run presets stable when measuring change over time.
* Separate being mentioned from being ranked first or adopted.
* Read the run reasoning before turning a result into an action.

Repeated evidence can point to changes you control, such as clearer positioning, better ecosystem documentation, or a working starter template.

<Card title="Agent Experience" icon="list-check" href="/agents/concepts/agent-experience">
  Measure whether agents can complete a task with your product after they choose or are directed to use it.
</Card>
