本卡屬 FR-187(母卡 CM-3711),第 1 批 B:Agent 回報事件(狀態、日誌、升級進度、主控台稽核)(主系統 repo compliance-manager-be,10 檔/約 870 行)。只掃不修。工作坊會用 .claude/workshop-prompts/dispatch-<本卡號>.md 當開場 prompt 直接啟動掃描,小弟不必自己打指令。

這一棒在做什麼(白話)

用 Claude Code 官方 claude-security plugin 掃「Agent 回報事件(狀態、日誌、升級進度、主控台稽核)」這一塊,找出資安問題,寫成 PM 與新手工程師都看得懂的報告。只找問題、不修問題,修是另外開卡的事。

Agent 透過 POST /agents/events 回報各種事情:自己的狀態、錯誤日誌、升級進度與結果、主控台上有人做了什麼(寫進主系統稽核)。這一棒看主系統收下這些回報時信了多少。

為什麼切這一塊

Agent 裝在客戶機器上,要假設它可能被控制。被控的 Agent 如果能改到不該改的欄位、冒用主系統帳號名義寫稽核紀錄、或謊報「升級成功」,主系統的畫面與稽核紀錄就不可信。

背景:這一輪掃的是 2026-11-01(FR-172 開案)到 11-09 之間主專案與 jedi-remote-agent 新寫或大改的程式(FR-171/172/178/179/180/181/182),這些程式都沒掃過。

掃描範圍(scope,與開場 prompt 的 --scope 一致)

core/plugins/_agent_events.py
app/remote_agent/service/agent_event_dispatcher.py
api/remote_agent/routes/agent_events_route.py
core/plugins/_agent_status.py
core/plugins/_agent_logs.py
domain/support/service/agent_log_domain_service.py
infra/support/agent_log_repo_impl.py
app/product_update/service/agent_update_event_handlers.py
core/plugins/_agent_console_audit.py
core/plugins/_agent_error_tracking.py

檔數 10、約 870 行。驗檔數:git -C <工作目錄> ls-files -- core/plugins/_agent_events.py app/remote_agent/service/agent_event_dispatcher.py api/remote_agent/routes/agent_events_route.py core/plugins/_agent_status.py core/plugins/_agent_logs.py domain/support/service/agent_log_domain_service.py infra/support/agent_log_repo_impl.py app/product_update/service/agent_update_event_handlers.py core/plugins/_agent_console_audit.py core/plugins/_agent_error_tracking.py | wc -l 應為 10。scope 外的檔不要讀,除非下面「重點看什麼」明寫「只追這幾行」;越界的發現首腦驗收時會挑掉。

重點看什麼

首腦讀過程式碼後認為最容易出事的地方,是思考起點不是檢查清單,行號以 2026-11-09 的主線為準,對不上就以內容為準。工具不會照這份走,掃完後你要自己逐條對一遍:工具沒報的,開檔看一眼,寫「人工查過:成立/不成立/為什麼」。

已知背景