Hypothetical scenario. Northwind has placed policy checks before data exposure and actions. Its analyst now proposes a program to summarize an approved spreadsheet, but the program also attempts an outbound request. Maya needs the summary; Dev considers an isolated runtime, while Priya asks which capabilities it would receive.
Maya: “The task needs this spreadsheet and a result artifact. Why would it need a network connection?”
Dev: “A runtime boundary can constrain execution, but its granted interfaces still matter.”
Priya: “Start with the minimum capabilities, then compare how each candidate enforces them.”
You will compare gVisor, WebAssembly and Firecracker through their host boundaries, supported interfaces and resource limits. Keep credentials and network policy outside model control, and separate execution termination from acceptance of the resulting artifact.
What should the generated program be able to reach?
gVisor interposes a userspace kernel boundary for application system calls. WebAssembly executes modules within a host-defined sandbox whose exposed APIs determine available capabilities. Firecracker uses lightweight virtual machines and a virtual-machine monitor. These boundaries differ in compatibility and isolation mechanisms; none makes intentionally supplied credentials safe to misuse.
Hypothetical scenario. The analyst may read one immutable input, write one temporary output and consume a chosen five-second execution budget. Network access and production database credentials are absent from the sandbox. A timeout discards uncommitted output and records failure. Compare the candidate runtimes against those required capabilities and actual escape/egress tests; do not rank them from a diagram or assume a prompt can substitute for the host policy.
The report generator asks for more than the task needs
Northwind's assistant proposes a small program to summarize a supplier spreadsheet. The task needs one approved input file and a bounded output artifact. The generated program also attempts a network request and reads a directory that contains unrelated documents. Sam needs a policy that works even when the program does not follow its prompt.
Begin with the intended interaction boundary: which input is visible, what output may be produced, which external communication is allowed and how much resource consumption the task can use. The generated code is an untrusted participant inside that boundary. Its confidence or apparent simplicity does not eliminate the need to constrain its execution.
Give generated code a bounded capability manifest
Hypothetical scenario. A generated report program receives one immutable input, a bounded workspace and permission to return an output artifact. It does not inherit host credentials, unrestricted network access or arbitrary filesystem mounts.
| Artifact | Concrete evidence | Decision boundary |
|---|---|---|
| Capability manifest | input refs, mounts, egress, credentials | Explicit reach |
| Runtime policy | selected isolation, resource bounds | Enforcement |
| Result | input digest, attempt, output evidence | Conditional acceptance |
gVisor, WebAssembly and Firecracker supply different isolation mechanisms and compatibility assumptions. Choose the actual runtime and configuration rather than treating their names as interchangeable guarantees. Bound CPU, memory, wall time, process count, output and egress at enforceable boundaries. A code review or model refusal does not replace isolation. Accept the result only for the intended input and current attempt; successful execution alone does not establish that its analysis is correct.
Why a request to behave is not isolation
A prompt can describe the intended task, but it cannot enforce filesystem permissions or stop a process from making an allowed system call. A generated program may contain a mistake, an unnecessary dependency or behavior influenced by untrusted input. The execution environment needs controls that remain effective without cooperation from that program.
Distinguish three layers: the model proposes code, an application admits a task with an explicit capability set, and an execution boundary constrains the program's interaction with the host. A validator can reject some dangerous proposals before execution, but it should not become the sole boundary for arbitrary code. Inspection and runtime controls address different failure modes.
What gVisor contributes
The gVisor documentation describes an application kernel that mediates interactions between sandboxed applications and the host. This is a concrete isolation approach rather than a prompt-level restriction. Its value and compatibility must be considered with the workload and the rest of the runtime configuration.
Northwind can use such an isolation boundary as one component of an execution service. The service should expose only the selected input and an output location, provide the permissions actually required and enforce limits through the appropriate host or orchestration controls. Giving the sandbox unrestricted credentials or broad network access would grant powers that its isolation mechanism does not need to revoke automatically.
The boundary should be described in terms of capabilities, not a single secure flag. Reading an approved file, writing a temporary artifact and contacting a named endpoint are different capabilities. An application can deny unnecessary ones while providing a supported route for tasks that legitimately need more access.
Draw both the sandbox and its granted access
The boundary in one view
The execution boundary encloses untrusted code. A controlled input path and a bounded output path cross it. A credential or network connection would be another crossing, requiring an explicit purpose and policy. The diagram is a proposed Northwind deployment boundary, not a claim that one default runtime setting implements every control shown.
Budget concurrent execution with visible units
Hypothetical scenario. Suppose an execution pool has a chosen 8 GiB memory allowance for task processes after separately reserving host capacity. Each admitted task is limited to 512 MiB of that allowance. Convert 8 GiB to 8 × 1,024 = 8,192 MiB. The memory-based upper bound is 8,192 / 512 = 16 simultaneous task allocations.
That is not automatically a safe concurrency setting. Assume a separate CPU policy permits eight active execution slots. The admission bound is min(16, 8) = 8 tasks under those two selected constraints. Filesystem, network and runtime overhead can impose additional limits that this toy calculation does not include.
Now choose a 20-second wall-clock allowance per admitted task. If all eight slots run for the full allowance, they account for 8 × 20 = 160 slot-seconds of occupied execution capacity during that interval. Slot-seconds describe reserved concurrency time, not actual CPU seconds. A task waiting on input can occupy a slot while consuming relatively little CPU.
If 24 tasks arrive together and each uses its full 20 seconds, a fixed eight-slot schedule needs 24 / 8 = 3 waves. The last wave completes after 3 × 20 = 60 seconds under the chosen assumptions. A 30-second end-to-end deadline cannot be promised for every task in that burst merely because each individual execution has a 20-second limit.
Minimize what the program can observe
Give the task the approved spreadsheet rather than a directory of all supplier files. Use a task-specific working area whose contents and permissions are understood. If a library needs temporary storage, include that requirement explicitly and remove the artifacts according to the retention policy after the task is terminal.
Separate a file's eligibility from its filename. A user-controlled path can refer to a different object than the application intended, especially when symbolic links, mounted directories or reused workspaces are involved. The execution service should establish the actual input object and its permitted scope before handing it to untrusted code.
Consider output as untrusted data too. A generated report can contain unsupported claims, confidential values or executable content in a format another tool opens. Validate the result contract and the intended consumer before returning an artifact. Successful process termination establishes an execution outcome, not the truth of the summary.
A secret inside the sandbox is still a secret it can use
Isolation does not make a broad credential harmless. Code that receives a token can attempt operations within that token's authority. Prefer a constrained service operation or a narrowly scoped, short-lived capability when the task truly needs remote access. Keep authorization checks at the service handling the effect.
Network policy should cover the actual paths data can leave through, including name resolution and permitted intermediaries. An allowlisted destination can still accept sensitive content if the application sends it. The control therefore needs both an intended communication purpose and a review of what data is permitted on that path.
Logs can become another disclosure channel. Record enough execution evidence to explain termination and resource use without indiscriminately copying secrets, full datasets or generated source into broadly accessible telemetry. Apply the relevant retention and access policy to those records.
In the wild: a documented isolation mechanism
gVisor's official documentation presents an application-kernel approach to sandboxed execution. It is a real mechanism for examining the boundary between a workload and its host. The reference does not imply that a particular Northwind configuration is secure, compatible with every dependency or free of vulnerabilities.
The supplier spreadsheet scenario is hypothetical. Use it to separate the runtime's isolation responsibility from the application's decisions about admitted data, credentials, egress and published output. A security review needs those surrounding decisions as well as the chosen runtime.
Termination, cleanup and artifact acceptance are separate
A task can time out after writing a partial artifact. Define whether partial output is discarded, retained for investigation or eligible for a clearly labeled partial response. The caller should not receive a normal-looking final report just because a file exists in the output directory.
Cleanup should follow task ownership and resource identity. Reusing a workspace too early can expose one task's files to another. Retaining everything indefinitely can accumulate sensitive data and storage cost. A terminal execution record should identify which artifacts were accepted and which temporary resources were released.
When execution is interrupted, inspect external effects separately. A sandboxed program can submit a request to an allowed external service before being terminated. Stopping its process does not establish that the request failed. Preserve the action identity and reconcile the remote outcome under the same rules used elsewhere in the agent workflow.
Choose constrained operations before arbitrary execution
A known spreadsheet aggregation may be better served by a narrow application operation than by arbitrary generated code. A general execution tool is useful when task variation justifies it and the environment can provide an adequate boundary. The decision should account for operational complexity, compatibility and the consequences of failures.
Evaluate with both useful tasks and deliberate boundary probes. Check filesystem scope, credential exposure, network policy, resource exhaustion, partial output and workspace reuse. A successful demonstration on one benign program does not test those controls. Keep the evaluation tied to the actual deployment configuration.
Three assurances isolation cannot provide alone
The code exited successfully, so its calculation is correct. Validate the output against task-specific checks and supported evidence.
The runtime prevents every data leak. Data can leave through capabilities deliberately granted to the workload, including network access and output artifacts.
Killing execution cancels every remote request. A remote effect can outlive the process that initiated it. Reconcile it instead of inferring absence.
Validate a generated calculation against a known small case
Before accepting a spreadsheet summarizer, create a small task with values whose result can be calculated independently. Check that the output identifies its input revision and that a missing or malformed column produces a clear failure rather than a plausible invented total. This tests task meaning in addition to execution success.
Then vary the environment boundary. An unrelated input file should remain unavailable, an unapproved network request should fail according to policy, and the task should stop at its selected resource limits. Record which boundary rejected each operation so that a failure is not misdiagnosed as a model-quality problem.
A useful evaluation also checks cleanup and the next task. Start a second task in the intended isolation model and verify that it cannot observe the first task's temporary material. The absence of an escape in one benign run says little about accidental reuse of a shared working directory.
The goal is a combined contract: constrained execution, understandable failure and accepted output whose calculation has independent support. None of these three substitutes for the others.
What this execution boundary does not certify
The resource arithmetic assumes fixed allocations, a selected slot policy and equal-duration waves. Real overhead and workload behavior vary. Sandbox mechanisms have compatibility constraints and residual attack surfaces, while host controls must enforce the intended limits. This chapter is an architectural explanation, not a security certification. Verify the deployed runtime, mounts, credentials, egress, cleanup and output-consumer behavior before admitting sensitive workloads.
Test the capability manifest boundary
The code cannot reach the network but can read a host credential mount. Is it isolated sufficiently?
Reveal the design reasoning
Not for a task that forbids that disclosure. Review actual mounts, credentials and output paths, then test observable access denial. Network restriction is only one boundary.
Decision: Choose runtime isolation from required consequences and test its actual configuration.
Inspect the admitted capability set
Why is the example limited to eight simultaneous tasks rather than sixteen?
Memory permits sixteen chosen allocations, but the separate CPU slot policy permits eight. Admission must satisfy both limits. Additional constraints can lower the bound further; a memory division alone does not establish a complete capacity plan.
A timed-out program leaves a report file. May the assistant present it as final?
Only if an explicit partial-output contract and validation establish that it is acceptable. File existence is not completion evidence. Record the timeout and inspect the artifact's integrity and task meaning before returning it.
Does an approved network destination make broad credentials safe inside generated code?
No. The destination can still receive sensitive input or accept consequential operations within the credential's scope. Limit both the capability and the data it may carry, and enforce action authorization at the receiving service.
Northwind decision log
- Admit only the input, capabilities and resource budget needed for the task.
- Validate output meaning independently from successful process execution.
- Clean up task-owned artifacts and reconcile remote effects after termination.
Go deeper: supporting mechanisms
- Video lecture: Accelerating AI Securely with GVisor - Lucas Manning, Google, CNCF [Cloud Native Computing Foundation]. Examine isolation boundaries and the communication paths that cross them.
- Book chapter: Security Engineering, third edition, chapter 10: Boundaries, Ross Anderson. Examine isolation boundaries and the communication paths that cross them.
- Book chapter: Security Engineering, third edition, chapter 21: Network Attack and Defence, Ross Anderson. Examine isolation boundaries and the communication paths that cross them.
- Primary document: Sandboxed agent code boundaries reference. Review the isolation approach and residual deployment responsibilities.
Related: Agentic systems · Retries and tool outcomes.
Check the mechanism in this lesson
Is a sandbox safe for a task if it has production credentials and unrestricted egress but uses a strong runtime boundary?
Compare the explanation
The intended capabilities are already excessive. An isolated process can misuse legitimately supplied credentials. Remove unnecessary authority and network paths, then test the remaining host boundary.
Carry the decision forward
Northwind can define what a generated program may observe and do. Page 42 follows a permitted run across retrieval, model calls, tools and child tasks, preserving enough identity and timing to locate a failure.