Why does an agent workspace need a lifecycle?

Why does an agent workspace need a lifecycle?

Why isn’t it enough to give an agent a place to work? An employee may close a laptop halfway through a report and expect to find the files tomorrow. An organisation cannot keep every container running indefinitely, either. The question is not simply whether a workspace exists. It is who may pause it, whether its documents survive, what happens to its credentials, and when an administrator can finally remove it.

Consider an unfinished supplier comparison. Stopping the process should not discard the spreadsheet. But if its owner changes roles, old agent credentials should not remain useful merely because the files are still there. A manager may need to remove the workspace without instantly destroying accidentally deleted work. This illustrative workflow shows why lifecycle is an organisational decision.

Disconnect and suspension are different events

Accepted ADR-0018 in agentic-organization defines a server workspace per person and explicit states for creating, running, suspended, failed and deleted. The design distinguishes losing a connection from suspending the container. A disconnection should leave the agent session running; suspension stops the container while preserving its home volume. Resuming starts a fresh session rather than resurrecting a running process. Files surviving is not the same promise as a conversation or a process resuming at the exact instruction where it stopped.

The ADR specifies a short-lived, single-use attach ticket and a WebSocket connection for returning to a terminal session. These remain open implementation work. It would be misleading to describe seamless reattachment as an existing production capability merely because the lifecycle and file endpoints exist. A designed connection protocol and a working create or suspend API answer different questions. When evaluating a deployment, test each separately.

The current backend/api/workspaces.py has distinct endpoints for creation, suspension, resumption, deletion and restoration. Creation returns an existing live workspace for the same person rather than making another. The owner can see and suspend their workspace. Managers can list, suspend and delete within their scope. Restoring a deleted workspace is reserved for a manager, while resuming a suspended one is reserved for the owner. Managers cannot read the owner’s files solely by virtue of their management role. This distinction matters in finance and HR: administering computing resources must not automatically grant access to the documents inside them.

The API calls its audit logger for lifecycle actions. That does not prove that every installation has complete audit history. Check permissions and records on the running system before relying on them; a handbook does not establish what an endpoint enforces.

Why isolate the component that starts containers?

One seemingly simple alternative is to give the main API direct access to the container runtime. ADR-0018 rejects it because an API compromise could then become access to the host’s powerful container interface. The selected design puts a WorkspaceRuntime abstraction between the API and a separate workspace-controller. The repository includes an in-memory FakeRuntime for tests and a ControllerRuntime client for the separate service. If no runtime is configured, the API fails rather than quietly pretending that a workspace was created. A working component in a repository does not mean that every deployment has enabled it.

The controller derives container and volume names from validated workspace identifiers. It does not accept an arbitrary image name or a free-form host path from a user request. Its documented boundaries include internal networks per workspace, an allowlist for environment values and a helper container for file operations. These are specific places where rules are applied, not a general guarantee of safety. The controller’s README explicitly leaves disk quotas, a policy that inspects Docker create requests and network exposure to deployment operators. An isolated network cannot prevent a workspace volume from filling a disk.

This separation adds a service to operate. A runtime call can succeed yet fail before the database records the state. ADR-0024 leaves reconciliation open: there are no operation identifiers or job comparing database state with containers. Locks work within a single controller process, so run one process. An application’s status label cannot prove the container matches it.

Deleting is a retention decision

Suspension preserves the volume. Deletion removes the container but retains the volume for seven days so a manager can restore it. After that window, a purge job removes the retained volume. Immediate deletion would make an accidental click irreversible; unlimited retention would accumulate sensitive company material and storage costs. Seven days is the choice implemented in this product, not a universal legal retention period. A company still has to decide how its own document and privacy obligations apply.

Idle suspension also exists in code but is optional. backend/services/workspaces.py uses last file activity to identify idle workspaces. It explicitly warns that it does not yet know whether an agent turn or a scheduled flow is running. A long-running finance report or production analysis can therefore be mistaken for inactivity if the feature is enabled without additional safeguards. ADR-0018 calls for turn-aware suspension; that safeguard is still open. Describing the current idle timer as safe for every workload would conceal a consequential limitation.

Different teams experience the same lifecycle differently. Production may have a task crossing a shift change. Procurement needs a draft comparison available the next morning. Finance cares whether a month-end file is preserved after an account is closed. HR has to separate who may manage a workspace from who may inspect its contents. IT must account for idle capacity, disk use and orphaned runtime state. These examples do not imply that those departments are already using this particular deployment; they are questions each would need to answer before adopting one.

A practical review starts with observable cases. Ask the same user to create twice and confirm that only one live workspace is returned. Suspend and resume, then verify which files remain and whether a fresh credential is issued. Check whether a manager can restore within the retention window without gaining file-read access. Try to understand what the idle timer measures during a running job. Finally, compare the database record with the actual container after an interrupted operation. The latter is precisely where today’s reconciliation gap matters. The answer may be to disable optional idle suspension until run awareness exists, and to add operational checks outside the application.

A workspace is not just a container with an agent inside it. It is an agreement about a person’s files, permissions and time. ADR-0018 and ADR-0024 in agentic-organization make that agreement visible alongside the implementation gaps. For any organisation considering agents at work, the useful first question may not be how quickly a workspace starts, but who can stop it and what survives when they do.

Verification note: This article was checked against ADR-0018, ADR-0024, backend/api/workspaces.py, backend/services/workspaces.py, backend/services/workspace_runtime.py and workspace-controller/README.md in the agentic-organization repository. Attach, reconciliation and disk quotas are not presented as completed features.