f9071d153b
前一 commit message 提及 hook 但實際因 Edit old_string 不匹配未寫入。本 commit 補上: - pre-bash-guard 偵測 acr push / acr recipe push 無 --confirm-exposure/--suppress-warning → exit 2 - 精準排除 acr creds push(上傳加密 cred 是保護非暴露)、acr run/list 不誤擋 - 驗證:push/recipe push 無旗標=2、帶旗標=0、creds push/run/list=0 e2e(wrangler dev --local)三態全綠:webhook 無consent→403 / 帶consent→201 / 同wf再部署→201(首次問記住);recipe push 無consent→403 + 保護入口訊息。 tasks V3/V4/V6 標記。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
2.4 KiB
Markdown
41 lines
2.4 KiB
Markdown
# Tasks: 資料外流警示
|
||
|
||
> 對應 design.md(richblack 已 review,Q1-Q3 + 法律憑證 + 保護入口決議)。
|
||
> 每完成一個 task 立刻標 [x],不批次。
|
||
|
||
---
|
||
|
||
## 共用:同意憑證機制(§7 法律憑證)
|
||
- [x] C1 定義 `exposure_consent { confirmed_by, understood, confirmed_at, suppress_future }` 型別
|
||
- [x] C2 同意 log 寫入動作關聯的 record(webhook record / recipe record),可審
|
||
- [x] C3 「以後不要警示」(suppress_future)本身也 log(用戶知風險並接受)
|
||
|
||
## API 層警示(R1,防在後)
|
||
- [x] A1 webhook 部署(webhooks-named.ts POST)要 exposure_consent,缺且未 suppress → 拒絕 + 提示
|
||
- [x] A2 recipe push(/recipes POST)同上(公私一視同仁)
|
||
- [x] A3 首次暴露某資源問、記住(exposure_confirmed / suppress_future)→ 之後不重問(§3)
|
||
- [x] A4 警示訊息說明風險 + 盤資料源(盡力,盤不出標「請自行確認」)+ **提示 arcrun 保護措施**(§8)
|
||
|
||
## CLI 警示(互動 + 旗標)
|
||
- [x] B1 `acr push`:部署前互動式警示(首次某 workflow),人類確認組 exposure_consent 送出;`--confirm-exposure` 跳過互動(CI/非 TTY);`--suppress-warning` 記偏好
|
||
- [x] B2 `acr recipe push`:同上
|
||
- [x] B3 非 TTY(AI 直跑)無 --confirm-exposure → 拒絕並提示「需人類確認暴露」
|
||
|
||
## hook(R2,防在前,Q3=偵測指令)
|
||
- [x] H1 pre-bash-guard:偵測 `acr push` / `acr recipe push` → 警示「這會把 X 變可被外部呼叫,需人類確認」
|
||
|
||
## mindset / 文件
|
||
- [ ] M1 誠實限制(AI 能偽造 confirmed_by_human,靠憑證可審 + 法律歸責)寫進 mindset Skill(步驟 7)+ 文件
|
||
|
||
## 驗收
|
||
- [ ] V1 acr push 部署 webhook(首次)→ 互動警示 + 說明暴露 + 提示保護 的終端輸出
|
||
- [x] V2 非 TTY 跑 acr push 無 --confirm-exposure → 拒絕的輸出
|
||
- [x] V3 webhook 部署 API 無 exposure_consent → 拒絕的輸出
|
||
- [x] V4 同一 workflow 二次部署 → 不重問(已記住)
|
||
- [ ] V5 --suppress-warning 後 → 不再警示,但 suppress 選擇有 log
|
||
- [x] V6 同意後 → exposure_consent 寫進 record 可查(法律憑證)
|
||
|
||
## 範圍邊界
|
||
- 不動用戶 API 入站保護機制(發 key/權限/限流)—— BACKLOG 待決策,本系統只在警示處「提示它存在」。
|
||
- 不擋出站 http 節點(不暴露我的資料)、不擋 acr run(本機)。
|