Nº11 · Independent rebuild · private repo独立重建 · 私有仓库Privacy & policy platform · Sep 2026隐私与策略平台 · 2026 年 9 月
AI Governance Platform
Detect personal data in what employees send to AI tools, decide allow / mask / watch / block, and keep an audit trail no one can quietly edit.检测员工发往 AI 工具内容中的个人数据,决定放行 / 脱敏 / 观察 / 拦截,并保留无法被悄悄修改的审计记录。
- AI-tool eventAI 工具事件
- OutboxOutbox
- Worker · row lockWorker · 行锁
- Policy decides策略判定
- Incident + audit chain事件 + 审计链
SECTION · AI GOVERNANCE PLATFORMDesign view · code private设计视图 · 代码私有
01Problem问题
AI-usage governance needs three things to hold at once: detection that works in English and Chinese, policy decisions that are deterministic, and an audit history that survives worker crashes and retries.AI 使用治理需要同时成立三件事:中英文都可用的检测、确定性的策略判定、以及在 worker 崩溃和重试后依然正确的审计历史。
02What I built我做了什么
- Policy engine as one pure function over the event and policy set, so every decision is reproducible.策略引擎是对事件与策略集的一个纯函数,每次判定都可复现。
- Separate governance and PII-detection APIs with role-based access; audit records keep categories, hashes and offsets, never the raw input text.治理 API 与 PII 检测 API 分开部署,按角色控制访问;审计记录只保留类别、哈希和位置,从不保存原始输入文本。
- Ingestion through a Postgres transactional outbox; workers claim events with
SKIP LOCKEDand record findings and incidents in a hash-chained history.通过 Postgres 事务性 outbox 接入;worker 用SKIP LOCKED领取事件,把发现与事件写入哈希链历史。 - Found and fixed a lease-expiry race: a stalled worker could finish an event another worker had already processed. It now locks the row and proceeds only while the status is still processing.发现并修复租约过期竞态:卡住的 worker 可能重复处理别人已完成的事件。现在会锁行,且仅在状态仍为 processing 时继续。
- Credentials use envelope encryption; 17 architecture decision records document each choice.凭据使用信封加密;17 份架构决策记录说明每个选择。
03Architecture架构
04Measured测量结果
213
API tests (pytest, collected)API 测试(pytest 收集)
src · governance-platform/apps/api/tests (private)
30
detector tests检测器测试
src · governance-platform/apps/detector/tests (private)
17
architecture decision records架构决策记录
src · governance-platform/docs/adr (private)
5,466
synthetic bilingual records in the CI benchmarkCI 基准中的合成双语记录
src · governance-platform/evals (private)
05Limits, stated plainly局限,直说
- AWS infrastructure is designed in OpenTofu, not deployed. Throughput has only been measured locally.AWS 基础设施以 OpenTofu 设计,未部署;吞吐量仅在本地测量。