翻篇收录说明
翻篇网页快照

Validation – Inspect Scout

https://meridianlabs-ai.github.io/inspect_scout/validation.html

最近抓取:2026-12-04 20:57:40(北京时间)

最近内容变化:2026-12-02 08:24:43(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Transcript Analysis for AI Agents

正文摘录

Overview When developing scanners, it’s often desirable to create a feedback loop based on human labeling of transcripts that indicate expected scanner results. You can do this by creating a validation set and applying it during your scan: The validation set is the set of labeled transcripts that are compared against scan results. Validation sets are typically associated with the domain of a particular scanner type (e.g. “evaluation awareness”, “refusal”, etc.) so you will likely develop many of them for use with different scanners. Apply a validation set by passing it to scan(). For example: from inspect_scout import scan, transcripts_from from my_scanners import eval_awareness scan( scanners=[eval_awareness()], transcripts=transcripts_from("./logs"), validation="eval-awareness.csv" ) Or from the command line: scout scan eval_awareness.py -V eval-awarness.csv Validation sets are stored in CSV, YAML, JSON, or JSONL text files, however you don’t need to edit them in their raw format. The next section describes recommended workflows for editing and managing validation sets. Validation Sets The easiest way to work with validation data is to use Scout View, which provides inline editing of validation cases as well as various tools for editing and refining validation sets. Transcript View When viewing any transcript, you can activate the validation case editor by clicking the button at the top right of the content view: A validation case maps a transcript to an expected target result. In the example above we indicate that this transcript does have evidence of evaluation awareness which should be detected by scanners. Results View Sometimes its more convenient to apply validation labels in the context of scan results. There is also a validation editor available in every result view: It’s often very natural to create cases this way as reviewing scan results often leads to judgments about whether the scanner is working as intended. Validation Pane The Validation pane provides a top level view of all validation sets as well as various tools for managing them: Use the validation pane to review and edit validation cases, manage splits, or copy and move validation cases between validation sets. Validation Files While you don’t often need to edit validation files directly, you can do so if necessary since they are ordinary CSV for YAML files. For example, here’s a validation set in CSV format: eval-awareness.csv id,target Fg3KBpgFr6RSsEWmHBUqeo,true VFkCH7gXWpJYUYonvfHxrG,false SiEXpECj7U9nNAvM3H7JqB,true If you are editing validation files directly you will need a way to discover trancript IDs. Use the Copy button in the transcript view to copy the UUID of the transcript you are viewing: See File Formats for complete details on validation set files. Scanning Adding Validation You’ll typically create a distinct validation set (with potentially multiple splits) for each scanner, and then pass the validation sets to scan() as a dict mapping scanner to set: scanning.py from inspect_scout import scan, transcripts_from scan( scanners=[ctf_environment(), eval_awareness()], transcripts=transcripts_from("./logs"), validation={ "ctf_environment": "ctf-environment.csv", "eval_awareness": "eval-awareness.csv" } ) If you have only only a single scanner you can pass the validation set without the mapping: scanning.py scan( scanners=[ctf_environment()], transcripts=transcripts_from("./logs"), validation="ctf-environment.csv" ) You can also specify validation sets on the command line. If the above scans were defined in a @scanjob you could add a validation set from the CLI using the -V option as follows: # single validation set scout scan scanning.py -V ctf-environment.csv # multiple validation sets scout scan scanning.py \ -V ctf_environment:ctf-environment.csv \ -V eval_awareness:eval-awareness.csv Validation Results Validation results are reported in the scan status/summary UI: The validation metric reported in the task summary is the balanced accurary, which is good overall metric especially for unbalanced datasets (which is often the case for validation sets). Other metrics (precision, recall, and f1) are available in Scout View. Scout View Scout View will also show validation results alongside scanner values (sorting validated scans to the top for easy review): Validation results are reported using four standard classification metrics: Metric Description Accuracy Balanced accuracy: average of recall and specificity. Accounts for class imbalance better than raw accuracy. Precision When the scanner flags something, how often is it correct? High precision means few false alarms. Recall Of all items that should be flagged, how many did the scanner find? High recall means few missed cases. F1 Harmonic mean of precision and recall. Useful when you need to balance both concerns. In practice, there’s often a tradeoff between precision and recall. A conservative scanner may have high precision but miss cases (low recall), while an aggressive scanner catches more cases (high recall) but with more false positives (lower precision). The right balance depends on your use case. Here are some resources that cover this in more depth: Precision and Recall (Wikipedia) — Comprehensive overview of precision, recall, F1, and related metrics. Classification Metrics (Google ML Crash Course) — Interactive tutorial on precision, recall, and the tradeoffs between them. Validation Splits Validation cases can be organized into named groups called “splits” (e.g., “dev”, “test”, etc.). This enables you to iterate your scanner prompts on a subset of cases (e.g. “dev”) then do final testing on a holdout set (e.g. “test”). Maintaining this separation is often critical to ensure that your scanner prompts aren’t overfit to your validation set. Defining Splits Use the validation pane to assign splits to validation cases: Select multiple transcripts to assign several splits at once: You can also directly assign splits from within the validation case editor in the transcripts and scan results views. Splits are then written to validation set CSVs using a split column: validation.csv id,target,split Fg3KBpgFr6RSsEWmHBUqeo,true,dev VFkCH7gXWpJYUYonvfHxrG,false,dev SiEXpECj7U9nNAvM3H7JqB,true,test Applying Splits Pass the split option to validation_set() to filter by split when creating your validation set: from inspect_scout import validation_set # Use only dev cases validation = validation_set("validation.csv", split="dev") # Use multiple splits validation = validation_set("validation.csv", split=["dev", "test"]) When filtering by split, only cases with matching split values are included. Cases without a split value are excluded when a split filter is applied. Predicates By default, validation compares scanner results to targets using equality (eq). You can specify different comparison predicates either per-case or as a default for all cases. Per-Case Predicates When specifying a non-boolean target for a validation case, you can also customize the predicate used for comparison: Within a validation set CSV, add a predicate column to specify comparison logic for individual cases: validation.csv id,target,predicate SiEXpECj7U9nNAvM3H7JqB,true,eq VFkCH7gXWpJYUYonvfHxrG,hello,contains Fg3KBpgFr6RSsEWmHBUqeo,5,gte In this example: First case passes if scanner result equals true Second case passes if scanner result contains “hello” Third case passes if scanner result is ≥ 5 Available Predicates Predicate Description eq Equal (default) ne Not equal gt Greater than gte Greater than or equal lt Less than lte Less than or equal contains String contains substring startswith String starts with prefix endswith String ends with suffix icontains Case-insensitive contains iequals Case-insensitive equals Default Predicate You can also set a default predicate for all cases using the predicate parameter of validation_set(): validation_set(cases="validation.csv", predicate="gte") When both are specified, per-case predicates take precedence over the default. This allows you to set a common predicate while overriding it for specific cases: validation.csv id,target,predicate Fg3KBpgFr6RSsEWmHBUqeo,5, VFkCH7gXWpJYUYonvfHxrG,3,lt SiEXpECj7U9nNAvM3H7JqB,10, # Default is "gte", but second case uses "lt" validation_set(cases="validation.csv", predicate="gte") Custom Predicates Use @validation_predicate when a custom predicate must be recorded and recreated for scan resume: from pydantic import JsonValue from inspect_scout import ( Result, ValidationPredicate, validation_predicate, validation_set, ) @validation_predicate def within_range(distance: float = 10) -> ValidationPredicate: async def check(result: Result, target: JsonValue) -> bool: if not isinstance(result.value, (int, float)): return False if not isinstance(target, (int, float)): return False return abs(result.value - target) <= distance return check validation = validation_set( "validation.csv", predicate=within_range(distance=5), ) Scout records the registered predicate’s name and Inspect registry-compatible creation parameters, not its Python implementation. Use the same parameter conventions as other Inspect extensions: ordinary serializable values and registered Inspect objects or models are portable, while arbitrary Python objects are not. Non-finite floating-point values are rejected rather than silently changed in the scan artifact. The predicate’s module or package must be available when the scan is resumed. If the predicate is defined in a local source file rather than an installed package, Scout records the file path and loads that file when the scan is resumed (the same way it loads the source file of a scanner defined outside a package). Listing or viewing a scan never loads predicate code. An unregistered async callable can still be used for the current scan: async def normalized_equal(result: Result, target: JsonValue) -> bool: return str(result.value).strip().lower() == str(target).strip().lower() validation = validation_s