Skip to content

Commit 51d641f

Browse files
fix docs: update Python network update examples
1 parent 1192ccc commit 51d641f

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/sandbox/internet-access.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,21 @@ from e2b import Sandbox, ALL_TRAFFIC
259259
sandbox = Sandbox.create()
260260

261261
# Tighten egress on the running sandbox: block 8.8.8.8
262-
sandbox.update_network(deny_out=["8.8.8.8"])
262+
sandbox.update_network({"deny_out": ["8.8.8.8"]})
263263

264264
# Replace with an allow-list only
265-
sandbox.update_network(
266-
deny_out=[ALL_TRAFFIC],
267-
allow_out=["api.example.com"],
268-
)
265+
sandbox.update_network({
266+
"deny_out": [ALL_TRAFFIC],
267+
"allow_out": ["api.example.com"],
268+
})
269269

270270
# Toggle internet access without recreating the sandbox
271-
sandbox.update_network(allow_internet_access=False)
271+
sandbox.update_network({"allow_internet_access": False})
272272
```
273273
</CodeGroup>
274274

275275
<Note>
276-
`updateNetwork` / `update_network` **replaces** the current egress configuration — it does not merge with the existing rules. Calling it with no arguments (or an empty object) clears all `allowOut` / `denyOut` / per-host rules set at create time.
276+
`updateNetwork` / `update_network` **replaces** the current egress configuration — it does not merge with the existing rules. Calling it with an empty object (`updateNetwork({})` / `update_network({})`) clears all `allowOut` / `denyOut` / per-host rules set at create time.
277277
</Note>
278278

279279
The create-only options `allowPublicTraffic` and `maskRequestHost` cannot be changed after the sandbox is created.

0 commit comments

Comments
 (0)