Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

[skip ci] Release new versions

github-actions[bot]ce634ab5f2c7
diff --git a/.changeset/network-transform-iam-placeholders.md b/.changeset/network-transform-iam-placeholders.md
deleted file mode 100644
index 28fc2cab6..000000000
--- a/.changeset/network-transform-iam-placeholders.md
+++ /dev/null
@@ -1,58 +0,0 @@
----
-'e2b': minor
-'@e2b/python-sdk': minor
----
-
-Allow a network rule's `transform` to be a callback, so a workload identity token from the `iam` option can be injected into egress requests without the SDK ever seeing its value. The callback receives placeholder strings that the egress proxy resolves per request — `iam.tokens.aws` is `${e2b.identity.tokens.aws}` on the wire — and referencing a token that is not registered in `iam.tokens` fails with `InvalidArgumentError` / `InvalidArgumentException` instead of silently sending a placeholder no token will ever replace.
-
-`updateNetwork` / `update_network` accepts the same callbacks, but its payload carries no `iam` config, so token names cannot be checked there and every name resolves to its placeholder.
-
-Token names are validated where they are registered and again before they are interpolated: a name cannot be empty or contain `{`, `}` or control characters, since the proxy reads a placeholder up to its first `}` and a brace in the name would resolve a different token than the one referenced.
-
-```ts
-import { Sandbox, Secret } from 'e2b'
-
-const sandbox = await Sandbox.create({
- iam: {
- tokens: {
- aws: Secret.iamToken({ audience: 'sts.amazonaws.com', tokenType: 'JWT-SVID' }),
- },
- },
- network: {
- allowOut: ({ rules }) => [...rules.keys()],
- rules: {
- 'api.internal.example.com': [
- {
- transform: ({ iam }) => ({
- headers: { Authorization: `Bearer ${iam.tokens.aws}` },
- }),
- },
- ],
- },
- },
-})
-```
-
-```python
-from e2b import Sandbox, Secret
-
-sandbox = Sandbox.create(
- iam={
- "tokens": {
- "aws": Secret.iam_token(audience="sts.amazonaws.com", token_type="JWT-SVID"),
- },
- },
- network={
- "allow_out": lambda ctx: list(ctx.rules.keys()),
- "rules": {
- "api.internal.example.com": [
- {
- "transform": lambda ctx: {
- "headers": {"Authorization": f"Bearer {ctx.iam.tokens['aws']}"},
- },
- },
- ],
- },
- },
-)
-```
diff --git a/.changeset/python-share-sync-envd-api-client.md b/.changeset/python-share-sync-envd-api-client.md
deleted file mode 100644
index 60254ff2c..000000000
--- a/.changeset/python-share-sync-envd-api-client.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-"@e2b/python-sdk": patch
----
-
-Build the envd HTTP API client once per sync `Sandbox` and share it across the
-filesystem, commands, and PTY modules, which now receive it instead of each
-constructing their own — matching `AsyncSandbox`. No behavior change: the
-pyqwest transport underneath is already cached process-wide per
-`(proxy, for_streaming)`, so the separate clients shared one connection pool
-either way. `Filesystem` still builds the streaming sibling client whose
-transport carries the idle read timeout, in both flavors.
diff --git a/.changeset/sandbox-iam-tokens.md b/.changeset/sandbox-iam-tokens.md
deleted file mode 100644
index 9883c2716..000000000
--- a/.changeset/sandbox-iam-tokens.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-'e2b': minor
-'@e2b/python-sdk': minor
----
-
-Add the `iam` option to `Sandbox.create` for configuring sandbox workload identity, and a `Secret` class with an `iamToken` / `iam_token` method for defining the workload tokens. Passing a non-empty `tokens` map (name → `{ audience, tokenType }`) enables workload identity for the sandbox:
-
-```ts
-import { Sandbox, Secret } from 'e2b'
-
-const sandbox = await Sandbox.create({
- iam: {
- tokens: {
- aws: Secret.iamToken({ audience: 'sts.amazonaws.com', tokenType: 'JWT-SVID' }),
- },
- },
-})
-```
-
-```python
-from e2b import Sandbox, Secret
-
-sandbox = Sandbox.create(
- iam={
- "tokens": {
- "aws": Secret.iam_token(audience="sts.amazonaws.com", token_type="JWT-SVID"),
- },
- },
-)
-```
-
-Plain `{ audience, tokenType }` objects (`{"audience": ..., "token_type": ...}` dicts in Python) are accepted as token values too.
diff --git a/packages/js-sdk/CHANGELOG.md b/packages/js-sdk/CHANGELOG.md
index 0456382ae..294b437a8 100644
--- a/packages/js-sdk/CHANGELOG.md
+++ b/packages/js-sdk/CHANGELOG.md
@@ -1,5 +1,97 @@
# e2b
+## 2.39.0
+
+### Minor Changes
+
+- 07eb9be: Allow a network rule's `transform` to be a callback, so a workload identity token from the `iam` option can be injected into egress requests without the SDK ever seeing its value. The callback receives placeholder strings that the egress proxy resolves per request — `iam.tokens.aws` is `${e2b.identity.tokens.aws}` on the wire — and referencing a token that is not registered in `iam.tokens` fails with `InvalidArgumentError` / `InvalidArgumentException` instead of silently sending a placeholder no token will ever replace.
+
+ `updateNetwork` / `update_network` accepts the same callbacks, but its payload carries no `iam` config, so token names cannot be checked there and every name resolves to its placeholder.
+
+ Token names are validated where they are registered and again before they are interpolated: a name cannot be empty or contain `{`, `}` or control characters, since the proxy reads a placeholder up to its first `}` and a brace in the name would resolve a different token than the one referenced.
+
+ ```ts
+ import { Sandbox, Secret } from 'e2b'
+
+ const sandbox = await Sandbox.create({
+ iam: {
+ tokens: {
+ aws: Secret.iamToken({
+ audience: 'sts.amazonaws.com',
+ tokenType: 'JWT-SVID',
+ }),
+ },
+ },
+ network: {
+ allowOut: ({ rules }) => [...rules.keys()],
+ rules: {
+ 'api.internal.example.com': [
+ {
+ transform: ({ iam }) => ({
+ headers: { Authorization: `Bearer ${iam.tokens.aws}` },
+ }),
+ },
+ ],
+ },
+ },
+ })
+ ```
+
+ ```python
+ from e2b import Sandbox, Secret
+
+ sandbox = Sandbox.create(
+ iam={
+ "tokens": {
+ "aws": Secret.iam_token(audience="sts.amazonaws.com", token_type="JWT-SVID"),
+ },
+ },
+ network={
+ "allow_out": lambda ctx: list(ctx.rules.keys()),
+ "rules": {
+ "api.internal.example.com": [
+ {
+ "transform": lambda ctx: {
+ "headers": {"Authorization": f"Bearer {ctx.iam.tokens['aws']}"},
+ },
+ },
+ ],
+ },
+ },
+ )
+ ```
+
+- 64b25bb: Add the `iam` option to `Sandbox.create` for configuring sandbox workload identity, and a `Secret` class with an `iamToken` / `iam_token` method for defining the workload tokens. Passing a non-empty `tokens` map (name → `{ audience, tokenType }`) enables workload identity for the sandbox:
+
+ ```ts
+ import { Sandbox, Secret } from 'e2b'
+
+ const sandbox = await Sandbox.create({
+ iam: {
+ tokens: {
+ aws: Secret.iamToken({
+ audience: 'sts.amazonaws.com',
+ tokenType: 'JWT-SVID',
+ }),
+ },
+ },
+ })
+ ```
+
+ ```python
+ from e2b import Sandbox, Secret
+
+ sandbox = Sandbox.create(
+ iam={
+ "tokens": {
+ "aws": Secret.iam_token(audience="sts.amazonaws.com", token_type="JWT-SVID"),
+ },
+ },
+ )
+ ```
+
+ Plain `{ audience, tokenType }` objects (`{"audience": ..., "token_type": ...}` dicts in Python) are accepted as token values too.
+
## 2.38.3
### Patch Changes
diff --git a/packages/js-sdk/package.json b/packages/js-sdk/package.json
index a51ad0025..192d94467 100644
--- a/packages/js-sdk/package.json
+++ b/packages/js-sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "e2b",
- "version": "2.38.3",
+ "version": "2.39.0",
"description": "E2B SDK that give agents cloud environments",
"homepage": "https://e2b.dev",
"license": "MIT",
diff --git a/packages/python-sdk/CHANGELOG.md b/packages/python-sdk/CHANGELOG.md
index 55d9ca4a8..26ea53c2c 100644
--- a/packages/python-sdk/CHANGELOG.md
+++ b/packages/python-sdk/CHANGELOG.md
@@ -1,5 +1,107 @@
# @e2b/python-sdk
+## 2.39.0
+
+### Minor Changes
+
+- 07eb9be: Allow a network rule's `transform` to be a callback, so a workload identity token from the `iam` option can be injected into egress requests without the SDK ever seeing its value. The callback receives placeholder strings that the egress proxy resolves per request — `iam.tokens.aws` is `${e2b.identity.tokens.aws}` on the wire — and referencing a token that is not registered in `iam.tokens` fails with `InvalidArgumentError` / `InvalidArgumentException` instead of silently sending a placeholder no token will ever replace.
+
+ `updateNetwork` / `update_network` accepts the same callbacks, but its payload carries no `iam` config, so token names cannot be checked there and every name resolves to its placeholder.
+
+ Token names are validated where they are registered and again before they are interpolated: a name cannot be empty or contain `{`, `}` or control characters, since the proxy reads a placeholder up to its first `}` and a brace in the name would resolve a different token than the one referenced.
+
+ ```ts
+ import { Sandbox, Secret } from 'e2b'
+
+ const sandbox = await Sandbox.create({
+ iam: {
+ tokens: {
+ aws: Secret.iamToken({
+ audience: 'sts.amazonaws.com',
+ tokenType: 'JWT-SVID',
+ }),
+ },
+ },
+ network: {
+ allowOut: ({ rules }) => [...rules.keys()],
+ rules: {
+ 'api.internal.example.com': [
+ {
+ transform: ({ iam }) => ({
+ headers: { Authorization: `Bearer ${iam.tokens.aws}` },
+ }),
+ },
+ ],
+ },
+ },
+ })
+ ```
+
+ ```python
+ from e2b import Sandbox, Secret
+
+ sandbox = Sandbox.create(
+ iam={
+ "tokens": {
+ "aws": Secret.iam_token(audience="sts.amazonaws.com", token_type="JWT-SVID"),
+ },
+ },
+ network={
+ "allow_out": lambda ctx: list(ctx.rules.keys()),
+ "rules": {
+ "api.internal.example.com": [
+ {
+ "transform": lambda ctx: {
+ "headers": {"Authorization": f"Bearer {ctx.iam.tokens['aws']}"},
+ },
+ },
+ ],
+ },
+ },
+ )
+ ```
+
+- 64b25bb: Add the `iam` option to `Sandbox.create` for configuring sandbox workload identity, and a `Secret` class with an `iamToken` / `iam_token` method for defining the workload tokens. Passing a non-empty `tokens` map (name → `{ audience, tokenType }`) enables workload identity for the sandbox:
+
+ ```ts
+ import { Sandbox, Secret } from 'e2b'
+
+ const sandbox = await Sandbox.create({
+ iam: {
+ tokens: {
+ aws: Secret.iamToken({
+ audience: 'sts.amazonaws.com',
+ tokenType: 'JWT-SVID',
+ }),
+ },
+ },
+ })
+ ```
+
+ ```python
+ from e2b import Sandbox, Secret
+
+ sandbox = Sandbox.create(
+ iam={
+ "tokens": {
+ "aws": Secret.iam_token(audience="sts.amazonaws.com", token_type="JWT-SVID"),
+ },
+ },
+ )
+ ```
+
+ Plain `{ audience, tokenType }` objects (`{"audience": ..., "token_type": ...}` dicts in Python) are accepted as token values too.
+
+### Patch Changes
+
+- 11912ff: Build the envd HTTP API client once per sync `Sandbox` and share it across the
+ filesystem, commands, and PTY modules, which now receive it instead of each
+ constructing their own — matching `AsyncSandbox`. No behavior change: the
+ pyqwest transport underneath is already cached process-wide per
+ `(proxy, for_streaming)`, so the separate clients shared one connection pool
+ either way. `Filesystem` still builds the streaming sibling client whose
+ transport carries the idle read timeout, in both flavors.
+
## 2.38.0
### Minor Changes
diff --git a/packages/python-sdk/package.json b/packages/python-sdk/package.json
index aa6cef73d..de880e8eb 100644
--- a/packages/python-sdk/package.json
+++ b/packages/python-sdk/package.json
@@ -1,7 +1,7 @@
{
"name": "@e2b/python-sdk",
"private": true,
- "version": "2.38.0",
+ "version": "2.39.0",
"scripts": {
"example": "uv run python example.py",
"test": "uv run pytest -n 4 --verbose -x",
diff --git a/packages/python-sdk/pyproject.toml b/packages/python-sdk/pyproject.toml
index 75905c830..6c915f15f 100644
--- a/packages/python-sdk/pyproject.toml
+++ b/packages/python-sdk/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "e2b"
-version = "2.38.0"
+version = "2.39.0"
description = "E2B SDK that give agents cloud environments"
authors = [{ name = "e2b", email = "[email protected]" }]
license = "MIT"
diff --git a/packages/python-sdk/uv.lock b/packages/python-sdk/uv.lock
index 7029dc8cb..d518993e5 100644
--- a/packages/python-sdk/uv.lock
+++ b/packages/python-sdk/uv.lock
@@ -183,7 +183,7 @@ wheels = [
[[package]]
name = "e2b"
-version = "2.38.0"
+version = "2.39.0"
source = { editable = "." }
dependencies = [
{ name = "attrs" },