From 9337ac3e5edd42bb17f5e2ade6c2de02c7ef576d Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Thu, 13 Aug 2026 22:48:24 +0900 Subject: feat!: isolate privileged sandbox network operations per task Run agent-mcp with an explicit asInvoker manifest and move WFP and loopback mutations into a fixed requireAdministrator helper under the release admin directory. Add the Agent.Admin client and host projects with task-scoped runas launch, a logon-SID and Administrators-only local named pipe, remote-client rejection, mutual PID validation, strict versioned JSON framing, fixed network-only operations, and bounded messages. Delay ACL and network Task Resource application until the first process_run. Verify executable identity, managed entry points, DNS snapshots, and normal-token WRITE_DAC access before elevation; reuse the helper only within the Task and keep elevation failures terminal without policy replanning. Keep LPAC creation, executable approval, Job confinement, and ACL leases in the normal process. Make startup platform checks read-only, create the fixed Application Profile during apply, preserve dynamic WFP lifetime in the helper, and route persistent loopback recovery through the same elevated boundary. Update recovery journaling, localized elevation and IPC errors, audit events, release publishing, manifests, README guidance, Specifications, Design, implementation records, and requirement traceability for the on-demand elevation model. Add administrative-boundary, file-only no-elevation, elevation-terminal, lazy-resource, crash-recovery, manifest, IPC schema, and operational verification coverage. Verified Release build with zero warnings, Core 105/105, Planner 10/10, administrative boundary 4/4, elevated Windows suite 79/79, and published stdio/HTTP MCP E2E. --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 94e9fb3..f0261db 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Windows上でOllamaを利用し、AIエージェントのファイル操作と | 項目 | 要件 | | --- | --- | | OS | Windows 11 x64 | -| 実行権限 | 管理者権限(WFP操作に必要) | +| 実行権限 | 通常ユーザー。Sandbox Processを初めて実行するTaskでWindows UACを表示 | | Windows Service | Base Filtering Engine(BFE) | | LLM | Ollama。配布設定の既定モデルは`deepseek-v4-flash:cloud` | | Client | stdioまたはStreamable HTTP対応MCP Client | @@ -105,13 +105,13 @@ Entry Processの子孫には個別のExecutable登録を要求しません。同 ## 初回適用と起動 -管理者PowerShellで展開先へ移動します。まずYAMLから計算された権限マトリックスを確認します。 +通常のPowerShellで展開先へ移動します。まずYAMLから計算された権限マトリックスを確認します。`show`と`apply`はUACを表示しません。 ```powershell .\agent-mcp.exe show .\agent.yaml ``` -内容が正しければ設定全体を一度だけ適用します。Workspace/Mountの解決先、Executableの解決先とSHA-256、設定fingerprintが一つのスナップショットとして保存されます。 +内容が正しければ設定全体を一度だけ適用します。Workspace/Mountの解決先、Executableの解決先とSHA-256、設定fingerprintが一つのスナップショットとして保存され、固定Application Profileが通常ユーザー権限で準備されます。 ```powershell .\agent-mcp.exe apply .\agent.yaml @@ -141,7 +141,7 @@ YAML、解決先、Executable hashのいずれかが変化すると起動はfail | 構文 | 引数/option | 変更 | 用途 | | --- | --- | --- | --- | -| `agent-mcp []` | 任意の設定path | Task中の一時Sandbox Resourceのみ | 設定を検証し、管理者権限・BFE・WFPをpreflightしてServer起動 | +| `agent-mcp []` | 任意の設定path | Task中の一時Sandbox Resourceのみ | read-onlyのPlatform/BFE/helper検査後に通常権限でServer起動 | | `agent-mcp show []` | 任意の設定path | なし | 現在の希望状態、Resolved Path、hash、適用一致状態を表示 | | `agent-mcp apply [] [--yes]` | 任意の設定path、任意の`--yes` | Applied Configuration Storeをatomic置換 | マトリックスを一括確認して適用 | @@ -159,7 +159,7 @@ YAMLは希望状態、Storeは利用者が確認した実体path・hashを含む ## MCP Client設定 -stdioではMCP ClientがServerを起動するため、MCP Clientを管理者権限で起動します。 +stdioでもMCP Clientは通常権限で起動します。ファイル操作だけのTaskではUACは発生しません。Task内で最初の`process_run`を行う直前だけ、WFPとloopback設定を担当する同梱Executableの昇格確認が表示されます。 ```json { @@ -172,7 +172,7 @@ stdioではMCP ClientがServerを起動するため、MCP Clientを管理者権 } ``` -HTTPではagent-mcp.exeを管理者権限で起動しますが、接続するMCP Clientの管理者権限は不要です。既定endpointは`http://127.0.0.1:8080/mcp`です。 +HTTPでも`agent-mcp.exe`と接続するMCP Clientを通常権限で起動します。既定endpointは`http://127.0.0.1:8080/mcp`です。Task時のUACを拒否すると当該Taskだけがfailedになり、Serverは継続します。crash後にpersistentなloopback設定のRecoveryが必要な場合だけ起動時にUACが表示され、拒否するとMCP受付前に終了します。 ## MCP Tool @@ -191,7 +191,7 @@ System Promptは`agent.user_system_prompt`、Skill directoryは`skills.directory | --- | --- | | `logs/application.log` | 起動とアプリケーションイベント | | `logs/llm.jsonl` | Ollama call、token、Internal Tool結果 | -| `logs/audit.jsonl` | ファイル、Process、Policy、ACL、WFP、Recovery、非対話apply | +| `logs/audit.jsonl` | ファイル、Process、Policy、ACL、WFP、昇格、IPC拒否、Recovery、非対話apply | | `logs/http.jsonl` | HTTP接続と処理結果 | | `state/journals/` | crash recovery用Journal | | `state/backups/` | 大容量編集のtransaction backup | @@ -207,7 +207,8 @@ System Promptは`agent.user_system_prompt`、Skill directoryは`skills.directory | --- | --- | | `sandbox.configuration_not_applied` | `show`で全体を確認して`apply` | | Executable更新後に起動できない | hash変更は自動承認しないため、`show`後に`apply` | -| 管理者権限/WFP preflight失敗 | 管理者PowerShellで起動し、`Get-Service BFE`を確認 | +| helper/BFE preflight失敗 | Release Bundleの`admin\agent-mcp-admin.exe`を復元し、`Get-Service BFE`を確認 | +| Task実行時にUACを拒否 | 当該Taskはfailedになる。内容を確認し、必要ならTaskを再実行して昇格を承認 | | Filesystem拒否 | WorkspaceまたはMountをYAMLへ追加し、再度`apply` | | Network拒否 | `network.access`とendpointを見直し、再度`apply` | @@ -224,4 +225,4 @@ dotnet test AgentSandboxMcp.slnx -c Release --no-build --no-restore ## ライセンス -MIT \ No newline at end of file +MIT -- cgit v1.2.3