summaryrefslogtreecommitdiff
path: root/plans/ImplementationPlan.md
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-12 05:44:54 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-12 05:44:54 +0900
commitb56614c814b904c224315a11f9686f0d47abd3d3 (patch)
treee6ae4feb852ea4492bf947eabba1e11ab157686a /plans/ImplementationPlan.md
parent98b6a2aeedd591058c1d81e401d24f3ded162926 (diff)
feat: revise sandbox usability around semantic policy and LPAC process trees
Rewrite the specification and design vocabulary around User Sandbox Configuration, Environment Resolution, Executable Approval, Effective Sandbox Policy, and Windows Enforcement. Move the Internal Tool catalog to the design without treating its count as a requirement, and update README, implementation planning, traceability, audit history, prompts, and the Python skill. Introduce schema_version 1 profiles, workspaces, mounts, executable aliases, network modes, and resource presets. Add local override merging, resolution and approval stores with atomic user-only persistence, fail-closed fingerprints, localized diagnostics, and executable/sandbox management CLI commands. Change Windows execution to LPAC entry approval with inherited descendant confinement. Separate read and execute ACLs, preserve protected OS DACLs, apply Job process/memory/timeout limits to the tree, enforce WFP network modes, prevent credential environment inheritance, disable out-of-tree MSBuild reuse, and harden transactional ACL/recovery cleanup. Isolate planning prompts from execution instructions, reject split coding plans that cannot satisfy task-scoped evidence, preserve configured thinking, and prevent optional task_update failures from corrupting completion checks. Add and update configuration, resolution, approval, LPAC, descendant, readonly/development, Registry/COM, WFP, recovery, .NET/Python/PowerShell process-tree, and Operational E2E coverage. Publish reproducible bundles while preserving deployment-local configuration, prompts, skills, logs, state, approvals, and resolutions.
Diffstat (limited to 'plans/ImplementationPlan.md')
-rw-r--r--plans/ImplementationPlan.md86
1 files changed, 41 insertions, 45 deletions
diff --git a/plans/ImplementationPlan.md b/plans/ImplementationPlan.md
index b9cda6d..c2c348e 100644
--- a/plans/ImplementationPlan.md
+++ b/plans/ImplementationPlan.md
@@ -115,10 +115,10 @@
| 2 | MCP Public Interface | stdio、非同期Task受付、`agent_run/status` | G2 |
| 3 | Session / Ollama / Prompt | text会話、Session、token usage、Prompt優先順位 | G3 |
| 4 | Token Planner | TaskGraph、Token PERT/CPM、再計画 | G4 |
-| 5 | Internal Tool / Policy Boundary | Design.mdのTool catalog、ToolUseGuard、Policy Engine | G5 |
+| 5 | Internal Tool / Policy Boundary | Design.mdのInternal Tool catalog、ToolUseGuard、Policy Engine | G5 |
| 6 | Filesystem / Process Sandbox | AppContainer、ACL、Job、hash approval | G6 |
| 7 | Transaction / Recovery | ACL Resource Transaction、File rollback、Recovery Journal | G7 |
-| 8 | Network Sandbox | WFP deny / host-port allow-list | G8 |
+| 8 | Network Sandbox | WFP none / local / restricted | G8 |
| 9 | Vision / Streamable HTTP | optional画像、loopback HTTP | G9 |
| 10 | Audit / Security Hardening | Audit JSONL、全Security Matrix | G10 |
| 11 | Acceptance / Release Audit | AT全件、文書整合、未完了ゼロ確認 | G11 |
@@ -327,25 +327,25 @@ Planner deterministic test全PASS。
- OLL-10〜11
- SEC-INV-01〜02
## 10.2 Internal Tool catalog
-| Tool | Operation |
+| Internal Tool | Operation |
| --- | --- |
| `file_search` | glob / name / text / regex / tail |
| `file_read` | whole / range / metadata |
| `file_edit` | overwrite / patch / atomic_replace / delete |
-| `process_run` | exe + args + cwd + timeout |
+| `process_run` | Executable + args + cwd + timeout |
| `task_update` | add / dependency / estimate |
-個々の `grep`、`find`、`tail` 等を独立Toolにしない。
+個々の `grep.exe`、`find.exe`、`tail.exe` 等を独立Internal Toolにしない。
## 10.3 実装対象
- JSON Schema
- Ollama native tool calling
- Internal Tool Dispatcher
- Policy Engine I/F
-- Tool argument validation
+- Internal Tool argument validation
- ToolUseGuard
- `requires_external_effect` — **Planning フェーズで LLM structured output により Task ごとに判定・設定**(keyword heuristic 廃止)
- same failure fingerprint limit=5
- Plan/Run フェーズ分離: PlanAsync (structured output) → RunAsync (ready Task 順次実行)
-- replan: Policy deny 時に最大3回まで再計画可能
+- replan: Effective Sandbox Policy deny時に最大3回まで再計画可能
- Context Summary: `prompt_eval_count / num_ctx` ≥ 80% で古い Conversation/ExecutionResult を compact
## 10.4 重要な段階制約
このPhaseの副作用backendはfake/in-memory実装を使用可能とし、Windows sandboxを迂回した本物の無制限file/process操作を実装してはならない。
@@ -353,13 +353,13 @@ Planner deterministic test全PASS。
- [ ] MCP ClientからInternal Toolが見えない
- [ ] OllamaにはDesign.md 7章のcatalogだけを公開
- [ ] malformed tool args拒否
-- [ ] Policy deny時に副作用なし
-- [ ] Policy denyは同一Tool呼出しへ再投入せず、許可済み能力内の条件付き再計画を最大3回行い、同一deny・計画未変更・実行可能Taskなし・再計画失敗でfailedとなる
+- [ ] Effective Sandbox Policy deny時に副作用なし
+- [ ] Effective Sandbox Policy denyは同一Internal Tool Callへ再投入せず、許可済みcapability内の条件付き再計画を最大3回行い、同一deny・計画未変更・実行可能Taskなし・再計画失敗でfailedとなる
- [ ] external effect必須Taskでtool未使用ならcompletedにならない
- [ ] 同一失敗5回でfailed
- [ ] pure analysis TaskにはToolを強制しない
### Gate G5
-LLM→Tool→Policyの境界が固定され、Policyを通らない副作用経路が存在しないこと。
+LLM→Internal Tool Call→Policy Engineの境界が固定され、Effective Sandbox Policyを通らない副作用経路が存在しないこと。
---
# 11. Phase 6 — Filesystem / Process Sandbox
## 11.1 対応仕様
@@ -367,39 +367,36 @@ LLM→Tool→Policyの境界が固定され、Policyを通らない副作用経è
- SEC-INV-03〜05、08
- ST-01〜11、ST-16
## 11.2 実装対象
-- Application固定AppContainer Profile
-- Sandbox Broker
-- FilesystemPolicy R/W/E/Delete
-- canonical path
-- reparse point防御
-- NTFS ACL(承認directory rootへの継承ACE、root単位snapshot、protected descendantのfail-safe維持)
-- Process approval canonical path + SHA-256
-- shell toggle
-- Job Object
-- descendant制御
-- process count / memory limit
-- KILL_ON_JOB_CLOSE
+- Application固定LPAC Profileと`ALL APPLICATION PACKAGES` opt-out
+- User Sandbox ConfigurationからEffective Sandbox Policyへの変換
+- Logical Pathのreparse chain解決、config別Resolution Store、変更時fail-closed
+- Workspace/Mount/Runtime/Artifact/OS RuntimeのFilesystem capability
+- NTFS ACL(readとexecuteを分離した継承ACE、root単位snapshot、protected descendantのfail-safe維持)
+- Executable Alias、Approved Entry ExecutableのResolved Path + SHA-256、user-local Approval Store
+- Runtime Component/development Workspace Artifact/External Unknown Entryの分類
+- Entry ProcessとDescendant ProcessへLPAC、ACL、WFP、Job Objectを継承
+- breakaway禁止、process count / memory limit / timeout / KILL_ON_JOB_CLOSE
- Named Pipeが必要ならtask固有DACL
-## 11.3 Process approval
-承認条件は以下を両方満たすこと。
+## 11.3 Executable Approval
+BrokerがApproved Entry ExecutableまたはApproved Shell Executableを直接起動する条件は以下をすべて満たすこと。
```text
-canonical path == approval.path
-SHA-256 == approval.sha256
+Alias == approval.alias
+Resolved Path == approval.resolved_path
+SHA-256 == approval.sha256
```
-hash変更、path変更は再承認を必要とする。
+hash、Logical Path、Resolved Pathの変更は再承認を必要とする。Descendant Processには個別Approvalを要求せず、Sandbox Process Treeのconfinementで制御する。
## 11.4 必須Security Test
-- [ ] ST-01 read許可成功
-- [ ] ST-02 read未許可拒否
-- [ ] ST-03 write許可成功
-- [ ] ST-04 delete権限なし拒否
-- [ ] ST-05 junction脱出拒否
-- [ ] ST-06 symlink chain脱出拒否
-- [ ] ST-07 approved exe成功
-- [ ] ST-08 hash mismatch拒否
-- [ ] ST-09 shell disabled拒否
-- [ ] ST-10 descendant未承認exe拒否
-- [ ] ST-11 Job closeで全descendant終了
-- [ ] ST-16 Ollama tool path脱出拒否
+- [ ] readonly Workspaceでread成功、write/delete/Artifact Entry拒否
+- [ ] development Workspaceでread/write/delete/Artifact Entry成功
+- [ ] Mount accessとEntry起動禁止
+- [ ] reparse chain/cycle、Resolution変更、fingerprint変更をfail-closed
+- [ ] Approved EntryのAlias/Resolved Path/hash一致、stale hash拒否
+- [ ] Runtime Component、Workspace Artifact、OS Runtime、External Unknown Entryの分類
+- [ ] Entry/Descendant tokenが同じLPAC identityでJob chain内に残る
+- [ ] Approved Python→Python subprocess、Approved PowerShell→cmd、Approved .NET→build/testが成功
+- [ ] breakaway、未許可Filesystem、Registry write、COM、Networkを拒否
+- [ ] Job close/cancel/timeoutで全Descendant終了
+- [ ] Ollama Internal Tool CallのResolved Path脱出拒否
## 11.5 監査証跡
Security testでは「例外になった」だけでなく、OS/Brokerで実際に対象資源へ副作用が発生していない証跡を残す。
### Gate G6
@@ -460,7 +457,7 @@ mode=deny
mode=allow
-> default deny
- -> allow-list hostをTask開始時にDNS resolve
+ -> restricted endpoint hostをTask開始時にDNS resolveしてIP snapshot化
-> IP snapshot + portだけallow
```
## 13.3 実装時にCodexが選択してよい範囲
@@ -565,12 +562,11 @@ AT-01〜AT-20をすべて再実行する。
## 16.2.1 Release Bundle
- `dotnet publish -c Release -r win-x64 --self-contained true` を実行する。
- `agent-mcp.exe`、runtime/dependency、`agent.yaml`、en/ja locale、User Prompt、`skills/`、READMEを含むversion付きZIP、manifest、SHA-256を生成する。
-- ソースツリー外の空directoryへ展開し、Bundle内の資源だけで `agent-mcp check`、stdio initialize、loopback HTTP起動を実行する。
+- ソースツリー外の空directoryへ展開し、Bundle内の資源だけで`agent-mcp sandbox resolve`まで実行する。`check`、stdio、HTTPは、利用者がResolutionを確認し必要なExecutableを承認したOperational配置で実行する。
## 16.2.2 Operational E2E Test
-- E2E-01: Release Bundle、local Ollama、実測approval、stdio MCP Clientでfixtureのread/edit/process/build/test、日本語応答、Audit追跡、cleanupまで完走する。
-- E2E-02: 同等の作業をloopback Streamable HTTPで完走し、Legacy SSE、GET SSE、non-loopback bindが存在しないことを確認する。
-- Cloud model試験は任意互換試験とし、Release Gateへ含めない。
+- E2E-01: Release Bundle、`deepseek-v4-flash:cloud`、Python 3.14の実測Approval、stdio MCP Clientで一時fixtureへ複雑なPython programとtestを作成し、Python subprocessを含むtest、日本語応答、Audit追跡、cleanupまで完走する。
+- E2E-02: 同等の作業をloopback Streamable HTTPのIPv4/IPv6で完走し、Legacy SSE、GET SSE、non-loopback bindが存在しないことを確認する。
## 16.3 Requirement Traceability監査
最低限次のマトリクスを完成させる。
| Requirement | Implementation | Test | Result | Evidence |
@@ -622,7 +618,7 @@ AT-01〜AT-20をすべて再実行する。
9. 仕様・設計逸脱0、または承認済み文書更新済み
10. Recovery後のclean state確認
11. publish済みwin-x64 self-contained Release Bundleが単独で起動可能
-12. E2E-01 / E2E-02がlocal OllamaでPASS
+12. E2E-01 / E2E-02が配布既定の`deepseek-v4-flash:cloud`とPython 3.14でPASS
13. READMEだけでfresh directoryから初回セットアップ可能
---
# 17. フェーズ横断テスト分類