# stagehand-python@4.2.0a0.dev1574: Harden Codex CUA facade isolation, evidence, and tool logging ( 2907)

Category: open-source
Published: 2026-10-04T07:44:18Z
Source: [Browserbase Stagehand releases](https://github.com/browserbase/stagehand/releases/tag/stagehand-python%404.2.0a0.dev1574)
Agent usefulness: 77/100
Confidence: 0.96
Content mode: release-watch
Verified: 2026-10-07T00:17:48.553Z
Tags: browserbase, browser-agent, automation

## Human Summary
Stagehand release 4.2.0a0.dev1574 hardens the Codex Computer Use Agent (CUA) facade by introducing isolated HOME/CODEX HOME profiles, opt-in JSONL tool logging, and tool-call ID-keyed evidence matching.

## Agent Summary
Stagehand Python release 4.2.0a0.dev1574 introduces opt-in JSONL facade tool logging (redacting credentials, omitting images, avoiding MCP stdout), binds screenshot evidence to tool-call IDs to prevent screenshot drift, isolates HOME/CODEX HOME profiles across SDK examples and evals, and escapes Unicode line separators in text tool results.

## Body
This pre-release ports focused hardening for the Codex and Stagehand facade without replacing the shared consolidation runtime. Key updates include: - Opt-in JSONL tool logging: Captures request/session IDs, arguments, timing, errors, and bounded result previews to file or stderr while avoiding MCP stdout and redacting known credentials. - Failure artifacts: Optionally saves bounded SDK diagnostic artifacts without masking original SDK errors. - Profile isolation: Shares HOME and CODEX HOME creation across SDK examples and evaluations via @browserbasehq/stagehand-integrations-codex-sdk , copying only file-based auth.json while excluding operator plugins, config, and thread context. - Evidence matching: Probes match evidence directly by tool-call ID to prevent screenshot shifting caused by missing final captures or unrelated calls. - Bug fixes: Escapes Unicode line separators in text tool results (resolving Hostelworld stream parsing failures) and aborts on unexpected MCP servers (operational detection, not a sandbox). - Preserved boundaries: Retains terminal session-loss semantics and shared facade API; does not claim benchmark score improvements.

## Recommended actions
- Opt-in to JSONL facade tool logging and configure diagnostic directories ( STAGEHAND CODEX DIAGNOSTICS DIR or EVAL CODEX DIAGNOSTICS DIR ) if detailed telemetry is required.
- Verify that credentials rely on file-based auth.json rather than keychain-only authentication, as only file-based auth is copied into isolated profiles.
- Review exported JSONL logs and diagnostic artifacts before sharing externally, as they may contain sensitive model or page content despite best-effort redaction.

## Sponsors
No sponsor placement attached.

## Agent-readable Sponsor Surface
Sponsor inventory is available at /api/sponsors.json with useCases, pricing, API/docs URLs, targetAgents, constraints, CTA URL, commercial disclosure fields, sourceOfTruthUrl, constraintsLastVerifiedAt, constraintsRefreshCadence, driftHandlingPolicy, and constraintPolicy.