ProgramSandboxMode
Enums ยท AiDotNet.Enums
Selects where a candidate program is executed when a program-evolution run scores it.
For Beginners
When evolution writes a program, something has to run it to find out whether it works โ and that program may do anything at all, because a language model wrote it. This setting says where it runs. The default starts a separate, tightly limited process, which is the option you want: if the generated code hangs, allocates endlessly, or crashes, only that child process is affected. The serving option hands the job to a container-backed service instead. The last option is a warning label, not a feature.
How It Works
Generated program text is untrusted input, so the choice of execution boundary is a security decision rather
than a performance one. This enumeration names the three boundaries AiDotNet supports and deliberately makes the
safe one the default: OutOfProcessWorker launches an isolated child process with a wall-clock
timeout, byte caps on captured output, a scrubbed environment, and an operating-system memory cap, and it never
loads candidate code into the hosting application.
InProcessUnsafe exists only so that a caller who genuinely wants it must say so twice: selecting it
is rejected by Validate unless
AllowUnsafeInProcessExecution is also set to
true. No engine shipped in this library implements that mode; it is a marker for hosts that supply their
own in-process runner and have accepted the consequences.
Fields
| Field | Summary |
|---|---|
ProgramSandboxMode InProcessUnsafe |
Runs candidate code inside the hosting process, with no isolation whatsoever. |
ProgramSandboxMode OutOfProcessWorker |
Runs each candidate in an isolated child process with time, memory, output, and environment limits. |
ProgramSandboxMode Serving |
Delegates execution to an AiDotNet.Serving instance, which sandboxes the program in a container. |
int value__ |