Skip to content

Commit 7246c91

Browse files
committed
Fix security docs: correct import path, clarify audit hook
1 parent 1669f5d commit 7246c91

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

docs/security.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,7 @@ Similarly, `exec()` replaces the current process image entirely, terminating the
1919

2020
## Audit Hook Mechanism
2121

22-
The sandbox uses Python's audit hook system (PEP 578) to intercept dangerous operations at a low level, before they can execute:
23-
24-
```python
25-
# Automatically installed when running inside Erlang
26-
import sys
27-
sys.addaudithook(sandbox_hook) # Cannot be removed once installed
28-
```
22+
The sandbox uses Python's audit hook system (PEP 578) to intercept dangerous operations at a low level, before they can execute. The hook is installed automatically when `erlang_python` starts and cannot be removed once installed.
2923

3024
This provides defense-in-depth - even if Python code tries to import `os` or `subprocess` directly, the operations are blocked.
3125

@@ -142,7 +136,7 @@ erlang.send(supervisor_pid, ('spawn_worker', worker_args))
142136
From Python, you can check if the sandbox is active:
143137

144138
```python
145-
from erlang._sandbox import is_sandboxed
139+
from _erlang_impl._sandbox import is_sandboxed
146140

147141
if is_sandboxed():
148142
print("Running inside Erlang VM - subprocess operations blocked")

0 commit comments

Comments
 (0)