# letta-code · Confinement

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [letta-code](https://ai-agents-review.com/runtime/letta-code.md)
- Column: [Confinement](https://ai-agents-review.com/column/confinement.md) (Execution controls)
- Mark: 2 s
- Default deployment: 2
- Best supported configuration: 2
- Page: https://ai-agents-review.com/cell/letta-code/confinement

## Rationale

OS sandbox default-on only for memory subagents; main shell unconfined under unrestricted mode; network never isolated

## Rubric criteria for this column

- 0: No restriction: tools run as the user with no approval or policy by default
- 1: Policy or approval layer only (allowlists, approval prompts, reviewer model). No OS boundary
- 2: An OS/container boundary exists but is opt-in, **or** is default-on only for a subset of effect paths, leaving the main shell/file tools unconfined
- 3: Default-on OS-enforced boundary for the main shell and file effects (filesystem writes restricted)
- 4: Level 3, plus network restricted by default **and** children and auxiliary processes (MCP stdio, hooks, cron) confined at least as tightly

## Review finding

Default permission mode `unrestricted` allows every tool once deny/`alwaysAsk` rules and a cross-agent memory guard have run. The main shell has no OS sandbox unless `LETTA_FS_SANDBOX=1` (which only shields other agents' memory) or an app-server `workspace_sandbox` (fails closed). Memory subagents get bwrap/Seatbelt by default but launch unconfined if no backend exists. Network is never isolated. [X49][X50][X51][X52][X53][X54][X55]

## Evidence cited by the mark

- [X49] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/permissions/mode.ts#L7 — DEFAULT_PERMISSION_MODE = unrestricted — [S]
- [X52] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/sandbox/availability.ts#L42-L54 — memory-subagent sandbox on by default; main-shell cross-agent sandbox only with LETTA_FS_SANDBOX=1 — [S]
- [X54] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/agent/subagents/sandbox.ts#L64-L70 — no backend: warn and launch memory subagent unconfined — [S]

## Evidence also cited by the review finding

- [X50] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/permissions/mode.ts#L70-L76 — unrestricted mode returns allow — [S]
- [X51] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/permissions/checker.ts#L210-L420 — checker order: sandbox guard, cross-agent guard, deny, alwaysAsk, mode, allow — [S]
- [X53] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/sandbox/bwrap.ts#L5-L33 — bwrap args: bind/ro-bind root, tmpfs denies, no --unshare-net — [S]
- [X55] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/tools/impl/shell-sandbox.ts#L24-L61 — workspace sandbox only when app-server supplies workspaceSandbox; throws without backend — [S]

## Grading record

- Grader A (default / best): 2 / 2
- Grader B (default / best): 2 / 2
