# Shell limits and errors

## Limits

- After `maxShellCalls` is used up, `exec()` returns a `policy_denied` observation. It does not throw.
- `startProcess()` throws when the driver has no background processes or `maxProcesses` is reached.
- A closed session returns `policy_denied` for `exec()` and throws for `startProcess()`.
- The Just Bash `commands` allowlist also applies to controlled `curl`. A network grant does not turn on `curl` when the list leaves it out. An empty list turns it off.
- Controlled `curl` runs wherever Bash runs a command: in a pipeline, after `&&`, or in `$(...)`. Each call is checked against the visible Source Request descriptors. One denied call marks the whole observation `policy_denied`.
- Just Bash copies the command list when you create it. Later changes to your list do not change its permissions or network access.

## Production checks

Set command, filesystem, network, process, streaming, and timeout access before you run commands. A Shell Network Grant allows only the network access it names.

Use a read-only Workspace filesystem unless the caller must write. Set `maxOutputLength` and `timeout` on every runtime that handles untrusted input.

> [!WARNING]
> Just Bash buffers the full command or Source response, then truncates it. So `maxOutputLength` does not limit memory. Its output boundary reports `unsupported` for limits before buffering.

Use an `AbortSignal` tied to the request or Agent Invocation that owns the command. Drivers must pass it to their own work. The Just Bash `curl` path passes it to the Source Request executor and keeps the caller's abort reason.

<!-- vitehub-docs:section-links -->
## In this section

- [Overview](https://vitehub.dev/raw/docs/shell.md)
- [Get started](https://vitehub.dev/raw/docs/shell/get-started.md)
- [Configure](https://vitehub.dev/raw/docs/shell/configure.md)
- [Server API](https://vitehub.dev/raw/docs/shell/server-api.md)
- [Limits and errors](https://vitehub.dev/raw/docs/shell/limits-and-errors.md) (this page)

Next: [SHELL_R0010](https://vitehub.dev/raw/docs/shell/diagnostics/shell_r0010.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
