3e92d4acf6
新 SDD .agents/specs/data-exfil-warning/(richblack review 過)。
觸發策略:只在「資料變成可被外部呼叫」時警示(webhook 部署 / recipe push),
不管出站打別人 API(高頻低風險)。
- C 同意憑證(exposure-consent.ts):ExposureConsent{confirmed_by_human, understood,
confirmed_at, suppress_future};同意=法律憑證,存 record 可審
- A API 層:webhook 部署 + recipe push 首次需 consent,缺→403;首次問記住(server 端)
- B CLI(exposure-warning.ts):仿 GCP 刪 project,要打資源名確認(比 y/n 硬);
--confirm-exposure(非互動)/ --suppress-warning(不再警示,本選擇也 log);
非 TTY 無旗標→拒絕(AI 不替人類確認暴露);本機 config 記住已同意(不重問)
- H hook:pre-bash 偵測 acr push/recipe push 無旗標→exit 2(creds push/run 不誤擋)
- 警示是「保護措施入口」:提示 arcrun 可幫加認證/權限/限流(資安優勢)
驗收:非 TTY 拒絕未送出(exit1)、hook 精準擋放、tsc 雙邊綠。
⚠️ A+B 必須一起 deploy(API 層擋 + CLI 帶 consent),否則 push 中間狀態壞。
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 → 拒絕的輸出
|
||
- [ ] V3 webhook 部署 API 無 exposure_consent → 拒絕的輸出
|
||
- [ ] V4 同一 workflow 二次部署 → 不重問(已記住)
|
||
- [ ] V5 --suppress-warning 後 → 不再警示,但 suppress 選擇有 log
|
||
- [ ] V6 同意後 → exposure_consent 寫進 record 可查(法律憑證)
|
||
|
||
## 範圍邊界
|
||
- 不動用戶 API 入站保護機制(發 key/權限/限流)—— BACKLOG 待決策,本系統只在警示處「提示它存在」。
|
||
- 不擋出站 http 節點(不暴露我的資料)、不擋 acr run(本機)。
|