Skip to content

docs: sandbox workload identity (IAM tokens) and transform callbacks - #312

Draft
mishushakov wants to merge 2 commits into
mainfrom
document-pr-1606-changes
Draft

docs: sandbox workload identity (IAM tokens) and transform callbacks#312
mishushakov wants to merge 2 commits into
mainfrom
document-pr-1606-changes

Conversation

@mishushakov

@mishushakov mishushakov commented Jul 24, 2026

Copy link
Copy Markdown
Member

Documents sandbox workload identity from e2b-dev/E2B#1606 and the stacked e2b-dev/E2B#1616. Adds a new Workload identity page to the Sandbox group covering the iam option on Sandbox.create, the Secret.iamToken / Secret.iam_token helper, the plain-object token form, and verified backend constraints (JWT-SVID only, required audience, 5-token limit, per-team gating error). Both this page and the internet-access page also document transform callbacks on network rules, which inject registered tokens as ${e2b.identity.tokens.<name>} placeholders that the egress proxy resolves per request. Runtime token delivery inside the sandbox is intentionally not documented — it isn't implemented in the public spec yet.

🤖 Generated with Claude Code

Documents the new `iam` option on Sandbox.create and the Secret
iamToken/iam_token helper from e2b-dev/E2B#1606.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Jul 24, 2026
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only changes with no runtime or security code in this PR.

Overview
Adds docs/sandbox/workload-identity.mdx and registers it in docs.json. Extends docs/network/internet-access.mdx with transform callbacks, placeholder ${e2b.identity.tokens.<name>} behavior, sync callback requirement, and a link to the new page. No documentation errors identified in this repo; SDK/backend behavior described here is not verifiable from these files alone.

Reviewed by Cursor Bugbot for commit aa9fd4f. Bugbot is set up for automated code reviews on this repo. Configure here.

Each token is scoped to an audience — the external service that will verify it, such as AWS STS — and the service can exchange the token for its own temporary credentials.

<Note>
Workload identity is currently available for selected teams. If it's not enabled for your team, sandbox creation with the `iam` option fails with `Sandbox IAM workload tokens are not available for your team.` — [contact us](/docs/support) to get access.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Team used instead of project

Medium Severity

Prose uses "teams" / "your team" for the E2B organizational unit; user-facing docs use "project". The quoted API error string can keep "team".

Fix in Cursor Fix in Web

Triggered by learned rule: Use "project" not "team" for the organizational concept — but keep API identifiers unchanged

Reviewed by Cursor Bugbot for commit 9614e54. Configure here.

@mintlify

mintlify Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
e2b 🟢 Ready View Preview Jul 24, 2026, 5:36 PM

Covers e2b-dev/E2B#1616: transform callbacks receiving iam.tokens
placeholders, resolved per request by the egress proxy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mishushakov mishushakov changed the title docs: add sandbox workload identity (IAM tokens) page docs: sandbox workload identity (IAM tokens) and transform callbacks Aug 10, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit aa9fd4f. Configure here.


The value read from `iam.tokens.<name>` is a placeholder string (`${e2b.identity.tokens.<name>}`) sent on the wire as-is — the egress proxy replaces it with a freshly minted token on each matching request, so the token value never passes through your code or the sandbox. Referencing a name that isn't registered in the sandbox's `iam.tokens` fails at creation with `InvalidArgumentError` (JavaScript) / `InvalidArgumentException` (Python).

The callback must be synchronous and return a plain transform object — a promise (from an `async` callback) or any other return value is rejected with an error. Static `transform` objects keep working unchanged, including hand-written `${e2b.identity.tokens.<name>}` strings.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Em dashes in new docs prose

Low Severity

New docs prose uses em dashes, which violates the house style rule against em dashes and semicolons in documentation prose.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: No em dashes or semicolons in docs prose (house style)

Reviewed by Cursor Bugbot for commit aa9fd4f. Configure here.

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.

1 participant