Skip to content

Codex controller: enforce startup and tool isolation before model turns (T26) #295

Closed

Description

@erickb336

Parent: #88. Sage task T26, terminal launch investigation.

The opt-in terminal client needs a complete startup and tool boundary before it can admit model turns. PR #294 deliberately exposes no model-turn operation.

Verified gap

Actual CLI 0.160.0 with the existing controller restrictions and environments=[] still advertises and executes an ordinary configured MCP tool. In a disposable profile, a simulated model emitted one namespaced fixture_lookup call. The owned harmless loopback MCP endpoint received tools/call; the next provider request contained the matching fixed synthetic execution receipt. No paid inference or external effect occurred.

The paired control explicitly disabled that known server. It advertised only owner questions, received zero MCP JSON requests at the owned endpoint, and refused the same emitted call. Both direct native processes exited 0, listeners closed and temporary profiles were removed. Independent diagnostic code review is clean for the retained controls and their limited claims. The separate investigation/evidence-review route remains unfinished.

Earlier native config controls also show mcp_servers={} does not erase inherited user/project server entries. Known-server overrides do not establish complete discovery or exclude configuration races. Internal Rust ToolPolicy availability does not establish a supported stdio client setting.

Required result

  • Establish a supported boundary for both integration startup and model-requested effects, including MCP, apps/plugins, environment tools and native delegation.
  • Preserve the selected model, provider and native permission/sandbox policy. Never replace real settings with a fixture profile or modify global managed requirements silently.
  • Bind reviewed effective configuration and executable identities to actual launch; cover layered configuration, new/changed integrations and restart/resume.
  • Keep the complete chief/lead/specialist hierarchy, independent reviews, task-state validation, ownership, gates and protected publication.
  • Refuse model work when the boundary cannot be established. Do not infer isolation from a catalogue, successful config read or approval-only client.
  • Verify enabled/disabled, unknown integration, changed-layer, startup, denied-effect and restart cases through actual native runtime with safe owned fixtures.
  • Compare supported scoped configuration, embedded-host extension APIs and upstream exposure before selecting an implementation. Internal/testing-only APIs are not ordinary CLI capabilities.

Separate dependencies remain #243 (trusted execution context), #239 (common ownership), #246 (abrupt-loss settlement), and #266 (routes/owner gates). This issue supplies no permission to weaken those requirements or change defaults. Claude-active work remains excluded.

Activity

  1. added
    codex
    on Oct 21, 2026
  2. erickb336 commented on Oct 21, 2026

    @erickb336
    OwnerAuthor

    Native embedded-host investigation update (pinned Codex 0.160.0; local research only):

    • A real native thread with configured MCP initialized the owned fixture endpoint and listed tools.
    • The equivalent restricted host cleared the native constrained MCP map and composed an empty-only validator before thread startup. The endpoint observed no HTTP requests. Both threads emitted native MCP startup completion, completed native shutdown, and were removed from the manager.
    • A separate extension-contributor negative control still initialized/listed the fixture server despite the empty configured map and captured empty ToolPolicy. This proves that the configured-map restriction alone does not close this issue. The complete extension registry, plugins/environment inputs, and final runtime catalog still need coverage.
    • No model turn, paid inference or MCP tool effect ran. All owned host processes, streams and listeners closed. Disposable profiles were removed after verified native settlement; a deliberately failed observation retained its profile for review.

    The public native APIs now have bounded feasibility evidence for resolved local permissions, native execution enforcement, persistent configuration-map constraints, and configured-MCP startup suppression. Owner/cloud permission binding, all startup sources, generated-call admission, cold resume and complete Sage lifecycle/recovery remain unverified. No production defaults changed.

    Preserved failed attempts: missing executable path, then a debug worker stack overflow before successful shutdown. The corrected host uses the maintained native arg0_dispatch_or_else bootstrap. Neither failed attempt is counted as a passing control. Diagnostic review also found and repaired the probe's premature deletion of uncertain recovery state. This work is not a full investigation/evidence-review stage or a claim of complete Codex support.

  3. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    Native startup investigation update: two more reviewed diagnostic units are complete. This issue remains open.

    • Actual host-owned Apps startup occurs despite an empty environment MCP policy. With native final Apps=false, the paired thread starts and shuts down with zero endpoint requests. Synthetic managed Apps=true survives disable; the candidate fixture guard refuses before auth/thread construction.
    • The actual public native bootstrap/storage/cloud-loader/ConfigBuilder path distinguishes valid no-auth None from managed Some and InvalidBundle errors. Cloud Apps=false/true pins remain effective. Invalid cloud policy causes configuration refusal, rather than a usable fallback.
    • Seven disposable native controls completed using synthetic local accounts and owned loopback services, without model turns or real credentials. Every direct process, stream and listener terminated; all seven temporary profiles were removed after accepted outcomes.
    • Independent review found and repaired a fixture-evidence validator gap. The repair passes12/12 portable controls; nine behavioral cases fail the original acceptance code. Cloud controls pass14/14. Independent diagnostic reviews are clean, with all artifact hashes checked. All1,472 nonhelper dependency records remain unchanged.

    These results support a controlled embedded-native-host prototype. They do not establish that ordinary CLI declarations isolate tools, authenticate a real owner, provide current per-operation context, or implement protected effects. T31 staging is merged in #297 but remains non-authorizing. Real owner/cloud binding, config/account invalidation, resume, remote namespaces, common ownership, routes/gates and durable recovery remain unfinished. No installed/default change occurred; Claude #288 remains separate. Diagnostic code reviews do not certify the missing investigation/evidence-review route.

  4. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    Integrated native-host prototype update: four actual fixture runs now combine native cloud bootstrap, final Apps guard, explicit local environment/catalog policy, exact ToolPolicy, actual pending native request and the unmodified production T31 binding.

    • Valid: immutable fixture-assignment data stages; replayed call ID refuses; native reply explicitly permits no effect.
    • Forged actor: strict action schema refuses before staging.
    • Unadvertised MCP: native refusal, zero MCP endpoint requests.
    • Managed Apps=true: native guard refuses before ThreadManager/model turn.

    All four direct processes exited0, streams/listeners closed and temporary profiles were removed after accepted results. Portable retained-record controls pass16/16; independent diagnostic review is clean and checks all14 hashes plus the T31 source hash. Responses and identities remain synthetic; no paid inference or real action ran. Production source and Claude #288 are untouched.

    The newly observed pending context is explicitly a thread-default snapshot, not the full resolved executor tuple or active-turn override evidence. Next investigate a supported post-resolution/pre-effect native context/admission seam. Do not treat execution-service access alone as native approval orchestration. Core admission, shared ownership, task/gates, runtime invalidation, remote/resume/recovery and a full live pilot remain required. This issue and #243 remain open; no installed/default change or investigation-route completion is claimed.

  5. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    A further local native-host check now covers interruption while a file tool waits for a controller decision.

    Two actual native runs used disposable files, synthetic authentication and fixed simulated model responses:

    • Baseline: the native file adapter changed the permitted file under its original sandbox context.
    • Interruption: native Op::Interrupt dropped the pending asynchronous tool future, emitted an actual turn-aborted event with reason interrupted, and closed the decision socket. Independent reads after process exit found both files unchanged.

    A later allow attempt occurred only after native abort. It encountered the already destroyed socket and returned EPIPE; this is not evidence of a delivered stale grant rejected by a surviving executor. Both native processes exited zero, all owned streams/listeners/sockets closed, and temporary profiles were removed. Each arm ran once; no real-model or paid trial occurred.

    The initial evidence validator missed an abort-reason check: its negative suite passed18/19. Finding F-T26-FILE-INT-1 records that gap. The corrected validator passes 24/24 against the same retained native observations. Independent diagnostic review R243 is clean, confirms the repair and checks all23 new artifact hashes plus15 unchanged earlier file-experiment hashes. No native trial was repeated to obtain a pass. The stronger saved driver was not run natively.

    This adds evidence for cancellation before filesystem dispatch. It does not establish rollback after dispatch, abrupt-loss settlement, durable recovery, real owner approval, task/ownership admission, remote behavior or complete automatic Sage. No production source, installed setting, default or Claude-owned work changed. The full issue88 acceptance criteria remain open.

    The next interface design must cover commands, direct patches and intercepted patch commands while preserving native approvals. The inspected native command-start observer alone cannot supply that complete boundary.

  6. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    Local native admission prototype: independently reviewed (R246), with no new findings in its bounded scope.

    • Fourteen actual native fixture cases produced five allowed file changes and nine refusals. These include direct and intercepted patch calls, isolated roots, missing/error evaluators, native permission denial, native approval denial, and native approval followed by an evaluator veto.
    • Portable evidence checks pass 42/42. These checks use retained event records and actual file results; they are not 42 native trials.
    • A separate intentionally broken native binary ignored the evaluator refusal. It changed the file, and the observer rejected that result. The correct source is restored.
    • The required authority lives in private session services, independent of the optional extension registry. The native runtime awaits its decision before applying the patch and retains the native sandbox and approval path.

    This is a local research prototype against a pinned native source revision, not released Codex support or full Sage autopilot. No native fork was published, installed defaults changed, or production change merged for this unit. Synthetic fixture approval is not owner approval.

    Still open: stable resource identity and atomic use, descendant/fork/resume qualification, commands and remote execution, interruption/revocation/recovery, shared Sage ownership and task gates, and release qualification. Source plumbing alone does not prove those contracts. The investigation remains open. All owned native fixture processes terminated; the reviewer started no background tasks.

  7. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    Native admission follow-up: two additional paths now have independently reviewed local fixture evidence.

    • Internal session: two actual cases create a real loaded parent and use the native internal-session producer. The isolated child retains the required evaluator. Allow writes the intended file; deny preserves both files. R248 is clean; eight portable evidence controls pass.
    • Prepared-history fork: two actual cases first complete one synthetic parent turn, then obtain and consume the native store's prepared fork. Both saved parent messages appear in the fork's model input. Allow/deny effects match the evaluator decision. Ten portable evidence controls pass. R249 found one incorrect historical count in the report; revised documents correct it, and R250 is clean.

    The initial legacy subagent setup refused paginated history before a model turn. A separate no-turn-parent attempt had one metadata item but no durable history prefix, so it was excluded from fork-history evidence. Both failures are preserved. The corrected trials each ran once; review corrections did not trigger native reruns.

    Qualified cases confirm both native sessions shut down, the owned process and streams ended, the listener closed, and temporary profiles were removed. No real model or shell command ran. No production Sage change or installed default changed, and no native fork was published.

    This remains a local prototype against pinned native source. Manager-wide evaluator inheritance does not prove AgentControl scheduling or per-assignment authority. Cold resume, abrupt recovery, stable resource identity/atomic use, commands/remote execution, shared ownership, task gates and release qualification remain open. Next: native restart/resume evidence while preserving these requirements.

  8. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    Two bounded local controller checks now have recorded evidence.

    • Graceful fresh-process resume: three actual cases across six sequential native processes restore saved messages and the same thread identity. Allow changes only the intended file; deny and missing evaluator preserve both files. Independent diagnostic review R253 is clean. Portable observer checks pass 12/12. The initial observer wrongly required another cloud-policy fetch; corrected validation of the same retained run accepts the native cache path. No native retry was used. Policy freshness and abrupt recovery remain unverified.
    • Missing-authority session refusal: the new local prototype rejects a missing required evaluator in the shared native Session constructor. Five actual cases cover normal missing authority, isolated missing authority, allow, deny and unmanaged behavior. Both missing cases send zero model/MCP requests and register no manager thread. The other cases preserve expected file effects. Portable checks pass 18/18. Independent diagnostic review R254 is clean. No native case needed a retry.

    All owned native processes, streams and fixture listeners ended. The native binaries and evidence are archived separately. No production Sage source, installed executable or default changed. This is local native research; no native fork was published and no claim of full autopilot or production qualification is made.

    The constructor refusal is later than configuration and manager preparation. It is not complete pre-bootstrap integration isolation. The new guard has not yet received live internal/fork/resume qualification; previous binaries retain their prior limited evidence. Stable resource identity and atomic use, full native agent hierarchy, arbitrary commands/remote execution, common ownership, task gates, abrupt-loss settlement and release qualification remain open. Supplied evaluator presence alone does not authenticate a Sage task. The complete investigation route remains unfinished.

  9. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    Two further controller requirements now have independently reviewed local native evidence.

    • Current guard across resume and child producers: eight actual cases across twelve processes pass. A fresh host with missing authority refuses resumed session creation before any model request, despite loading saved history. Valid authority survives isolated internal-session and prepared-fork paths. Allow/deny effects and full owned cleanup pass. Independent diagnostic review R255 is clean; portable observer checks pass 23/23.
    • Interruption during evaluator wait: direct, isolated and command-intercepted patch cases stop without a file change. The waiting evaluator future drops, the native turn reports interruption, and an actual late one-use grant is rejected. A matching allow control completes the real write. Independent diagnostic review R256 is clean; portable checks pass 20/20. Four actual native cases are distinct from those twenty checks.

    The first interruption observer had a patch-terminator typo. The native run had already stopped correctly. Corrected validation accepts its retained evidence without a native rerun; the original failed receipt and data remain preserved. The finding is fixed and closed after review.

    All owned native processes, streams and fixture listeners ended. No runtime source changed in these two units; new fixture hosts use the reviewed local constructor guard. No production Sage source, installed default or executable changed, and no native fork was published. These results do not certify the full investigation route or production autopilot.

    Still required: stable resource identity and atomic use, complete startup/integration isolation, per-assignment task/role/ownership/gate authority, full native hierarchy, commands/remote execution, abrupt-loss settlement and release qualification. Interruption while waiting does not prove rollback after an effect starts. Next, use an owned disposable fixture to observe a file replaced while admission waits, then design the executor-side remedy. Do not substitute a path recheck for a held resource capability.

  10. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    The local native prototype has one confirmed, unresolved target-binding failure.

    A real patch reached the policy evaluator and waited. The controlled fixture renamed its target and created a replacement at the same path, with the same starting bytes. After the evaluator allowed the operation, the native patch changed the replacement. The original file remained unchanged under its new name. The protected file also remained unchanged.

    This occurred inside the permitted disposable directory. It is not evidence of a sandbox escape. It shows that retaining the patch text and path does not retain the approved file through execution. The existing path-based executor cannot yet satisfy the proposed resource-binding requirement.

    Independent diagnostic review R257 confirms the failure and the retained evidence. The finding F-T26-PATCH-TARGET-REBIND-1 remains open/fix. One new native trial and one retained, identical-binary control support the result. The 13 passing portable checks validate the observations; they do not establish a working fix. All owned processes, streams and the fixture listener ended. The failure files remain available for review.

    The next step is an executor-side design that preserves native permissions and consumes the approved resource. It must cover parent paths, creation, deletion, move destinations and remote execution. A path recheck followed by another path lookup is insufficient. Existing read handles do not supply a prepared write capability. No remedy is implemented yet.

    No production Sage source, installed executable, setting or default changed. No native fork was published. The shipped controller still exposes no model-turn operation. Complete startup isolation, common ownership, task/role/gate authority, full native hierarchy, abrupt-loss settlement and release qualification remain separate requirements. Claude's active documentation work is excluded.

  11. erickb336 commented on Oct 22, 2026

    @erickb336
    OwnerAuthor

    The next repair candidate has bounded evidence, but it is not a complete fix.

    Eight local filesystem cases tested a retained original file handle, a non-truncating write handle, identity/content comparison and writes through that same handle. Replacing the leaf or parent before acquisition refused without a write. Replacing either after acquisition left the replacement unchanged but wrote the renamed original. A symlink substitution refused; a prior content change refused; stable and declined controls behaved as expected.

    These were actual macOS fixture operations with simulated admission, not native Codex execution or native permission evidence. Independent diagnostic review R258 is clean for the observations and limitations. Every descriptor closed, no child process started, and the successful fixture was removed. The earlier native failure fixture remains retained.

    Decision: do not adopt this standalone mechanism as the native repair. It prevents the tested replacement redirection, but does not establish continuing pathname/parent authority or exclude concurrent content changes. The existing target-binding finding remains open. A write handle is also not a task grant or a native permission receipt.

    The next design must connect executor capabilities to namespace and dispatch authority. The separate #239 guarantee concerns one lead per PR; it is not itself a filesystem lock. Add/delete/move, parent creation, multi-file effects and remote execution remain in scope. No production source, installed executable, configuration or default changed. Full controller support remains unfinished.

  12. erickb336 commented on Nov 9, 2026

    @erickb336
    OwnerAuthor

    Closing as obsolete. The native Codex controller fork is parked and the native runtime was deleted in PR #467 (T732) and PR #468 (T914). Owner decision 2026-11-09.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    codex

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions