You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(security): delete DynamicWorkflow and CodeMode, whose sandboxes let model-written code reach os and start processes #947
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/securityType security: a vulnerability or a leak
DynamicWorkflow (ai/harness/workflow.py:550-680) runs model-written Python in-process, and its sandbox does not contain it.
sandbox_env exposes the typing and asyncio modules, and the AST check blocks only imports and dunder attributes.
A probe on 2026-10-02 showed that model-written code can reach os and start processes:
typing.sys.modules['os'].getpid() returned the pid;
await asyncio.create_subprocess_exec('true') ran with exit 0.
No CLI command builds a DynamicWorkflow or a WorkflowAgent. Only tests/test_harness.py does. Both are exported from devops_cli.ai, devops_cli.ai.agents and devops_cli.ai.harness, so any caller could. The review session 20261001-224227 flagged the file with the wrong mechanism; the triage and the loop analysis confirmed the real one.
Acceptance criteria
DynamicWorkflow, WorkflowAgent and the sandbox helpers they alone use are deleted, with their exports and tests (pre-1.0, no shim). This is the roadmap's own rule: "If no production agent will attach these capabilities, delete them."
rg -n "DynamicWorkflow|WorkflowAgent|run_workflow" src tests docs prints nothing, or only an unrelated name.
Docs and knowledge-base pages that describe them are corrected.
uv run devops ci passes.
Key questions
Fix the sandbox instead? No (proposed). No production path uses it, and an in-process Python sandbox is not a boundary worth keeping. If one is needed later, it runs model code in the host sandbox (bwrap) that review criteria already use.
Scope extended (2026-10-02)
CodeMode (ai/harness/os_access.py) has the same hole. It runs model-written code with exec in-process and hands it the same typing and asyncio modules. A probe against the trimmed tree, run_code(code="typing.sys.modules['os'].getpid()"), returned the pid. No production code builds a CodeMode; it is only exported from devops_cli.ai, devops_cli.ai.agents and devops_cli.ai.harness.
Added scope:
Delete CodeMode, the helpers only it uses, its exports and its tests, with no shim.
OSAccess, MountDir and ToolSearch stay if production code uses them.
The architectural invariant asserts that no module in src/devops_cli calls the exec or eval builtin.
changed the title [-]fix(security): delete DynamicWorkflow, whose sandbox lets model-written code reach os and start processes[/-][+]fix(security): delete DynamicWorkflow and CodeMode, whose sandboxes let model-written code reach os and start processes[/+]on Oct 2, 2026
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/aiAI review pipeline, personas, prompts, LLM client, or RAGtype/securityType security: a vulnerability or a leak
Activity
[-]fix(security): delete DynamicWorkflow, whose sandbox lets model-written code reach os and start processes[/-][+]fix(security): delete DynamicWorkflow and CodeMode, whose sandboxes let model-written code reach os and start processes[/+]fix(security): delete DynamicWorkflow and CodeMode, whose sandboxes l…
fix(security): delete DynamicWorkflow and CodeMode, whose sandboxes l…
dan-petty commentedon Oct 2, 2026
Closed by #964, merged into
release/v0.2.25.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.25 (#1089)