Skip to content

feat: add Sailbox sandbox provider#3500

Open
nirvikbaruah wants to merge 26 commits into
openai:mainfrom
nirvikbaruah:feat/sailbox-sandbox-provider
Open

feat: add Sailbox sandbox provider#3500
nirvikbaruah wants to merge 26 commits into
openai:mainfrom
nirvikbaruah:feat/sailbox-sandbox-provider

Conversation

@nirvikbaruah

Copy link
Copy Markdown

Summary

Sailboxes are cost-efficient, long-lived sandboxes built by Sail Research. They are specifically designed for long-running background agents. A SAIL_API_KEY can be created through the platform.

This PR adds a Sailbox-backed sandbox provider under agents.extensions.sandbox.sailbox, following the existing hosted sandbox extension pattern. The provider is exposed through the optional sailbox extra and uses the sail-sdk package to create, resume, execute in, and clean up Sailboxes.

Supported features

  • SailboxSandboxClient / SailboxSandboxClientOptions for creating Sailboxes from built-in or custom Sail images.
  • SailboxSandboxSession / SailboxSandboxSessionState for serialized run-state resume.
  • Command execution through the Sailbox exec API, including concurrent exec support.
  • Workspace read/write through Sailbox file APIs.
  • Tar-based persist_workspace / hydrate_workspace support.
  • Exposed-port resolution through Sailbox listeners.
  • Optional pause-on-exit behavior for reconnecting to an existing Sailbox.
  • Lazy optional exports from agents.extensions.sandbox so users without the extra can still import the package.

Testing

  • Added 67 unit tests that match the coverage of other sandbox providers.uv run python -m pytest tests/extensions/sandbox/test_sailbox.py shows 67/67 passed.
  • We ran all the newly created SDK functions on Sailboxes and confirmed they worked: create/start, file write/read, exec, concurrent exec, workspace persist, pause, resume, verify workspace state, terminate.
  • Ran an e2e test using the new agents SDK -examples/sandbox/extensions/sailbox_runner.py --model gpt-5.5: agent inspected README.md, handoff.md, and todo.md through the Sailbox sandbox and completed successfully.

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run the focused provider tests
  • I've verified the provider against a live Sailbox environment

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba3d678822

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread uv.lock
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 89c3c63e88

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated
@kiwigitops

Copy link
Copy Markdown

One behavior gap to check is write(..., user=...). The method runs _check_write_with_exec(..., user=user), but the actual sailbox.write(...) call that creates or replaces the file still runs through the provider file API without the requested user.

For a new file under a directory the user can write, the access check can pass, but the resulting file may be owned by the sandbox default/root user rather than the requested user. Other filesystem helpers treat user as the execution identity for the operation itself, so this could create surprising ownership/permission differences after a write. If Sailbox cannot write as a specific user directly, it may need a temp-file plus install/chown path through exec for the user case.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de78c012b3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2ee8939ad

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2af55cd5d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3e8a89bbd6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54c10b3323

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 324a9fdcea

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/sandbox/test_client_options.py Outdated
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6ff6723b4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py
@nirvikbaruah nirvikbaruah force-pushed the feat/sailbox-sandbox-provider branch from e088d59 to 75ac18f Compare May 26, 2026 13:09
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 10 days with no activity.

@github-actions github-actions Bot added the stale label Jun 6, 2026
@nirvikbaruah nirvikbaruah force-pushed the feat/sailbox-sandbox-provider branch from 75ac18f to 0f33e3e Compare June 7, 2026 01:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0f33e3e8df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py
Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3080374079

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: adeb6b2277

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/agents/extensions/sandbox/sailbox/sandbox.py
@github-actions github-actions Bot removed the stale label Jun 7, 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.

3 participants