Skip to main content

Interface: SandboxConfig

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:32

Configuration for the sandbox environment.

Properties​

allowedPaths?​

optional allowedPaths: string[]

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:48

Allowed filesystem paths (if allowFilesystem is true)


allowFilesystem?​

optional allowFilesystem: boolean

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:46

Whether to allow filesystem access


allowNetwork?​

optional allowNetwork: boolean

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:44

Whether to allow network access


blockedModules?​

optional blockedModules: string[]

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:50

Blocked imports/modules


envVars?​

optional envVars: Record<string, string>

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:40

Environment variables to inject


extraGlobals?​

optional extraGlobals: Record<string, unknown>

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:67

Extra global bindings to inject into the sandbox context alongside the minimal defaults. Use this when a higher-level wrapper (such as SandboxedToolForge) needs to expose allowlisted APIs (fetch, fs, crypto) without forking a second sandbox implementation.

Security-critical keys are silently dropped from this map at merge time so callers cannot accidentally undo the sandbox's minimal defaults:

  • Host-state escape: process, global, globalThis, require
  • Code-generation reflection: eval, Function
  • Realm-reflection / introspection: Reflect, Proxy
  • Memory side-channels (Spectre family): SharedArrayBuffer, Atomics
  • Native compilation surface: WebAssembly

maxCpuTimeMs?​

optional maxCpuTimeMs: number

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:52

Maximum CPU time in milliseconds


maxMemoryBytes?​

optional maxMemoryBytes: number

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:36

Maximum memory in bytes


maxOutputBytes?​

optional maxOutputBytes: number

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:38

Maximum output size in bytes


timeoutMs?​

optional timeoutMs: number

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:34

Maximum execution time in milliseconds


workingDir?​

optional workingDir: string

Defined in: packages/agentos/src/safety/sandbox/executor/ICodeSandbox.ts:42

Working directory for execution