Customizes an autorater (evaluation metric) for an AI agent so its grades match the user's own judgment, starting from the agent's real trajectories. Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent wrong, or wants an autorater to agree with human labels (autorater hillclimbing, judge calibration). Don't use for quick evals with built-in metrics or for improving the agent itself (use agent-platform-eval-flywheel).
Written by Google and published in google/skills under the Apache-2.0 license. Treq shows it unchanged except for heading levels and links to files on GitHub.
This skill helps a user build graders for their agent that judge the way they do. You do the reading, writing and testing; the user makes the judgment calls. The result is a set of metrics registered in the Agent Platform evaluation service, one or more for each criterion the user cares about.
Carry out the steps below in order. Don't summarize them to the user.
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
Check each item before the first evaluation call, and ask the user to fix what is missing. Ask before installing anything, because it changes the user's environment.
Python SDK. Install or upgrade the Agent Platform SDK with the evaluation extra:
pip install --upgrade 'google-cloud-aiplatform[evaluation]>=2.8.0,<3'
Keep the quotes; unquoted, the shell reads >= as a redirect. The
gcloud CLI is also needed for authentication; if it is missing, point the
user to https://cloud.google.com/sdk/docs/install instead of installing it.
Project and billing. Use the project the user names, or ask for one
(gcloud config set project {project_id}). The project needs an active
billing account: evaluation calls are billed as model usage. See
https://cloud.google.com/pricing for current prices; don't quote numbers.
API. Enable the Agent Platform API:
gcloud services enable aiplatform.googleapis.com.
Authentication. Run gcloud auth login for the CLI and
gcloud auth application-default login for the SDK and scripts, or set
GOOGLE_APPLICATION_CREDENTIALS to a service account key file.
IAM. The user or service account needs roles/aiplatform.user to run
evaluations and register metrics. Don't grant broader roles such as
roles/aiplatform.admin; ask the user to request the narrower role if it
is missing.
Region. Use us-central1 unless the user needs another region (see
https://cloud.google.com/about/locations).
The user brings a folder of trajectories: the ones they think went wrong, plus some good ones. Optional: a note or rating per trajectory (thumbs, human score, an old autorater's verdict), an existing rubric, or reference answers.
The predefined multi-turn metrics also turn intents into rubrics with an importance, but they score the unweighted share of rubrics that pass. Custom metrics add rubrics written for the user's agent, weights, must-pass rubrics, and a pass threshold.
Ask where the folder is and whether any trajectories have a note or rating.
Read the trajectories and the user's notes, and propose the criteria the data supports, as few as cover the problems the user cares about. They can cover any part of the trajectory: the final answer, tool calls and arguments, following the system instructions, handling of errors or clarifications. In a multi-agent system, a criterion can be about the whole system (routing, the final answer) or about one sub-agent; say which. For each, give:
Never propose a criterion you can't point to in the data or the user's notes. Flag any criterion you doubt, with the reason (for example, it can't be graded where tool results were trimmed). Also note problems in any existing grading: a judge that never saw data the agent had, evidence trimmed from the trajectory, golden answers that were never run.
This step makes no evaluation-service calls. If the user wants help finding
patterns in ten or more failing cases, you can grade them with
MULTI_TURN_TASK_SUCCESS and run client.evals.generate_loss_clusters after
step 3. Loss clusters only work in the global region and for
multi_turn_task_success and multi_turn_tool_use_quality, not for custom
metrics.
Save the approved criteria as criteria.md.
Ask whether the trajectories may be sent to the evaluation service, which project to bill, and where outputs may be stored. Show the number of calls (cases × metrics × samples × rounds, with one call per step for step-based metrics) and point to https://cloud.google.com/pricing for the cost. Ask again before any run beyond that.
Use the simplest form that grades the criterion: simpler forms cost less, give the same answer every time, and are easier to trust.
| Criterion can be graded by | Form | SDK |
|---|---|---|
| An exact rule on the output or trajectory (a tool name, a format, a number) | Code | types.CodeExecutionMetric (runs in the service; can be registered) |
| One judgment that is the same for every case | LLM, one rubric | types.LLMMetric with a yes/no check and a reference |
| Several checks, some more important than others | LLM, weighted rubrics | types.StepBasedLLMMetric: one judge step; code computes the weighted score |
| Checks that differ per case, with no good reference | Generated checklist | types.StepBasedLLMMetric: one step writes checks from the conversation, one grades them |
| Long or multi-turn traces, per-turn verdicts, or several judging stages | Step-based, multi-stage | types.StepBasedLLMMetric |
| One sub-agent of a multi-agent system | Step-based, one agent | types.StepBasedLLMMetric with a code preprocessor that keeps that agent's events |
Start each metric from its template in Metric templates; each template says what it doesn't catch. For weighted rubrics, propose the rubrics, a weight for each, the must-pass rubrics and a pass threshold, and keep the weights in the parser code so the judge grades each rubric on its own. Write checks as described in Writing LLM checks. For multi-turn conversations, decide per criterion whether to grade each turn or the whole conversation; see Multi-turn conversations.
Grade the cases through the evaluation service with scripts/run_metrics.py,
then build a review page with scripts/build_review_page.py. Pass each metric's
pass threshold as --threshold, so PASS and FAIL on the page match the metric.
Optional: if the user has an existing autorater, or wants to compare with a
built-in metric such as MULTI_TURN_TASK_SUCCESS, grade with it too and show it
as a baseline. It adds calls, and a built-in metric grades overall task success
rather than the user's criteria.
Ask whether the user wants to mark the grades and have you improve the metrics, at about a minute per case. Skip to step 7 if not.
labels.json. If the user already
has human ratings, use them and ask only about the cases where a metric
disagrees.scripts/agreement.py.
Measure judge noise before trusting a change; see
Noise and agreement.Registering the metrics is the goal of this skill. Add to the review page, for
each metric: its criterion, the final definition (rubrics, weights, must-pass
rubrics, threshold, judge model, sample count), its grades, agreement on labeled
and held-back cases if step 6 ran, and open questions. After approval, register
each metric with create_evaluation_metric; it creates a shared resource.
Hand over an output folder with:
criteria.md: the approved criteria, each listing the metrics that grade
it;metrics/: the final definition of every metric, as the file the evaluation
service ran (the metrics file passed to scripts/run_metrics.py), with its
registered name;metrics.md: one entry per metric with its criterion, form, rubrics,
weights, must-pass rubrics, threshold, judge model and sample count, and a
code snippet that runs it by registered name;labels.json and earlier versions, if step 6 ran;report.md: the numbers and open questions.To run the metrics on a full dataset, point to agent-platform-eval-flywheel.
Build one self-contained HTML page per round with
scripts/build_review_page.py, and give the user its path (or serve it where
the user's browser can reach it). For each case it shows the user's note or
rating, each metric's PASS/FAIL, score, explanation and rubric verdicts, the
baseline if one ran, and the trajectory with tool results collapsed. The user
marks Agree or Disagree on each verdict with a reason; marks are saved in the
browser, and "Download labels.json" exports them in the format
scripts/agreement.py reads. Never ask the user to type labels in chat.
Registered metrics stay in the project until deleted. When the user wants to
remove a metric they no longer use, or one registered by mistake, confirm the
name with them, then run
client.evals.delete_evaluation_metric(metric_resource_name={name}). List them
with client.evals.list_evaluation_metrics(). Local outputs (results, review
pages, labels) stay where the user chose; offer to delete them at the end.
All have --help.
scripts/render_agent_data.py: trajectories as readable text.scripts/run_metrics.py: runs SDK metrics with client.evals.evaluate().scripts/build_review_page.py: the review page and labels export.scripts/agreement.py: agreement, Cohen's kappa and disagreements, per
metric, per rubric or per turn.Claude Code and Codex keep each installed skill's name and description in context. When a request matches the description, the agent loads the full SKILL.md. You can also run it yourself: type /agent-platform-autorater-customization in Claude Code or $agent-platform-autorater-customization in Codex.
The description says when to use it:
Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent wrong, or wants an autorater to agree with human labels (autorater hillclimbing, judge…
Copy the agent-platform-autorater-customization folder into .claude/skills/ in your project. To use it in every project, copy it into ~/.claude/skills/ instead.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .claude/skills
cp -r /tmp/google-skills/skills/cloud/agent-platform-autorater-customization .claude/skills/
Codex reads skills from .agents/skills/ in your repository, and from ~/.agents/skills/ for every repository. It detects new skills on its own. Restart Codex if agent-platform-autorater-customization does not appear.
git clone --depth 1 https://github.com/google/skills.git /tmp/google-skills
mkdir -p .agents/skills
cp -r /tmp/google-skills/skills/cloud/agent-platform-autorater-customization .agents/skills/
Open Settings and select the Skills tab. The tab appears when Skills installation is on under Settings → Feature Preview. Search for agent-platform-autorater-customization and choose Install….
Install for repository writes the skill under .treq/skills/ in the current repository. Install for application makes it available to every repository on this machine. Each new workspace gets a copy in .claude/skills/ and .agents/skills/, so Claude Code and Codex both find it. See Installing Skills from the Library.
agent-platform-autorater-customization ships 12 files, 75.8 KB in total. Select a file to load it from GitHub.