本卡屬 FR-187(母卡 CM-3711),第 2 批 D2:推送 Agent 升級與升級紀錄(主系統 repo
compliance-manager-be,7 檔/約 1181 行)。只掃不修。工作坊會用.claude/workshop-prompts/dispatch-<本卡號>.md當開場 prompt 直接啟動掃描,小弟不必自己打指令。
用 Claude Code 官方 claude-security plugin 掃「推送 Agent 升級與升級紀錄」這一塊,找出資安問題,寫成 PM 與新手工程師都看得懂的報告。只找問題、不修問題,修是另外開卡的事。
包下載好之後怎麼推出去:更新中心選幾台推、Agent 主控台自己按「請更新這一台」、長輪詢把升級指令交給 Agent、升級紀錄附件怎麼存與誰能下載。
推送是「讓遠端機器以高權限換掉自己的程式」。誰能推、推給誰、推哪一版,任何一個判斷錯了都是遠端執行。Agent 自己也能觸發推送,這條路要特別小心。
背景:這一輪掃的是 2026-11-01(FR-172 開案)到 11-09 之間主專案與 jedi-remote-agent 新寫或大改的程式(FR-171/172/178/179/180/181/182),這些程式都沒掃過。
app/product_update/service/agent_rollout_service.py
app/product_update/service/agent_rollout_views.py
core/plugins/_agent_console_update.py
core/plugins/_agent_update.py
api/remote_agent/routes/agent_update_request_route.py
api/remote_agent/routes/agent_update_log_route.py
core/plugins/_agent_update_log_ownership.py
檔數 7、約 1181 行。驗檔數:git -C <工作目錄> ls-files -- app/product_update/service/agent_rollout_service.py app/product_update/service/agent_rollout_views.py core/plugins/_agent_console_update.py core/plugins/_agent_update.py api/remote_agent/routes/agent_update_request_route.py api/remote_agent/routes/agent_update_log_route.py core/plugins/_agent_update_log_ownership.py | wc -l 應為 7。scope 外的檔不要讀,除非下面「重點看什麼」明寫「只追這幾行」;越界的發現首腦驗收時會挑掉。
首腦讀過程式碼後認為最容易出事的地方,是思考起點不是檢查清單,行號以 2026-11-09 的主線為準,對不上就以內容為準。工具不會照這份走,掃完後你要自己逐條對一遍:工具沒報的,開檔看一眼,寫「人工查過:成立/不成立/為什麼」。
agent_rollout_service.py:推送對象是使用者選的 agent_uid,跨子租戶的 uid 會不會被 RLS(每個客戶只能看自己資料的隔離機制)擋下;push 要的能力點。_agent_console_update.py:Agent 主控台能要求「請更新這一台」,走同一個 push。用 Agent 身分觸發時,版本由誰決定;能不能要求別台更新、或要求降版。_agent_update.py update_for_agent:長輪詢交給 Agent 的 update 指令內容(下載網址、sha256、簽過的清單);下載端點 /agents/update/bundle 會不會把包給 pending 或停用的 Agent。agent_update_request_route.py、agent_update_log_route.py:Agent 身分的端點,有沒有每支都掛 agent_pass_required。_agent_update_log_ownership.py:升級紀錄附件從 /file/download 拿只看讀取能力點+RLS;附件是 Agent 上傳的 tar.gz(被控的 Agent 能塞任意內容),瀏覽器下載時是不是強制下載而不是直接開。agent_rollout_views.py:回畫面的欄位有沒有帶 Agent 自報的錯誤字串原文、有沒有截長度。FR-077(2026-09)掃過 jedi-remote-agent 與主系統接線的舊版,FR-086 掃過檔案上傳下載,FR-177(2026-11-05~07)掃過 Agent 本體;結論在主系統 repo docs/features/security-scan-consolidated/README.md,只是參照,沒有經過本棒的三人投票。