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

Inspect Scout

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

最近抓取:2026-12-05 01:50:19(北京时间)

最近内容变化:2026-11-30 12:14:58(北京时间)

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

访问原网页

页面简介

Transcript Analysis for AI Agents

正文摘录

Welcome Welcome to Inspect Scout, a tool for in-depth analysis of AI agent transcripts. With Scout, you can easily: Detect issues like misconfigured environments, refusals, and evaluation awareness using LLM-based or pattern-based scanners. Analyze transcripts from Inspect, Arize Phoenix, LangSmith, Logfire, MLFLow, W&B Weave, Claude Code, Harbor, or custom sources via the capture and import APIs. Develop scanners interactively, exploring transcripts and scan results visually in Scout View. Validate scanner accuracy against human-labeled examples. Handle complex scanning requirements like multi-agent transcripts, compaction, and context-window chunking. Scale to thousands of transcripts with parallel processing, batching, and fault tolerance. Installation Install the inspect_scout package from PyPI with: pip install inspect-scout You should also be sure to install the Inspect AI VS Code Extension which includes features for viewing and debugging Scout scans. Scout Basics Below we’ll provide some simple examples of creating and using Scout scanners. Some core components we’ll make use of here include: Transcript — LLM conversation to analyze (e.g. an agent rollout or a sample from an Inspect eval). Scanner — Function that takes an input from a Transcript and returns a Result (conceptually very similar to an Inspect Scorer). Results — Data frame(s) that includes the results of scanners applied to transcripts. LLM Scanner For many applications you can use the high-level llm_scanner(), which uses a model for transcript analysis and can be customized with many options. For example: scanner.py from inspect_scout import Scanner, Transcript, llm_scanner, scanner @scanner(messages="all") def ctf_environment() -> Scanner[Transcript]: return llm_scanner( question="In the transcript above do you detect " "instances of environment misconfiguration " "preventing the agent from completing it's task?", answer="boolean" ) The llm_scanner() supports a wide variety of model answer types including boolean, number, string, classification (single or multi), and structured JSON output. For additional details, see the LLM Scanner article. Grep Scanner Using an LLM to search transcripts is often required for more nuanced judgements, but if you are just looking for text patterns, you can also use the grep_scanner(). For example, here we search assistant messages for references to phrases that might indicate secrets: from inspect_scout import Transcript, grep_scanner, scanner @scanner(messages=["assistant"]) def secrets() -> Scanner[Transcript]: return grep_scanner(["password", "secret", "token"]) For additional details on using this scanner, see the Grep Scanner article. Custom Scanners If the higher level LLM and Grep scanners don’t meet your requirements, you can write a custom scanners with whatever behavior you need. For example, the following illustrates the implementation of a basic LLM scanner (click on the numbers at right for further explanation): scanner.py from inspect_scout import ( Result, Scanner, Transcript, scanner, message_numbering ) from inspect_ai.model import get_model import re 1@scanner(messages="all") def ctf_environment() -> Scanner[Transcript]: async def scan(transcript: Transcript) -> Result: # setup message numbering messages_as_str, extract_refs = message_numbering() # call model 2 output = await get_model().generate( "Here is a transcript of an LLM agent " + "solving a cybersecurity challenge:\n\n" + 3 "===================================" + await messages_as_str(transcript.messages) + "===================================\n\n" + "In the transcript above do you detect any " + "instances of environment misconfiguration " + "preventing the agent from completing its " + "task? If no, simply respond with 'No'. " + "If yes, respond with 'Yes' followed by an " + "explanation." ) # extract the first word match = re.match(r"^\w+", output.completion.strip()) # return result if match: answer = match.group(0) explanation = output.completion 4 return Result( value=answer.lower() == "yes", answer=answer, explanation=explanation, references=extract_refs(explanation) ) else: return Result(value=False, explanation=output.completion) return scan 1 Scanners are decorated with @scanner so they can specify the exact subset of content they need to read. In this case only messages (and not events) will be read from the log, decreasing load time. 2 Scanners frequently use models to perform scanning. Calling get_model() utilizes the default model for the scan job (which can be specified in the top level call to scan). 3 Convert the message history into a string for presentation to the model. The messages_as_str() function takes a Transcript | list[Messages] and will by default remove system messages from the message list. See MessagesPreprocessor for other available options. 4 As with scorers, results also include additional context (here the extracted answer, full model completion, and message references). For more details on creating custom scanners, including scanning individual messages or events, handling compaction and context overflow, and computing metrics, see the article on Custom Scanners. Running a Scan Use the scout scan command to run one or more scanners on a set of transcripts. The Scanner will be called once for each Transcript. For example: scout scan scanner.py -T ./logs --model openai/gpt-5 The -T argument indicates which transcripts to scan (in this case a local Inspect log directory). You can also scan from a transcripts database that is either local or on S3. For example, here we scan some W&B Weave transcripts stored on S3: scout scan scanner.py -T s3://cybench-rollouts --model openai/gpt-5 Note that when we using a model that requires an API key you’ll need to provide it in the enviroment (e.g. OPENAI_API_KEY). As with Inspect AI, you can use a .env file for providing API keys. Scout View Scout includes a viewer application for looking at scan results in depth. Run the viewer with: scout view By default this will view the scan results in the ./scans directory of the current working directory. Specify an alternate results location with: scout view --scans s3://my-scan-results You can also list recent scans with the scout scan list command: scout scan list Scans will be listed from most to least recent. If you are running within VS Code you can click the scans in the list to view them in a VS Code editor. The VS Code Scout activity bar also includes a scans pane that lists recent scans. Remote Access By default, scout view binds to 127.0.0.1 on port 7576. For single-user access to a viewer on a remote machine, keep that loopback bind and use SSH port forwarding: ssh -L 7576:127.0.0.1:7576 user@remote Run scout view normally on the remote machine, then open http://127.0.0.1:7576 locally. If you forward to a different local port (for example ssh -L 8080:127.0.0.1:7576 user@remote, or VS Code Remote picking another free port), declare the address you open in the browser: scout view --trusted-origin http://127.0.0.1:8080 The origin must match the browser’s address bar exactly. http://localhost:8080 and http://127.0.0.1:8080 are different origins, so repeat --trusted-origin if you use both. VS Code opens forwarded ports as http://localhost:<port>. If local DNS or a hosts file maps a custom name to loopback, declare that exact browser origin: scout view --trusted-origin http://my-scout:7576 In Posit Workbench, pass the session proxy URL as the root path. rserver-url -l prints the full URL, so Scout also trusts its origin: scout view --root-path "$(/usr/lib/rstudio-server/bin/rserver-url -l 7576)" Every app served from the Workbench origin can then call Scout’s API. Inside Jupyter, jupyter-server-proxy serves Scout under proxy/7576/ and forwards the browser’s Host. Pass the proxied path and the Jupyter origin. Under JupyterHub: scout view \ --root-path "${JUPYTERHUB_SERVICE_PREFIX}proxy/7576" \ --trusted-origin https://hub.example.org For a local Jupyter server at http://localhost:8888: scout view --root-path /proxy/7576 --trusted-origin http://localhost:8888 Binding beyond loopback requires request authorization. For browser access, place Scout View behind an authenticating reverse proxy that injects the configured upstream authorization header: INSPECT_VIEW_AUTHORIZATION_TOKEN="$UPSTREAM_SECRET" \ scout view \ --host 0.0.0.0 \ --trusted-origin https://scout.example.org \ --root-path /scout Load UPSTREAM_SECRET through your normal secret-management mechanism and set it to the complete expected Authorization header value (for example, Bearer ...). The proxy must authenticate the external user, remove any client-supplied copy of the upstream authorization header, and inject the configured value. Scout rejects requests whose Host header it doesn’t trust. Either have the proxy forward the browser’s Host unchanged (in nginx, proxy_set_header Host $http_host;), or add the Host the proxy sends with --trusted-host. For compatibility, an absolute --root-path such as https://scout.example.org/scout supplies its origin when no explicit --trusted-origin is provided. An explicit trusted origin is preferred, and a path-only root_path does not grant host or origin trust. Unauthenticated network exposure remains available only through an explicit acknowledgement: scout view \ --host 0.0.0.0 \ --trusted-origin "http://$MACHINE_IP:7576" \ --unsafe-allow-unauthenticated This permits any network client that can reach the address to call viewer APIs. Exact Host and browser-origin validation and framing protection remain active. --trusted-host may add an exact authority for a non-browser client or health check, but does not authorize a browser origin. Hosting the frontend and API on different origins is not supported. Projects In some cases you’ll prefer to define your transcript source, scanning model, and other configuration once for a project rather than each time you run scout scan. You can do this with a scout.yaml project file.