Interactive commands on Google Cloud sandboxes
Google Cloud sandboxes now run interactive commands, as AWS, Azure, Kubernetes, and Local sandboxes already did. Your app writes to a command's stdin, signals it, and reads its output as the program writes it:
const proc = await box.runInteractive(sandboxId, "python3", { args: ["-i"], timeoutMs: 600_000 })
await proc.write("print(6 * 7)\n")
await proc.closeStdin()
for await (const frame of proc) {
if (frame.kind === "stdout") process.stdout.write(frame.data)
}Google Cloud's own command API answers one request with no input within about 30 seconds. Interactive commands instead reach the Alien agent in the sandbox through Google's sandbox ingress, with a signed credential the binding renews before it ends, so a command can run for as long as its timeoutMs.
- Direct setup: every sandbox gets interactive commands
- Terraform setup: only a Sandbox that declares preview ports. Without one,
capabilities()doesn't reportinteractiveCommandsandrunInteractiveraises an error that names the fix. - Permissions: the calling profile needs
sandbox/execute
Interactive commands on Google Cloud need the Alien CLI and SDK 3.3.78 or later.