Skip to content

Commit 0a5fb53

Browse files
authored
Merge pull request #1 from langchain-ai/eugene/some_fixes
some permission fixes
2 parents 97b1d2a + 70fde57 commit 0a5fb53

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

libs/sandbox-py/langchain_sandbox/py.typed.py

Whitespace-only changes.

libs/sandbox-py/langchain_sandbox/pyodide.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,16 @@ def __init__( # noqa: PLR0913
116116
- List[str]: Read access restricted to specific paths, e.g.
117117
["/tmp/sandbox", "./data"]
118118
119+
By default allows read to node_modules and to sessions dir
120+
119121
allow_write: File system write access configuration:
120122
- False: No file system write access (default, most secure)
121123
- True: Unrestricted write access to the file system
122124
- List[str]: Write access restricted to specific paths, e.g.
123125
["/tmp/sandbox/output"]
124126
127+
By default allows read to node_modules and to sessions dir
128+
125129
allow_net: Network access configuration:
126130
- False: No network access (default, most secure)
127131
- True: Unrestricted network access
@@ -152,7 +156,7 @@ def __init__( # noqa: PLR0913
152156

153157
# Check if Deno is installed
154158
try:
155-
subprocess.run(["deno", "--version"], check=True) # noqa: S607, S603
159+
subprocess.run(["deno", "--version"], check=True, capture_output=True) # noqa: S607, S603
156160
except subprocess.CalledProcessError as e:
157161
msg = "Deno is installed, but running it failed."
158162
raise RuntimeError(msg) from e
@@ -164,8 +168,8 @@ def __init__( # noqa: PLR0913
164168
# each tuple contains (flag, setting, defaults)
165169
perm_defs = [
166170
("--allow-env", allow_env, None),
167-
("--allow-read", allow_read, [sessions_dir]),
168-
("--allow-write", allow_write, [sessions_dir]),
171+
("--allow-read", allow_read, [sessions_dir, "node_modules"]),
172+
("--allow-write", allow_write, [sessions_dir, "node_modules"]),
169173
("--allow-net", allow_net, None),
170174
("--allow-run", allow_run, None),
171175
("--allow-ffi", allow_ffi, None),

libs/sandbox-py/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "langchain_sandbox"
3-
version = "0.0.1"
3+
version = "0.0.2"
44
description = "LangChain Sandbox"
55
readme = "README.md"
66
requires-python = ">=3.10"

0 commit comments

Comments
 (0)