Setting the file. One moment.
Evaluation · Optimize Agent Prompt · browserbase/skills · Skills Docs
ContentsBack to the top of the page Separate the invariant task from the system prompt under optimization. The task should state the goal and result contract, not encode the navigation solution the teacher is trying to learn.
Use a result schema with:
required outcome and evidence fields;
explicit nullable fields for unavailable values;
an outcome/status enum when success, blocked, partial, or not-found are distinct;
echoed inputs when filter or date drift is possible;
additionalProperties: false when a stable shape matters.
Completeness rewards confident wrong answers. Combine:
Run status: penalize non-COMPLETED results.
Required-field coverage from the JSON Schema.
Known facts expressed as case-insensitive regexes.
Factuality warnings for prohibited claims, unsafe actions, or common confusions.
Human review of provenance and safety.
Example task.json evaluation block:
Regexes are evaluation data and are never sent to the inner Agent.
Check terminal status, normalized result, duration, and message count.
Find the first consequential error or wasted branch in messages.
Inspect session logs only if lower-level browser evidence could change the diagnosis.
Form one counterfactual prompt heuristic.
Run the fixed task again and compare both quality and efficiency.
Do not optimize only for speed. A shorter run that silently drops filters, guesses data, violates safety, or returns FAILED is a regression.
Keep a prompt change when it improves correctness/safety or preserves quality with materially lower cost.
Revert a regression before testing another hypothesis.
Stop stacking rules when improvements plateau; simplify the prompt if it becomes brittle.
Require two passes among the last three runs.
Repeat the winning prompt unchanged at least once.
Test a holdout matrix before claiming generality: multiple sites, entities, result shapes, and at least one different failure regime.
references/evaluation.md