Skip to main content
A line an agent writes can loop forever, start processes without end, or grow a variable until memory runs out. In Mirage it runs beside other agents’ sessions, in one process or one isolate, so each of these would cost them too. Every limit below is on by default, and each stops its case the way bash and Linux would, with the same exit status. Three layers set them:
  • The host (the server, or an edge app) sets ceilings. A workspace may set a lower value, never a higher one, and one that lifts a limit with null gets the ceiling instead.
  • The workspace sets each limit for every session it holds.
  • A profile overrides processes and command_limits for its sessions, field by field over the workspace’s. It may raise a workspace’s value as well as lower it; only a host ceiling holds it.

What each limit stops

max_env counts the bytes of a session’s variables, functions, aliases and positional parameters, one more for each array element and parameter, and a session that would start past it, from the workspace’s env, a profile’s or a snapshot, is refused. processes.max counts every pipeline stage, subshell and background job a session has running. timeout stops the jobs its command started when the time runs out, as GNU’s does by signalling its process group, unless it is given --foreground or -s INT. As in Bash, a background job that is one program ignores INT, one that runs several commands loses only the command, subshell or pipeline it is running and goes on, and one that runs a function ends with it. Some bounds are fixed:
  • A session id, profile name or workspace id is 1 to 128 characters, with no control characters.
  • A history read returns the newest 10,000 entries, and /.bash_history the newest 10,000 commands. A workspace that keeps its history in memory holds at most 8 MB of it, and drops the oldest entries first.
  • A line sends at most 1000 vfs.<call> spans to OpenTelemetry, or as many as MIRAGE_TRACE_MAX_SPANS says.

Set them on a workspace

Here a batch session runs 512 processes and 15-minute lines, and every other session 64 processes and 2-minute lines. See configuration, profiles and output limits.

Set the host’s ceilings

A tenant controls its own workspace’s config and profiles, so a host that runs other people’s agents holds them under ceilings. Each comes from the app’s option, else its environment variable, else its key in ~/.mirage/config.toml:
The ceilings hold whatever sets the value: a create request, a profile replaced over HTTP, or a snapshot loaded later. The Python and TypeScript servers and the Cloudflare app take the same settings as options.