Skip to content

fix: redact mountpoint credentials in sandbox mount errors#3421

Closed
matthewflint wants to merge 1 commit into
openai:mainfrom
matthewflint:mflint/sandbox-redact-mountpoint-credentials
Closed

fix: redact mountpoint credentials in sandbox mount errors#3421
matthewflint wants to merge 1 commit into
openai:mainfrom
matthewflint:mflint/sandbox-redact-mountpoint-credentials

Conversation

@matthewflint
Copy link
Copy Markdown
Contributor

Summary

  • Keep the real mount-s3 shell command unchanged for execution.
  • Add a small command-rendering helper that can render a redacted copy for errors/logging.
  • Use the redacted command in MountCommandError so AWS access key, secret key, and session token are not exposed when a mount fails.

Why

MountpointMountPattern.apply() currently prefixes mount-s3 with AWS credential environment variables. On failure it passes that full command into MountCommandError, which can leak credentials into exceptions, test logs, or user-visible diagnostics.

Testing

  • uv run pytest tests/sandbox/test_mount_patterns.py
  • uv run ruff check src/agents/sandbox tests/sandbox
  • uv run pyright

Keep the executable mount-s3 command unchanged, but redact AWS credential environment variables when reporting MountCommandError so failures do not expose secrets.
@seratch
Copy link
Copy Markdown
Member

seratch commented May 18, 2026

Thanks for sharing this. #3429 resolved the issue.

@seratch seratch closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants