Skip to content
Français

createDaytonaSandboxProvider

import { createDaytonaSandboxProvider } from "@elie-laloum/outpost/providers/daytona";

Create a remote provider on Daytona; the optional @daytona/sdk loads on acquire. Each acquire creates a sandbox and confirms any egress policy before preparing the workspace. Release, or a failed setup, deletes the sandbox.

Complete example and detailed rules.

  • optionsOptional
    DaytonaOptions | undefined
    Daytona client connection, sandbox creation, egress, workspace root, environment and output retention settings.
  • options.egressOptional
    EgressPolicy | undefined
    Portable policy enforced by Daytona: deny-all, up to 100 domains or up to 10 IPv4 allowCidrs, not both, and no denyCidrs. Outpost confirms it before preparing the workspace; a refusal fails with code provider and deletes the sandbox (it needs a Tier 3 or 4 account with WRITE_SANDBOXES).
  • options.connectionOptional
    DaytonaConfig | undefined
    Settings passed to the Daytona client constructor, such as the API key and URL.
  • options.createOptional
    CreateSandboxFromImageParams | CreateSandboxFromSnapshotParams | undefined
    Creation parameters passed to the SDK, from an image or a snapshot. Its network fields conflict with egress and otherwise keep Daytona’s semantics without Outpost confirmation; code the image starts on its own can run before acquisition completes.
  • options.variablesOptional
    Readonly<Record<string, string>> | undefined
    Environment variables set for every command in the sandbox, as literal values. A key the agent also declares fails with code configuration.
  • options.rootOptional
    string | undefined
    Repository directory inside the sandbox, default <home>/outpost.
  • options.retainOptional
    number | undefined
    Bytes of output tail kept per stream, default 65536.
  • connectOptional
    ((config?: DaytonaConfig) => Promise<Pick<Daytona, "create" | "delete">>) | undefined
    Returns the client whose create() and delete() manage sandboxes, default new Daytona(connection) from @daytona/sdk.

SandboxProvider

import type { Daytona, DaytonaConfig } from "@daytona/sdk";

export declare function createDaytonaSandboxProvider(
  options?: DaytonaOptions,
  connect?: (
    config?: DaytonaConfig,
  ) => Promise<Pick<Daytona, "create" | "delete">>,
): SandboxProvider;