Skip to content

Commit 3020d0c

Browse files
NathanFlurryrivet-docs-sync[bot]
andauthored
docs(agents): sync from rivet-dev/agents@f08f2ed (#142)
Co-authored-by: rivet-docs-sync[bot] <docs-sync@rivet.dev>
1 parent a7914ee commit 3020d0c

5 files changed

Lines changed: 66 additions & 15 deletions

File tree

‎vendor/agents/docs/content/docs/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Each agent on Rivet is one [Rivet Actor](/actors/docs). You define the agent onc
8989
Give agents model access with your own provider keys.
9090
</Card>
9191
<Card title="Sandboxes" href="/agents/docs/sandboxes">
92-
Run an agent's file and shell tools in E2B, Daytona, or your own provider.
92+
Run an agent's file and shell tools in E2B, Daytona, Freestyle, or your own provider.
9393
</Card>
9494
<Card title="Custom Tools" href="/agents/docs/custom-tools">
9595
Give an agent tools that run in your backend, with your APIs and secrets.

‎vendor/agents/docs/content/docs/quickstart.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ npm add @rivet-dev/sandbox-adapter
9494
<CodeSnippet file="examples/docs/sandboxes/agentos.ts" title="agentos.ts" />
9595
<CodeSnippet file="examples/docs/pi/server.ts" title="e2b.ts" />
9696
<CodeSnippet file="examples/docs/pi/daytona.ts" title="daytona.ts" />
97+
<CodeSnippet file="examples/docs/sandboxes/freestyle.ts" title="freestyle.ts" />
9798
</CodeGroup>
9899

99-
[agentOS](/agentos/docs) needs no provider account. For <a href="https://e2b.dev" target="_blank" rel="noopener noreferrer">E2B</a>, install `e2b` and set `E2B_API_KEY`. For <a href="https://daytona.io" target="_blank" rel="noopener noreferrer">Daytona</a>, install `@daytonaio/sdk` and set `DAYTONA_API_KEY`. See [Sandboxes](/agents/docs/sandboxes).
100+
[agentOS](/agentos/docs) needs no provider account. For <a href="https://e2b.dev" target="_blank" rel="noopener noreferrer">E2B</a>, install `e2b` and set `E2B_API_KEY`. For <a href="https://daytona.io" target="_blank" rel="noopener noreferrer">Daytona</a>, install `@daytonaio/sdk` and set `DAYTONA_API_KEY`. For <a href="https://freestyle.sh" target="_blank" rel="noopener noreferrer">Freestyle</a>, install `freestyle` and set `FREESTYLE_API_KEY`. See [Sandboxes](/agents/docs/sandboxes).
100101

101102
</Step>
102103

‎vendor/agents/docs/content/docs/sandboxes.mdx‎

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Sandboxes"
3-
description: "Run an agent without a sandbox, or give it a shell in agentOS, E2B, Daytona, or a sandbox provider you write."
3+
description: "Run an agent without a sandbox, or give it a shell in agentOS, E2B, Daytona, Freestyle, or a sandbox provider you write."
44
---
55

66
An agent doesn't need a sandbox. Without one, its file tools work on files in the Actor's own database. Add a sandbox only when the agent needs a shell.
@@ -27,28 +27,30 @@ See [Built-in Tools](/agents/docs/built-in-tools) for what each tool does.
2727
When the agent needs to run commands, such as tests or a build, pass a sandbox provider. <a href="https://github.com/rivet-dev/agents/tree/main/packages/sandbox-adapter" target="_blank" rel="noopener noreferrer">`@rivet-dev/sandbox-adapter`</a> gives each Actor its own sandbox, and `CodingTools` run there.
2828

2929
<div style="overflow-x:auto">
30-
<svg viewBox="0 0 676 246" role="img" aria-label="The agent Actor sends tool calls through the sandbox adapter, which creates and connects to one sandbox per Actor from a sandbox provider: agentOS, E2B, or Daytona." style="width:100%;min-width:520px;max-width:676px;height:auto;display:block;margin:2.5rem auto;font-family:system-ui,sans-serif">
30+
<svg viewBox="0 0 676 306" role="img" aria-label="The agent Actor sends tool calls through the sandbox adapter, which creates and connects to one sandbox per Actor from a sandbox provider: agentOS, E2B, Daytona, or Freestyle." style="width:100%;min-width:520px;max-width:676px;height:auto;display:block;margin:2.5rem auto;font-family:system-ui,sans-serif">
3131
<defs>
3232
<marker id="sandboxes-arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0 0 L10 5 L0 10 z" fill="rgb(var(--site-ink, 27 25 22))"/></marker>
3333
</defs>
34-
<rect x="484" y="30" width="172" height="196" rx="10" style="fill:rgb(var(--site-paper-mid, 250 248 243));stroke:rgb(var(--site-pine, 46 64 52));stroke-width:1.4;stroke-dasharray:7 6"/>
34+
<rect x="484" y="30" width="172" height="256" rx="10" style="fill:rgb(var(--site-paper-mid, 250 248 243));stroke:rgb(var(--site-pine, 46 64 52));stroke-width:1.4;stroke-dasharray:7 6"/>
3535
<text x="484" y="20" font-size="11" font-family="ui-monospace, monospace" font-weight="600" letter-spacing="0.14em" style="fill:rgb(var(--site-pine, 46 64 52))">SANDBOX PROVIDERS</text>
36-
<rect x="20" y="100" width="140" height="56" rx="7" fill="#c7e4fb" stroke="#3d9df3" stroke-width="2"/>
37-
<rect x="260" y="100" width="160" height="56" rx="7" fill="#ffffff" stroke="#1b1916" stroke-width="1.4"/>
36+
<rect x="20" y="130" width="140" height="56" rx="7" fill="#c7e4fb" stroke="#3d9df3" stroke-width="2"/>
37+
<rect x="260" y="130" width="160" height="56" rx="7" fill="#ffffff" stroke="#1b1916" stroke-width="1.4"/>
3838
<rect x="500" y="46" width="140" height="44" rx="7" fill="#fecaca" stroke="#ef4444" stroke-width="2"/>
3939
<rect x="500" y="106" width="140" height="44" rx="7" fill="#fecaca" stroke="#ef4444" stroke-width="2"/>
4040
<rect x="500" y="166" width="140" height="44" rx="7" fill="#fecaca" stroke="#ef4444" stroke-width="2"/>
41+
<rect x="500" y="226" width="140" height="44" rx="7" fill="#fecaca" stroke="#ef4444" stroke-width="2"/>
4142
<g stroke="rgb(var(--site-ink, 27 25 22))" stroke-width="1.4" fill="none">
42-
<path d="M161 128 L258 128" marker-end="url(#sandboxes-arrow)"/>
43-
<path d="M421 128 L482 128" marker-end="url(#sandboxes-arrow)"/>
43+
<path d="M161 158 L258 158" marker-end="url(#sandboxes-arrow)"/>
44+
<path d="M421 158 L482 158" marker-end="url(#sandboxes-arrow)"/>
4445
</g>
45-
<text x="90" y="133" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">Agent Actor</text>
46-
<text x="340" y="125" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">Sandbox adapter</text>
47-
<text x="340" y="142" text-anchor="middle" font-size="12" fill="#56524a">SandboxProvider</text>
46+
<text x="90" y="163" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">Agent Actor</text>
47+
<text x="340" y="155" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">Sandbox adapter</text>
48+
<text x="340" y="172" text-anchor="middle" font-size="12" fill="#56524a">SandboxProvider</text>
4849
<text x="570" y="73" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">agentOS</text>
4950
<text x="570" y="133" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">E2B</text>
5051
<text x="570" y="193" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">Daytona</text>
51-
<text x="209.5" y="119" text-anchor="middle" font-size="12" fill="#56524a">tool calls</text>
52+
<text x="570" y="253" text-anchor="middle" font-size="14" font-weight="600" fill="#1b1916">Freestyle</text>
53+
<text x="209.5" y="149" text-anchor="middle" font-size="12" fill="#56524a">tool calls</text>
5254
</svg>
5355
</div>
5456

@@ -80,6 +82,7 @@ agentOS needs no provider account. To use E2B or Daytona instead, see
8082
| [agentOS](/agentos/docs) | None | Sleeps when idle, and keeps its files | Left in place |
8183
| <a href="https://e2b.dev" target="_blank" rel="noopener noreferrer">E2B</a> | `e2b` | Paused | Deleted |
8284
| <a href="https://daytona.io" target="_blank" rel="noopener noreferrer">Daytona</a> | `@daytonaio/sdk` | Stopped | Deleted |
85+
| <a href="https://freestyle.sh" target="_blank" rel="noopener noreferrer">Freestyle</a> | `freestyle` | Paused | Deleted |
8386

8487
Provider credentials stay on your worker and never enter the sandbox.
8588

@@ -129,6 +132,22 @@ npm add @rivet-dev/sandbox-adapter @daytonaio/sdk
129132

130133
The working directory is the sandbox's own working directory. A stopped sandbox is started again the next time the Actor uses it.
131134

135+
### Freestyle
136+
137+
```sh
138+
npm add @rivet-dev/sandbox-adapter freestyle
139+
```
140+
141+
<CodeSnippet file="examples/docs/sandboxes/freestyle.ts" title="server.ts" />
142+
143+
| Option | Description |
144+
| --- | --- |
145+
| `create` | Options for Freestyle's `vms.create`, or a function that receives the Actor context and returns them. Required, because `firewall` is required. |
146+
| `client` | A Freestyle client. Defaults to `new Freestyle()`, which reads `FREESTYLE_API_KEY`. |
147+
| `cwd` | Working directory inside the VM. Created when the Actor connects. Defaults to `/workspace`. |
148+
149+
A Freestyle VM has no network access until a `firewall` rule allows it. Commands run as `root` through Python 3, so the image must include it. Every `freestyle/ubuntu*` snapshot does.
150+
132151
## How the sandbox is managed
133152

134153
- The sandbox is created the first time the agent needs it.

‎vendor/agents/examples/docs/package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
"@rivet-dev/pi": "workspace:*",
1818
"@rivet-dev/sandbox-adapter": "workspace:*",
1919
"@rivet-dev/workflows": "1.0.0",
20-
"@rivetkit/react": "2.3.23",
20+
"@rivetkit/react": "2.3.26",
2121
"@slack/web-api": "^8.2.0",
2222
"discord-interactions": "^4.4.0",
2323
"e2b": "^2.51.0",
24+
"freestyle": "^0.2.16",
2425
"hono": "^4.13.12",
2526
"react": "^19.3.0",
26-
"rivetkit": "2.3.23"
27+
"rivetkit": "2.3.26"
2728
},
2829
"devDependencies": {
2930
"@types/node": "^24.0.0",
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { createRegistry } from "@earendil-works/pi-durable";
2+
import { CodingTools } from "@earendil-works/pi-durable/tools";
3+
import { pi } from "@rivet-dev/pi";
4+
import { freestyleProvider } from "@rivet-dev/sandbox-adapter/freestyle";
5+
import { setup } from "rivetkit";
6+
7+
// read, write, edit, and bash, running in the sandbox
8+
const extensions = createRegistry();
9+
extensions.install(CodingTools);
10+
11+
const agent = pi({
12+
model: "anthropic/claude-opus-5-5",
13+
registry: extensions,
14+
sandbox: freestyleProvider({
15+
create: {
16+
snapshotId: "freestyle/ubuntu-sm",
17+
// A VM has no network access until a rule allows it. This allows DNS and HTTPS out.
18+
firewall: {
19+
rules: [
20+
{ action: "allow", source: {}, destination: { public: true, port: 53, protocol: "udp" } },
21+
{ action: "allow", source: {}, destination: { public: true, port: 443, protocol: "tcp" } },
22+
],
23+
},
24+
},
25+
}),
26+
});
27+
28+
export const registry = setup({ use: { agent } });
29+
30+
registry.start();

0 commit comments

Comments
 (0)