三只貓
Rich Mindset Zone
richmindsetzone.com
← All posts

Agent 可審計性:點解 Enterprise 唔敢畀 AI 寫 Code?Flowtrace 的 git-backed audit trail 拆解

我哋身邊愈來愈多團隊用 AI agent 寫 production code,但有個好弔詭嘅現象:用得最癲嘅係 startup 同中型公司,而愈大嘅 enterprise 反而愈犹豫。唔係因為佢哋唔知 AI 慳時間,而係因為佢哋知得太多——尤其係 compliance team 入面嗰班人。

你諗下,一個銀行嘅 IT 主管,要說服合規委員會「OK 我哋以後用 AI 寫 core banking system 嘅 code」,委員會第一句一定會問:「出事嘅話,邊個負責?點解 AI 會咁寫?我哋點證明呢段 code 經過咩審批流程?」呢三個問題,就係 enterprise AI adoption 嘅死穴。

合規團隊嘅 Nightmare:AI 係一個黑洞

傳統 software development 嘅審計鏈好清晰:developer 寫 code → code review → merge → deploy。每個步驟都有人簽名、有 timestamp、有 JIRA ticket 對應。出事嗰陣,auditor 可以逐行 code 追返邊個寫、邊個 approve、點解咁寫。

但 AI agent 一介入,呢條鏈就斷咗。AI 寫完 code,你只見到最終結果,而唔知佢中間考慮過咩方案、做過咩 trade-off、睇過咩 context。如果 AI 引入咗一個 security vulnerability——比如話唔小心 expose 咗 API key,或者寫咗條有 SQL injection 風險嘅 query——你要點樣重構返個 decision-making process?

更恐怖嘅係,多數 AI agent 平台嘅 logging 係 ephemeral 嘅。Session 完咗,個 record 就消失。對於要保留 audit log 七年的 financial institution 嚟講,呢種「用完即棄」嘅設計完全唔合格。

Flowtrace 的解法:Git 本身就係最好嘅 Audit Trail

Flowtrace 嘅核心 insight 好簡單:既然 developer 世界已經用咗 git 幾十年嚟做 source of truth,點解唔直接用 git 嚟做 AI agent 嘅 audit trail?

每個 AI agent 嘅 operation——無論係寫 code、改 config、定係執行指令——都會被記錄成一個 commit 或者 commit chain。每個 commit 有 author(即係邊個 agent)、有 timestamp、有 parent commit(即係上一個 state)、有 message(即係 agent 嘅 reasoning)。呢個結構本身就係一條不可篡改嘅審計鏈。

而 Haft(Flowtrace 嘅底層引擎)更進一步:佢捕捉唔只係 final output,仲有 agent 嘅 intermediate states。即係話,你可以睇到 AI 係點樣由問題 A 思考到方案 B,中間 reject 咗咩 alternatives,最後點樣得出最終結果。呢種 granularity 對 auditor 嚟講係 goldmine。

Git-backed Audit Trail 點樣滿足 Enterprise Compliance

具體嚟講,Flowtrace 解決咗三個最頭痛嘅 compliance 問題。

第一,不可否認性(Non-repudiation)。 每個 agent action 都有 cryptographic signature 對應返去特定 session 同 agent identity。冇人可以話「唔係我做的」——因為 git commit hash 同 GPG signature 已經鎖死咗證據。

第二,可重現性(Reproducibility)。 Auditor 可以 checkout 返任何一個時間點嘅 codebase state,用返同一組 agent config 再行一次,睇下結果係咪一致。呢個係傳統 human developer workflow 做唔到嘅——你唔可能叫個 developer「重新諗多次」同一樣嘢。

第三,政策對應(Policy Mapping)。 Flowtrace 嘅 commit message 同 metadata 可以自動對應返公司嘅 internal policy ID。比如話公司有條 policy 話「所有 database schema change 必須要 DBA approve」,Flowtrace 可以 detect 到 agent 改咗 schema,然後自動 pause 條 pipeline,等 DBA 睇完先繼續。成個過程都有 git trail 記錄。

對香港創業者同開發者嘅啟示

我成日同朋友講:AI agent 唔係嚟取代 developer,而係嚟放大 developer。但放大之前,你要先解決信任問題。

如果你係香港嘅 tech startup 創辦人,而家就應該開始思考:你嘅 AI workflow 係咪 auditable?如果聽日有個 investor 或者 regulator 問你「你哋 production code 有幾多係 AI 寫嘅?點證明品質?」你答唔答得出?

實戰建議好簡單:無論你用緊邊個 AI agent platform,確保佢嘅 output 全部入 git。唔好信任何 ephemeral logging system。Git 係開發者世界最古老亦最可靠嘅 source of truth,而 Flowtrace 呢類工具正正係將 AI agent 嘅行為綁死在呢個信任基礎之上。

企業唔係怕 AI——企業怕嘅係控制唔到嘅野。當每個 agent action 都可以追溯、可以重現、可以對應返 policy,compliance team 自然會放行。呢個先係 AI code generation 真正進入 enterprise 嘅關鍵解鎖點。