Skip to content

Proposal: Optional BoxLite sandbox backend (experimental) #296

@DorianZheng

Description

@DorianZheng

Summary

Could we add BoxLite as an optional sandbox backend?

This is not a replacement request. Existing runtime defaults can stay as-is.

Why

  • Extra isolation option (micro-VM based).
  • Good fit for projects that already have runtime abstraction.
  • Opt-in only, so no disruption for existing users.

Tiny example (Node.js)

import { SimpleBox } from '@boxlite-ai/boxlite';

async function run(i: number) {
  const box = new SimpleBox({ image: 'alpine:latest', autoRemove: true });
  try {
    await box.exec('sh', '-lc', 'echo ok');
    const m = await box.metrics();
    console.log(`[box ${i}] totalCreateDurationMs=${m.totalCreateDurationMs}`);
  } finally {
    await box.stop();
  }
}

async function main() {
  await Promise.all([1, 2, 3].map(run));
}
main();

Warm startup is typically under 200ms.
Cold starts can be higher depending on image/cache state.

Suggested scope

  1. Add optional boxlite backend.
  2. Keep current runtime behavior unchanged unless explicitly selected.
  3. Validate parity for mounts, timeout, and cleanup lifecycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions