An open-source, faster Devin alternative
TypeScript
api-edge: forward and return fixedIps; docs; CLI 0.7.21 (work 073)
Mohamed Habib via Computer57f416b99e7f
diff --git a/cli/package-lock.json b/cli/package-lock.jsonindex db053740..60e2eb8c 100644--- a/cli/package-lock.json+++ b/cli/package-lock.json@@ -1,12 +1,12 @@{"name": "@opencomputer/cli",- "version": "0.7.20",+ "version": "0.7.21","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@opencomputer/cli",- "version": "0.7.20",+ "version": "0.7.21","dependencies": {"@opencode-ai/sdk": "1.18.4","ai": "^7.0.45",diff --git a/cli/package.json b/cli/package.jsonindex e04a6851..b965b29b 100644--- a/cli/package.json+++ b/cli/package.json@@ -1,6 +1,6 @@{"name": "@opencomputer/cli",- "version": "0.7.20",+ "version": "0.7.21","description": "Build, test, deploy, and share OpenComputer agents as code.","type": "module","bin": {diff --git a/cloudflare-workers/api-edge/src/managed_agents.test.ts b/cloudflare-workers/api-edge/src/managed_agents.test.tsindex 71c6181d..3a1aa5ea 100644--- a/cloudflare-workers/api-edge/src/managed_agents.test.ts+++ b/cloudflare-workers/api-edge/src/managed_agents.test.ts@@ -3149,6 +3149,7 @@ describe("managed agents proxy", () => {createdAt: "2026-07-30T00:00:00.000Z",region: "au",egress: { domains: ["*.cypen.io"], cidrs: ["10.0.0.0/8"] },+ fixedIps: "au",artifact: { bucket: "private-bucket" },imageArn: "arn:aws:private",},@@ -3209,6 +3210,7 @@ describe("managed agents proxy", () => {],region: "au",egress: { domains: ["*.cypen.io"], cidrs: ["10.0.0.0/8"] },+ fixedIps: "au",source: {digest,size: source.length,@@ -3275,9 +3277,9 @@ describe("managed agents proxy", () => {});expect(JSON.parse(String((fetchSpy.mock.calls[2]?.[1] as RequestInit).body)),- ).toMatchObject({ region: "au", egress: { domains: ["*.cypen.io"], cidrs: ["10.0.0.0/8"] } });+ ).toMatchObject({ region: "au", egress: { domains: ["*.cypen.io"], cidrs: ["10.0.0.0/8"] }, fixedIps: "au" });const published = await response.json();- expect(published).toMatchObject({ region: "au", egress: { domains: ["*.cypen.io"], cidrs: ["10.0.0.0/8"] } });+ expect(published).toMatchObject({ region: "au", egress: { domains: ["*.cypen.io"], cidrs: ["10.0.0.0/8"] }, fixedIps: "au" });expect(JSON.stringify(published)).not.toMatch(/bucket|imageArn|arn:aws|uploads\.test/i,);diff --git a/cloudflare-workers/api-edge/src/managed_agents.ts b/cloudflare-workers/api-edge/src/managed_agents.tsindex 9fc6009e..f393231b 100644--- a/cloudflare-workers/api-edge/src/managed_agents.ts+++ b/cloudflare-workers/api-edge/src/managed_agents.ts@@ -319,7 +319,9 @@ async function publicErrorResponse(? 'The region in opencomputer.toml is not supported. Use a Modal region, such as "us", "eu-west" or "au".': backendCode === "invalid_egress"? 'The [egress] allow list in opencomputer.toml is invalid. Use domains ("api.github.com", "*.example.com"), IP addresses or CIDRs, at most 64 of each.'- : "The agent request was invalid.";+ : backendCode === "invalid_fixed_ips"+ ? 'The [egress] fixed_ips region in opencomputer.toml is not supported. https://managedagents.opencomputer.dev/v1/egress-ips lists the regions, such as "au".'+ : "The agent request was invalid.";} else if (upstream.status === 401 || upstream.status === 403) {message = "The agent request was not authorized.";} else if (upstream.status === 404) {@@ -352,6 +354,8 @@ async function publicErrorResponse(message ="Slack could not verify that conversation. Check its ID and app membership.";}+ } else if (backendCode === "fixed_ips_unsupported") {+ message = "This deployment's fixed IPs need a Modal sandbox.";} else {message = "The agent request conflicts with the current state.";}@@ -363,7 +367,10 @@ async function publicErrorResponse(? FREE_CREDITS_PAYWALL: "The agent request requires additional prepaid credits.";} else if (upstream.status >= 500) {- message = "The agent service is temporarily unavailable.";+ message =+ backendCode === "fixed_ips_unavailable"+ ? "Fixed IPs are not available in this region right now. Try again shortly."+ : "The agent service is temporarily unavailable.";}const headers = new Headers({ "content-type": "application/json" });const retryAfter = upstream.headers.get("retry-after");@@ -586,6 +593,7 @@ function publicDeployment(value: unknown): Record<string, unknown> {createdAt: deployment.createdAt,...(typeof deployment.region === "string" ? { region: deployment.region } : {}),...(publicEgress(deployment.egress) ? { egress: publicEgress(deployment.egress)! } : {}),+ ...(typeof deployment.fixedIps === "string" ? { fixedIps: deployment.fixedIps } : {}),...(Array.isArray(deployment.models)? {models: deployment.models.flatMap((value) => {@@ -2668,6 +2676,8 @@ async function deploySourceAgent(...(body.region !== undefined ? { region: body.region } : {}),// Validated by the service, which answers 400 invalid_egress (work 057)....(body.egress !== undefined ? { egress: body.egress } : {}),+ // Validated by the service, which answers 400 invalid_fixed_ips (work 073).+ ...(body.fixedIps !== undefined ? { fixedIps: body.fixedIps } : {}),...(body.projectDeployment && typeof body.projectDeployment === "object"? { projectDeployment: body.projectDeployment }: {}),diff --git a/docs/agents/deployments.mdx b/docs/agents/deployments.mdxindex e570ba4a..3cd4514a 100644--- a/docs/agents/deployments.mdx+++ b/docs/agents/deployments.mdx@@ -53,6 +53,10 @@ only the hosts it needs, add an `[egress]` table with an `allow` list to theagent's `opencomputer.toml` and deploy again. See[Outbound network](/agents/egress) for what each entry allows and the rules.+To have its traffic leave from fixed IP addresses that others can allowlist,+set `fixed_ips` in the same table. See+[Fixed IP addresses](/agents/egress#fixed-ip-addresses).+## Select an agent and environmentClients identify an agent with `agent-id@alias`:diff --git a/docs/agents/egress.mdx b/docs/agents/egress.mdxindex cdc53406..a44ad980 100644--- a/docs/agents/egress.mdx+++ b/docs/agents/egress.mdx@@ -69,6 +69,39 @@ The API rejects it too, with `400 invalid_egress`, if you call`"egress": { "domains": [...], "cidrs": [...] }`; the CLI splits `allow` intothese two lists for you.+## Fixed IP addresses++To have the sandbox's traffic leave from a fixed set of IP addresses, for+example so a customer can allowlist your agent, set `fixed_ips` to a region:++```toml+[egress]+fixed_ips = "au"+```++All of the sandbox's outbound traffic then leaves from that region's+addresses. A region can have more than one; successive tool calls take turns+between them, so allowlist every address the region lists. The regions and+their addresses are public:++```bash+curl https://managedagents.opencomputer.dev/v1/egress-ips+```++```json+{ "regions": { "au": { "ipv4": ["209.71.97.179", "209.71.110.167"] }, ... } }+```++- `fixed_ips` works with or without `allow`. With both, the sandbox reaches+ only the allowed hosts, and reaches them from the fixed addresses.+- If the region's addresses are unreachable, the sandbox has no network rather+ than falling back to other addresses.+- The region of `fixed_ips` is independent of the agent's `region`; pick the+ same one to keep latency down.++An unknown region stops the deploy, and the API answers `400 invalid_fixed_ips`+to `"fixedIps": "<region>"` on `POST /v1/deployments`.+## Changing the listA change applies to sandboxes started after the deploy. A sandbox that is