You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/quickstart.mdx
+49-24Lines changed: 49 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,15 +76,15 @@ icon: "rocket"
76
76
77
77
```bash
78
78
curl -fsSL https://releases.rivet.dev/sandbox-agent/latest/install.sh | sh
79
-
sandbox-agent server --token "$SANDBOX_TOKEN"--host 127.0.0.1 --port 2468
79
+
sandbox-agent server --no-token --host 0.0.0.0 --port 2468
80
80
```
81
81
</Tab>
82
82
83
83
<Tabtitle="npx">
84
84
Run without installing globally.
85
85
86
86
```bash
87
-
npx sandbox-agent server --token "$SANDBOX_TOKEN"--host 127.0.0.1 --port 2468
87
+
npx @sandbox-agent/cli server --no-token --host 0.0.0.0 --port 2468
88
88
```
89
89
</Tab>
90
90
@@ -93,15 +93,15 @@ icon: "rocket"
93
93
94
94
```bash
95
95
npm install -g @sandbox-agent/cli
96
-
sandbox-agent server --token "$SANDBOX_TOKEN"--host 127.0.0.1 --port 2468
96
+
sandbox-agent server --no-token --host 0.0.0.0 --port 2468
97
97
```
98
98
</Tab>
99
99
100
100
<Tabtitle="Build from source">
101
101
If you're running from source instead of the installed CLI.
102
102
103
103
```bash
104
-
cargo run -p sandbox-agent -- server --token "$SANDBOX_TOKEN"--host 127.0.0.1 --port 2468
104
+
cargo run -p sandbox-agent -- server --no-token --host 0.0.0.0 --port 2468
105
105
```
106
106
</Tab>
107
107
@@ -118,9 +118,45 @@ icon: "rocket"
118
118
</Tab>
119
119
</Tabs>
120
120
121
+
Binding to `0.0.0.0` allows the server to accept connections from any network interface, which is required when running inside a sandbox where clients connect remotely.
122
+
121
123
<AccordionGroup>
122
-
<Accordiontitle="Running without tokens">
123
-
If endpoint is not public, use `--no-token` to disable authentication. Most sandbox providers already secure their networking, so tokens are not required.
124
+
<Accordiontitle="Configuring token">
125
+
Tokens are usually not required. Most sandbox providers (E2B, Daytona, etc.) already secure their networking at the infrastructure level, so the server endpoint is never publicly accessible. For local development, binding to `127.0.0.1` ensures only local connections are accepted.
126
+
127
+
If you need to expose the server on a public endpoint, use `--token "$SANDBOX_TOKEN"` to require authentication on all requests:
128
+
129
+
```bash
130
+
sandbox-agent server --token "$SANDBOX_TOKEN" --host 0.0.0.0 --port 2468
131
+
```
132
+
133
+
Then pass the token when connecting:
134
+
135
+
<Tabs>
136
+
<Tabtitle="TypeScript">
137
+
```typescript
138
+
const client =awaitSandboxAgent.connect({
139
+
baseUrl: "http://your-server:2468",
140
+
token: process.env.SANDBOX_TOKEN,
141
+
});
142
+
```
143
+
</Tab>
144
+
145
+
<Tabtitle="curl">
146
+
```bash
147
+
curl "http://your-server:2468/v1/sessions" \
148
+
-H "Authorization: Bearer $SANDBOX_TOKEN"
149
+
```
150
+
</Tab>
151
+
152
+
<Tabtitle="CLI">
153
+
```bash
154
+
sandbox-agent api sessions list \
155
+
--endpoint http://your-server:2468 \
156
+
--token "$SANDBOX_TOKEN"
157
+
```
158
+
</Tab>
159
+
</Tabs>
124
160
</Accordion>
125
161
<Accordiontitle="CORS">
126
162
If you're calling the server from a browser, see the [CORS configuration guide](/docs/cors).
@@ -149,7 +185,6 @@ icon: "rocket"
149
185
150
186
const client =awaitSandboxAgent.connect({
151
187
baseUrl: "http://127.0.0.1:2468",
152
-
token: process.env.SANDBOX_TOKEN,
153
188
});
154
189
155
190
awaitclient.createSession("my-session", {
@@ -163,7 +198,6 @@ icon: "rocket"
163
198
<Tabtitle="curl">
164
199
```bash
165
200
curl -X POST "http://127.0.0.1:2468/v1/sessions/my-session" \
0 commit comments