A long-running Agent keeps losing context, while persistent workspaces accumulate credentials, caches, and unreviewed changes.

**Fastest fix:** keep a controlled persistent baseline for approved read-only work and stable macOS tooling, but send high-privilege writes, unknown inputs, parallel experiments, and external content into disposable task workspaces.

If your OpenAI Research Acceleration Agent workspace is growing beyond one experiment, use a dual-track design: a reusable cloud Mac baseline plus a task-level clone, snapshot, or isolated workspace. Do not treat workspace destruction as a way to undo an external side effect that already happened.

This guide is for you if you:

- Run several Codex or research Agent sessions at the same time. - Have already seen agents overwrite caches, ports, files, or unfinished changes. - Build remote execution infrastructure for long tasks, experiments, and human takeover. - Need to decide whether to retain or elastically rent Mac environments.

_Last updated September 8, 2026. Current OpenAI statements and Codex guidance were checked against the official sources linked below._

First, separate the six things people call “the environment”

A common architecture mistake is to count Agent sessions and then buy or reserve the same number of hosts. That shortcut fails because a model inference, an Agent session, a business task, a code workspace, an execution host, and a cloud Mac are different objects.

| Layer | What it stores | What should normally survive | |---|---|---| | Model inference | Prompt, tool decisions, generated output | The provider’s supported conversation or task record | | Agent session | Tool history, approvals, current objective | A resumable session record, when supported | | Business task state | Checkpoints, approvals, issue status, artifact references | Yes, outside the execution host | | Code workspace | Branch, worktree, build output, temporary services | Only reviewed commits and selected artifacts | | Execution host | OS process state, credentials, caches, local files | Usually no for risky tasks | | Cloud Mac | macOS, Xcode, simulators, desktop tools, hardware access | A controlled baseline; not every task’s mutable state |

OpenAI’s public research acceleration article describes researchers using more coding Agents and running more experiments, while also noting that complex long-running work still needs substantial human guidance. The [Research Acceleration account from OpenAI](https://openai.com/index/research-acceleration-view-inside-openai/) supports the trend, but it does not prescribe a Mac configuration, a host count, or a workspace lifetime for your team.

The decision below is therefore an engineering framework, not an OpenAI architecture requirement.

| Workload signal | Persistent baseline | Disposable task workspace | Dual-track | |---|---:|---:|---:| | Approved read-only repository analysis | Suitable | Optional | Useful when inputs change | | Repeated experiment with pinned dependencies | Weak if the host drifts | Suitable | Usually best | | Several Agents editing one repository | Not as one shared directory | Suitable per task | Suitable with a persistent tool baseline | | Unknown repository or web content | Avoid | Required by default | Suitable | | Xcode, Simulator, or desktop validation | Keep the macOS and Xcode baseline | Isolate project and task state | Preferred | | Long task with human takeover | Keep external checkpoints | Recreate execution state | Preferred |

Step one: keep a persistent workspace only when the task is read-only

A controlled persistent workspace is reasonable when the Agent reads approved code, documentation, and experiment records without performing external writes. Its value is startup reduction: the toolchain, indexes, approved repositories, and read-only reference material do not need to be initialized repeatedly.

That does **not** mean tasks should share a user directory, credentials, shell history, browser profile, or unfinished session state. A persistent host can be clean enough for one class of work while remaining unsafe for another class.

Use a persistent workspace only when all of these conditions are true:

- The input repositories and documents have an approval record. - The Agent cannot write to the source of truth. - Network access is restricted to the destinations required for retrieval. - Credentials are absent, read-only, or issued through a narrow broker. - File reads and attempted writes are logged. - A task-end check confirms that no temporary service, token, mount, or session remains active.

A useful acceptance command is intentionally boring:

```bash find "$WORKSPACE" -type f -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n' \ > artifacts/file-access-review.txt

git status --short > artifacts/repository-state.txt env | sed 's/=.*//' | sort > artifacts/environment-key-review.txt ```

Example output:

```text M artifacts/file-access-review.txt ?? artifacts/repository-state.txt PATH PWD SHELL ```

The output is not proof of safety. It gives you evidence to review. You still need network policy records, identity issuance records, and a task-end cleanup result.

OpenAI’s [Codex security update](https://openai.com/index/introducing-upgrades-to-codex/) and its [Codex CLI approval guidance](https://help.openai.com/en/articles/11096431) both reinforce the need to distinguish approval behavior from actual execution boundaries. A human approval prompt can stop some actions. It cannot replace file-system isolation, identity controls, or egress restrictions.

Step two: make reproducible experiments disposable at the task level

Complex dependencies create a different problem. A research Agent may need a compiler, a package manager, a database, a browser, a local service, and a pinned input bundle. Rebuilding that stack for every run is slow. Keeping one experimental host alive forever creates drift.

The safer compromise is a versioned base image plus a task-level copy.

| Component | Store in the base | Create per task | Save outside the task workspace | |---|---|---|---| | Operating system and approved tools | Yes | No | Version and digest | | Dependency lockfiles | Yes | Validate again | Commit or artifact | | Initialization scripts | Yes | Run and log | Script version | | Input dataset or repository snapshot | Reference only | Yes | Input identifier | | Logs and generated results | No | Yes | Yes | | Credentials and temporary tokens | No | At runtime | Revocation record | | Build cache | Optional | Prefer isolated copy | Only if reproducible |

The key test is not whether the old host is still available. It is whether the same task can run successfully in a fresh copy. OpenAI’s [Codex guidance for long-running work](https://openai.com/index/codex-maxxing-long-running-work/) is relevant here because long tasks need structured progress and handoff, not an assumption that one mutable machine is the only place where progress exists.

Create an initialization record before execution:

```bash set -euo pipefail

mkdir -p artifacts uname -a > artifacts/host.txt python3 --version > artifacts/python.txt git rev-parse HEAD > artifacts/source-revision.txt shasum -a 256 inputs/* > artifacts/input-digests.txt ./scripts/bootstrap.sh 2>&1 | tee artifacts/bootstrap.log ```

Then save the result, logs, dependency manifest, source revision, input digests, and approval record outside the execution host. If a fresh task copy cannot reproduce the result, classify the experiment as environment-dependent instead of silently converting the old host into a permanent exception.

Do not describe a container, worktree, or snapshot as absolutely safe. Each can preserve hidden state, inherit an overly broad identity, or expose a network path you forgot to close.

> **Operational reminder:** destroying a workspace removes future access to that workspace. It cannot retract an email, publish a commit, upload a file, modify a third-party system, or leak a secret that already left the boundary.

Can multiple Codex tasks share one development environment?

They can share a tool baseline. They should not share one mutable project directory, build directory, temporary service namespace, or unreviewed credential context.

This distinction matters because concurrency exists at several levels:

- **Session concurrency:** how many Agent conversations are active. - **Workspace concurrency:** how many independent code states are being changed. - **Host concurrency:** how many machines are executing work. - **Mac concurrency:** how many tasks need macOS-only tools or physical-style desktop behavior.

Two Codex sessions may be reading the same immutable reference checkout while using separate task workspaces. Conversely, one business task may start several sessions that must still remain inside one controlled workspace. You cannot derive host count directly from session count.

For parallel repository changes, create one worktree, build directory, and temporary-service namespace per task:

```bash git worktree add "../worktrees/task-a" -b "agent/task-a" git worktree add "../worktrees/task-b" -b "agent/task-b"

export BUILD_ROOT="$PWD/.build/task-a" export SERVICE_NAMESPACE="task-a" ```

Use a separate value for the second task. Do not let parallel jobs inherit a shared build cache merely because the compiler happens to support it. Cache reuse is acceptable only after you have proved that it cannot mix outputs, credentials, generated files, or platform-specific state.

Merge only the reviewable diff and its test evidence. Do not merge the other Agent’s complete environment state. OpenAI’s [Codex application overview](https://openai.com/index/introducing-the-codex-app/) is useful background for understanding Agent-oriented workflows, but it does not turn a shared directory into an isolation boundary.

Step three: route unknown inputs and high-privilege actions to one task, one environment

A one-task-one-environment rule becomes necessary when the Agent handles external webpages, third-party repositories, shell writes, temporary credentials, or instructions that have not passed your review.

The trigger is not the word “Agent.” The trigger is the combination of:

- Unknown or adversarial input. - Write access to files or services. - Network access beyond approved destinations. - Credentials that can affect real assets. - A task whose cleanup failure would be difficult to detect. - A need to preserve evidence separately from the execution state.

For this class of work, create the environment only after the task record exists. Issue the narrowest identity needed, restrict network egress, execute, collect evidence, revoke access, and then destroy the workspace.

```bash task_id="research-$(date -u +%Y%m%dT%H%M%SZ)" mkdir -p "runs/$task_id"

./provision-task-env.sh \ --task "$task_id" \ --network-policy "approved-egress" \ --credential-scope "task-only"

./run-agent.sh --task "$task_id" --input inputs/manifest.json \ 2>&1 | tee "runs/$task_id/agent.log"

./revoke-task-identity.sh "$task_id" ./verify-no-access.sh "$task_id" ./destroy-task-env.sh "$task_id" ```

The commands are placeholders for your own control plane, not a claim that OpenAI requires this exact implementation. The important order is identity scope, execution, evidence capture, revocation, verification, and destruction.

OpenAI’s [GPT-5.3-Codex security material](https://deploymentsafety.openai.com/gpt-5-3-codex/cybersecurity) and its [Windows sandbox design discussion](https://openai.com/index/building-codex-windows-sandbox/) provide source material for thinking about sandboxing and cybersecurity boundaries. They should not be read as proof that your cloud Mac, shell policy, or network layout has the same protections.

How should a cloud Mac isolate parallel experiments and Xcode tasks?

A cloud Mac should usually preserve the stable macOS and Xcode baseline while isolating the project directory, build outputs, signing permissions, test accounts, and simulator state.

Pure code analysis does not need to occupy a Mac. Route that work to ordinary controlled execution first. Reserve the Mac queue for tasks that genuinely require Xcode, Simulator, desktop tools, macOS behavior, or a build and signing validation path.

| Mac layer | Persistent choice | Task-level choice | |---|---|---| | macOS baseline | Approved version and patch record | Avoid changing it during a task | | Xcode baseline | Versioned toolchain | Validate project compatibility | | Project source | Approved reference | Separate checkout or worktree | | Derived data and build cache | Optional shared baseline | Prefer task-specific location | | Signing identity | Never broadly shared | Narrow, time-bound access | | Test account | Maintain a controlled template | Isolate account state where possible | | Simulator and desktop state | Resettable baseline | Separate task state and cleanup record |

A practical Mac handoff should expose these fields:

```text task_id=ios-validation-a source_revision= xcode_baseline= signing_scope= simulator_state= artifact_path= cleanup_status= ```

If your Mac demand is irregular, compare the cost of holding a machine against the cost of waiting for or provisioning an isolated one. MacWww’s [cloud Mac options](https://macwww.com/buy.html) can be evaluated as part of that comparison, but the commercial choice should follow your isolation and recovery requirements rather than lead them.

A shared Mac remains acceptable only when you can prove reproducible builds, controlled permissions, resettable simulator state, and a task-end cleanup record. If any of those proofs is missing, move the risky portion into a task-level environment or a separate Mac execution lane.

Step four: preserve long-task state outside the host

A long task may need to pause for a review, a new input, or a human decision. That does not justify keeping the entire machine alive as the only copy of progress.

Keep these objects outside the execution host:

- Task objective and input manifest. - Current source revision and reviewed diff. - Agent checkpoint and next action. - Tool approval history. - Test results and generated artifacts. - Identity and network policy records. - Human takeover notes. - Environment version and initialization log.

A checkpoint can be plain text or structured data:

```json { "task_id": "research-001", "source_revision": "reviewed-commit", "status": "awaiting-human-review", "next_action": "inspect failing integration test", "artifacts": ["logs/test.log", "results/summary.json"], "workspace_policy": "destroy-after-evidence", "approval_record": "approval-reference" } ```

When the task resumes, provision a fresh workspace from the recorded baseline, restore only the approved artifacts, and ask the Agent to continue from the checkpoint. This keeps business task state durable while allowing the execution host to be replaceable.

MacWww’s [remote Mac console](https://macwww.com/console.html) may help when a human must inspect a desktop or Xcode task, but console access should be treated as a controlled takeover path. It should not become an excuse to leave credentials, browser sessions, or unfinished changes permanently attached to a shared host.

Use this acceptance checklist before choosing a workspace lifetime

- [ ] Classify the task as read-only, reversible write, high privilege, or Mac-specific. - [ ] Record whether the input is approved, unknown, external, or user-generated. - [ ] Separate model inference, Agent session, business state, code workspace, host, and cloud Mac. - [ ] Define the source revision, dependency lockfile, initialization script, and input digest. - [ ] Create independent worktrees, build directories, ports, and temporary-service namespaces for parallel tasks. - [ ] Confirm that credentials are task-scoped and that network egress has an explicit policy. - [ ] Save logs, results, diffs, checkpoints, and environment records outside the execution host. - [ ] Test whether the task can resume in a fresh copy. - [ ] Revoke identities before destruction and verify that real assets are no longer reachable. - [ ] Keep the Mac baseline stable while isolating Xcode project state, signing access, simulator data, and test accounts. - [ ] Review whether the measured utilization supports a persistent pool, an elastic pool, or both. - [ ] Reject any design that depends on destroying a host to undo an already completed external action.

Choose the pool model from utilization and recovery evidence

Use a persistent baseline when the workload is stable, read-only, and easy to audit. Use disposable environments when the workload is uncertain, privileged, externally sourced, or difficult to clean. Use both when the toolchain benefits from warm infrastructure but the task state must remain isolated.

| Pool model | Best fit | Main cost | Exit condition | |---|---|---|---| | Persistent baseline pool | Stable tools, approved read-only analysis, known macOS and Xcode versions | Drift and accumulated state | Rebuild when the baseline record no longer matches | | Elastic disposable pool | Bursty experiments, unknown inputs, high-risk writes | Startup and initialization work | Destroy after evidence and access verification | | Dual-track pool | Research teams with stable tooling and variable task risk | More control-plane work | Keep only if routing and cleanup are measurable |

Track utilization, recovery time, isolation findings, and cleanup exceptions. Do not use a single occupancy number to justify a host policy. A persistent host with low occupancy may still be justified for a scarce macOS toolchain. A busy host may still be unacceptable if tasks share credentials or mutable directories.

The fastest route to a decision is to tag every current task using the four categories above. If most work is read-only, keep a controlled persistent base. If high-risk or unknown-input work is common, add a disposable pool. If Mac-only validation arrives in unpredictable bursts, a dual-track cloud Mac arrangement is usually easier to defend than permanently holding every possible execution environment.

The alternative is to keep one always-on development machine and let every Agent touch it. That approach creates hidden caches, shared ports, stale credentials, uncommitted changes, and unclear ownership when a task fails. It also makes human takeover harder because nobody can tell which state belongs to which task. Renting Mac capacity through MacWww can be a better fit when demand is difficult to forecast and you need a reusable macOS baseline alongside task-level isolation, rather than paying to keep every experimental state alive indefinitely.

Start by labeling your workload, then compare persistent and elastic capacity against actual recovery and cleanup evidence. For teams expanding OpenAI Research Acceleration workflows, that is a more defensible decision than choosing “always persistent” or “always destroy” as a universal rule.