agent-first-screenshots
Pass
Audited by Gen Agent Trust Hub on Aug 15, 2026
Risk Level: SAFEREMOTE_CODE_EXECUTIONCOMMAND_EXECUTION
Full Analysis
- [REMOTE_CODE_EXECUTION]: The
capture-verify.mjsscript connects to a browser instance via Chrome DevTools Protocol (CDP) and can execute arbitrary JavaScript within the page context usingRuntime.evaluate. This is a functional requirement used to settle the page state (e.g., closing modals or hiding specific elements) before capturing the screenshot. - [DYNAMIC_EXECUTION]: All included scripts (
beautify.mjs,capture-verify.mjs,screenshot-verify.mjs) implement aloadSharpfunction that dynamically resolves thesharpimage processing library. This function searches for the library in localnode_modulesor.pnpmstore directories by walking up the file system tree, which is a portability mechanism for specific monorepo or pnpm-based environments. - [INDIRECT_PROMPT_INJECTION]: The
capture-verify.mjsscript accepts apreCaptureJavaScript string through a JSON command-line argument. This represents an attack surface where an agent, if directed by untrusted input, could execute malicious code within the browser session. - Ingestion points:
specJsoncommand-line argument inscripts/capture-verify.mjs. - Boundary markers: None. The script parses the JSON and evaluates the
preCapturestring directly. - Capability inventory: Arbitrary JavaScript execution in the browser context via
Runtime.evaluate; local file system writes viafs.writeFileSyncto the output path and/tmp/last-capture.png. - Sanitization: None. The script executes the provided expression without filtering.
Audit Metadata