Skip to main content
A Custom Metric is a verifier. It either confirms that an agent or customer took an action on the call, or it rates, ranks, or classifies what they did. Because the verdict drives what your team trusts, the prompt that defines it has to be written clearly. The biggest payoff of a well-written metric is predictable evaluations. When the prompt is precise, the verdict matches what your team would have said reading the transcript or listening to the audio. When the prompt is loose, the model has no solid definition of success and the verdict becomes non-deterministic. The same call returns different scores on different runs.
A good metric returns the verdict you would have given yourself reviewing the call. If your gut and the metric disagree, the prompt is the problem, not the model. Tighten the wording or add the missing piece of evidence.

Core Principles

Anchor to evidence in the transcript

Every criterion should be answerable from the words on the page. If a human reading the transcript cannot tell, the model cannot tell either.

Define the output shape

Spell out exactly what the response should look like: labels, ranges, JSON keys, or text constraints. The shape is half the prompt.

One thing per metric

A metric should answer one thing you want to know. If you would care about each result independently, write separate metrics.

Prompting by Metric Type

Each response type does a different job, so each one rewards a different prompting style. Pick the tab that matches the metric you are writing.
A Pass / Fail metric is an assertion. State the conditions that make the metric pass and the conditions that make it fail.Good prompt
Bad prompt
The good version names the pass condition, the fail condition, and gives one example of each. The bad version stacks two behaviors and leans on an undefined word.Common Pass / Fail mistakesStacking independent behaviors. A Pass / Fail metric should test one thing you want to know. If verifying identity and issuing a refund are two outcomes you would care about independently, write two metrics. If they only matter as a joint result (the call is a fail unless both happened), one metric is fine.Vague pass criteria. “The agent did the right thing” leaves the definition to the model. Replace it with the specific behavior you would look for in the transcript.Describing what the agent should do, not what the metric verifies. The prompt grades the call. Phrases like “the agent should be polite” belong in the agent’s instructions, not in a metric.
If the prompt reaches for words like “good,” “appropriate,” or “well,” you are leaving the definition to the model. Replace those words with specific, observable evidence.
Dynamic variablesUse dynamic variables to make the pass criteria call-specific.
See Dynamic Variables for the full setup.

Using Dynamic Variables

Dynamic variables let you inject call-specific values into a metric prompt at evaluation time. You write {{customer_name}} or {{plan_price}} in the prompt, pass the matching keys in the metadata object on the evaluate request, and Bluejay substitutes them before the judge runs. This pattern matters when the right answer depends on facts that change per call: the customer’s name, the plan they are on, the order ID, the expected balance. Without dynamic variables you would need a separate metric for every value. With them, you keep one metric and pass the values per call.
Dynamic variables work in any response type. The substitution happens before the judge sees the prompt, so anything you can write as plain text can be parameterized.
For the full setup and the request-payload format, see Dynamic Variables.

Tuning Metrics in the Metrics Lab

Sometimes a metric is close but not quite right. The pass rate is too generous, or it flags borderline cases your team would have let through. You have two paths.

Edit the prompt by hand

Add a clarifying sentence, run it against a few sample calls, and check whether the new outputs match your judgment. Fast for small adjustments.

Tune with human feedback

For metrics that need to encode your team’s specific standards, use the Metrics Lab. You annotate calls, the Lab tunes the metric to match your annotations.
The second path is an application of Reinforcement Learning from Human Feedback (RLHF), the technique behind most modern AI assistants. A person rates the model’s output, and the system updates so future outputs match what the person preferred. The Metrics Lab applies that idea to a single Custom Metric.

Walkthrough

1

Pick a representative sample

Twenty to fifty calls. Cover obvious passes, obvious fails, and the ambiguous middle.
2

Annotate each call

Mark the outcome you believe is correct: pass or fail, the right label, the right score.
3

Run alignment

The Lab compares your annotations to the AI’s verdicts and tunes the metric to close the gap.
4

Validate on a holdout

Run the tuned metric against a small set you did not annotate. If the verdicts match yours, the metric is ready.
5

Promote to production

Push the tuned metric to your simulations and live monitoring.
For a deeper look at how alignment works, see the Metrics Lab overview.

Checklist

Before saving a Custom Metric, run through this list.
  • The metric tests one thing you want to know.
  • Every criterion is answerable from the transcript or audio.
  • For Pass / Fail, the pass and fail conditions are explicit.
  • For graded metrics, every level on the scale is anchored.
  • For enums, every label has a definition and a tiebreaker rule.
  • For JSON, every key has a type and a definition.

Resources

Metric Types

Refresh on the response types and when to use each.

Dynamic Variables

Parameterize your prompt with call-specific context at evaluation time.

Metrics Lab

Tune metrics against human-annotated calls using agent alignment.

Create Custom Metric API

Save your final prompt as a Custom Metric via the API.