GitHub 在 2026 年 11 月 6 日更新 Copilot Code Review,讓管理者可透過 REST 與 GraphQL API 從 enterprise policy、organization defaults 一路管理到 repository settings。API 回傳也能明確辨識 Copilot 的 review 與 comment、查看使用的 review effort,並在資料可得時知道某則 comment 引用了哪些 skills、MCP servers 或 custom instructions。
這個事件的重點不是「AI 會不會取代人工審查」,而是原本分散在介面的設定開始可以被盤點、套用與稽核。企業可以把預設 effort、runner、custom instructions 與 MCP 使用納入平台治理;同時也要處理 token 權限、設定繼承、AI credits、GitHub Actions minutes 與外部內容來源。API 自動化能提高一致性,但錯誤的中央設定也會更快擴散。
先畫清楚 enterprise、organization、repository 的責任
GitHub 公告列出的層級很明確:enterprise administrator 可啟用、停用或交由 organization 決定;organization administrator 可管理啟用狀態、預設 review effort 與 runner;repository administrator 可管理 effort,以及 review 是否使用 custom instructions 與 MCP tools。上層已管理的值不能被下層覆寫,所以盤點工具不能只讀 repository 後就推斷最終行為。
建議建立一份 effective configuration 報表,至少包含 repository owner、可用與實際 effort、custom instructions、MCP、automatic review、runner、billing source、budget owner 與最後變更時間。對繼承值與明確覆寫分開標示,否則 repository 顯示某個值時,維運人員很難判斷應在 repo、org 還是 enterprise 修正。
權限也有重要差異。官方公告指出 enterprise 與 organization 設定 endpoints,包括 organization runner endpoint,不支援 GitHub Apps 或 fine-grained personal access tokens;repository settings endpoints 則支援這兩者,讀取需要 Administration: read,更新需要 Administration: write。Classic PAT 需要 repository administrator access。這代表「用一個 GitHub App 管全公司所有層級」不一定可行,必須按官方支援的 token 類型拆分執行者與權限。
不要把管理 token 放在一般 repository secret,讓任意 workflow 都能呼叫。中央政策工具應放在受限制的管理 repository 或內部平台,啟用環境保護、最小權限、短期憑證與操作 log。先做 read-only inventory,再提供 plan 或 diff,最後才允許經核准的 update;每次修改保存 before、after、操作者與 API response。
Effort、品質與費用要一起決定
GitHub Docs 將 effort 分成 Lite、Balanced 與 Max;較高 effort 會做更深入的複雜邏輯、安全敏感與跨服務分析,也會使用更多 AI credits,並可能增加 GitHub Actions minutes。11 月 6 日的更新還說明 Balanced review 現在由三個 reviewer models 加上一個彙整模型處理。這不代表所有 PR 都應一律選最高 effort。
可以依風險分層:文件與低風險樣式調整用 Lite;權限、付款、資料遷移與跨服務契約用 Balanced 或 Max;超大 generated diff、lockfile 或官方列出的 excluded file types,則不能假設 Copilot 會完整覆蓋。repository 設定可限制 maximum effort,PR 規則再決定哪些路徑需要人工 code owner 與額外測試。
成本估算不要只算席次。官方文件說明 review 會消耗 AI credits,agentic context gathering 與工具使用也可能消耗 GitHub Actions minutes;自動 review 的計費歸屬還會依 PR author、手動 requestor、bot 或組織設定而不同。先用少量 repositories 觀察每種 PR 形狀的 credits 與 runner 用量,再設 organization 或 cost center budget。預算耗盡可能讓 review 被阻擋,因此 required workflow 不應把「Copilot 一定會回覆」當成無故障依賴。
MCP、skills 與 instructions 要能追溯
Code Review 可使用 repository-level skills、MCP servers、.github/copilot-instructions.md、path-specific instructions 與 AGENTS.md。新 attribution fields 讓團隊能在 comment 層次看到 Copilot 回報的來源,這對誤判調查很有用:某則建議若引用了過期規範或錯誤 service ownership,可以回頭修正來源,而不是只對 comment 按下負評。
但「有 attribution」不等於來源天然可信。MCP 可能連到 issue、incident、文件或 service catalog,內容權限與資料新鮮度仍需治理。只連接 review 真正需要的 server,限制可用工具與 scope,避免讓 pull request 中的非可信文字誘導工具讀取或傳送不必要資料。Custom instructions 應短而可測,寫清楚授權、資料處理、migration 與測試底線,不要塞入整本工程手冊。
GitHub 文件也指出 Code Review 讀取的是 head branch 上的 instructions 與 skills,而不是 base branch。這讓團隊可以在同一個 PR 測試新規則,但也表示攻擊者或一般 contributor 可能在變更中影響 review context。高風險 repository 應限制誰能修改 review instructions、skills 與 MCP configuration,並要求 CODEOWNERS 或 ruleset 對這些路徑進行人工核准。
漸進導入與驗收方式
第一階段只匯出現況,不寫入。選擇代表不同敏感度的 repositories,比對 API 結果與介面,確認 enterprise、org、repo 繼承關係。第二階段用 dry-run 產生設定差異,讓 repository owner 核對;第三階段才對少量非關鍵 repo 更新,並驗證 automatic review、bypass list、billing、runner 與 comment attribution。
每個試點準備固定 PR 樣本:一般程式錯誤、跨服務契約、權限缺陷、只改 excluded files、含過期 instruction,以及 MCP 暫時不可用。記錄 Copilot 是否啟動、使用的 effort、被跳過檔案、工具來源、credits、Actions minutes、失敗後是否重試,以及人工 reviewer 最後接受或駁回哪些 findings。11 月 6 日更新會讓 failed 或 timed-out review 自動重試一次,且可能切換其他 eligible model;告警與成本報表要能辨識重試,避免把兩次執行誤判成兩個獨立需求。
Copilot review 預設是 comment,不等於人工 approval,也不應替代 required checks、CODEOWNERS 或安全審查。若組織另行啟用 Copilot approval 並讓它計入 merge requirement,必須先決定哪些 repository 與路徑允許,並保留新 commit 後重新審查的規則。自動化設定應有明確回退:關閉 automatic request、降回較低 effort、停用 MCP 或恢復先前設定,而不是在事故時臨時尋找介面。
這次 API 更新最適合解決的是「設定散落、無法稽核」;它不會自動保證 review 正確,也不會替團隊定義風險。安全的導入順序是先盤點 effective settings,再建立少數可解釋的 policy,最後才自動套用。當每則建議的 effort、context、成本與權限來源都能被追查,Copilot Code Review 才能從個人便利工具變成可治理的工程流程。