|
1 | 1 | # Code Interpreter |
2 | 2 |
|
3 | | -## Authentication and networking |
4 | | - |
5 | | -The template requires envd 0.9.1 or later with the local token delivery socket. |
6 | | -The server receives a SHA-512 token verifier over `/run/e2b-auth/token.sock` and |
7 | | -validates `X-Access-Token` locally. It rejects requests before provisioning and |
8 | | -after disconnecting. `/health` needs no bearer token, but remains unavailable |
9 | | -until the auth connection is established. Tokenless sandboxes cannot execute code. |
10 | | - |
11 | | -The systemd service creates `/etc/e2b/code-interpreter-auth` when first started. |
12 | | -This marker contains no credentials; it makes envd wait for token delivery to be |
13 | | -acknowledged during initialization, including resume and fork. The auth connection |
14 | | -is also reestablished after an interpreter or envd restart. |
15 | | - |
16 | | -Jupyter listens only on `/run/e2b-jupyter/server.sock` (mode `0600`, directory |
17 | | -mode `0700`), including kernel WebSocket channels. Port `49999` remains the |
18 | | -authenticated interpreter API; Jupyter no longer listens on port `8888`. |
19 | | - |
20 | | -Deploy envd and SDK context-auth updates before rebuilding this template. Local |
21 | | -Docker development explicitly sets `E2B_LOCAL=true`, which disables auth; do not |
22 | | -use that setting in deployed templates. |
23 | | - |
24 | | -Run the server tests locally with: |
25 | | - |
26 | | -```sh |
27 | | -uv run --with-requirements template/requirements-test.txt pytest template/tests |
28 | | -``` |
29 | | - |
30 | 3 | ## Building the production template |
31 | 4 |
|
32 | 5 | To build the official `code-interpreter-v1` template from this repo, use |
@@ -149,3 +122,28 @@ Inside a running sandbox you can also inspect things directly: |
149 | 122 | journalctl -u jupyter -u code-interpreter |
150 | 123 | systemctl status code-interpreter |
151 | 124 | ``` |
| 125 | + |
| 126 | +## Interpreter authentication |
| 127 | + |
| 128 | +The template requires envd 0.9.1 or later with the local token delivery socket. |
| 129 | +The server receives a SHA-512 token verifier over `/run/e2b-auth/token.sock` and |
| 130 | +validates `X-Access-Token` locally. It rejects requests before provisioning and |
| 131 | +after disconnecting. `/health` needs no bearer token, but remains unavailable |
| 132 | +until the auth connection is established. Tokenless sandboxes cannot execute code. |
| 133 | + |
| 134 | +The systemd service creates `/etc/e2b/code-interpreter-auth` when first started. |
| 135 | +This marker contains no credentials; it makes envd wait for token delivery to be |
| 136 | +acknowledged during initialization, including resume and fork. The auth connection |
| 137 | +is also reestablished after an interpreter or envd restart. |
| 138 | + |
| 139 | +Deploy envd and SDK context-auth updates before rebuilding this template. Local |
| 140 | +Docker development explicitly sets `E2B_LOCAL=true`, which disables auth; do not |
| 141 | +use that setting in deployed templates. Authentication protects the interpreter |
| 142 | +API on port `49999`; it does not change Jupyter's listener or secure direct |
| 143 | +access to Jupyter. Jupyter isolation is a separate transport change. |
| 144 | + |
| 145 | +Run the authentication tests locally with: |
| 146 | + |
| 147 | +```sh |
| 148 | +uv run --with-requirements template/requirements-test.txt pytest template/tests/test_auth.py |
| 149 | +``` |
0 commit comments