execute_isolated_script
Run shell commands inside Docker containers with built-in dangerous-pattern validation and a configurable timeout to prevent runaway scripts.
Instructions
Run a shell command string inside a container via docker exec.
Validates container_id and blocks known-dangerous command patterns
before running anything. Enforces a hard timeout via asyncio so a
runaway command can never hang the server.
Args:
container_id: Container ID or name.
command: Shell command string to run (executed via `sh -c`).
timeout_seconds: Max seconds to wait before killing the command.
Returns:
dict with stdout, stderr, exit_code, timed_out.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| container_id | Yes | ||
| command | Yes | ||
| timeout_seconds | No |