影子AI是新的影子IT:2026年代理清点、治理与欧盟AI法案合规

·阅读约16分钟·Evergreen Tools Team

💡 工具推荐落地代理治理时,用 Evergreen Tools 的 JSON格式化 校验注册表、正则测试器 匹配影子扫描规则、API测试器 验证治理接口!

几年前,员工自带的 SaaS 工具催生了「影子 IT」;2026 年,员工自建的 AI 代理正在催生「影子 AI」——未受管、未登记、可能正在处理客户数据。治理不再是原则问题,而是日期问题:欧盟 (EU) 2026/1744 号法规(数字综合法案)7 月 27 日生效,其中 Article 50 透明度义务从 2026 年 8 月 2 日起适用。本文用代理注册表、影子扫描与合规披露代码,讲清楚怎么把影子 AI 拉回阳光之下。

代理安全与治理

治理从原则变成了日期

一、影子 AI 为什么危险

代理与 SaaS 工具的本质区别是权限:代理能读文件、发消息、调 API、改数据。一个工程师用个人账号接入未受管的 MCP 服务器处理客户 PII,就是一起潜在的数据泄露事件。Microsoft Agent 365 的产品定位精准回应了这个痛点:发现并治理你未部署的代理(包括第三方与开源代理),注册表同步到 AWS Bedrock 与 Google Cloud,通过 Defender 与 Intune 检测影子 AI。第一步永远是「看见」——你无法治理看不见的东西。

二、建立代理注册表

代码示例1 是一份代理注册表的 JSON Schema:每个代理一行,包含所有者、部署来源(平台/部门/影子)、状态、数据类别、模型与 MCP 服务器。这份清单就是你的治理基线:审批通过的代理进入白名单,其余一律视为影子。无论你买 Agent 365 还是自己搭,Schema 都一样——关键是有且只有一个真相源。

// agent-registry.schema.json — the inventory every governed org needs
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["agentId", "owner", "status", "dataCategories"],
  "properties": {
    "agentId":        { "type": "string" },
    "name":           { "type": "string" },
    "owner":          { "type": "string" },
    "deployedBy":     { "enum": ["platform", "department", "shadow"] },
    "status":         { "enum": ["approved", "pending", "blocked", "retired"] },
    "dataCategories": { "type": "array", "items": { "type": "string" } },
    "model":          { "type": "string" },
    "mcpServers":     { "type": "array", "items": { "type": "string" } }
  }
}
# Agent 365 syncs its registry to AWS Bedrock and Google Cloud and
# detects shadow AI through Defender and Intune. The schema you need
# is the same whether you buy that or build it: one row per agent.

三、定期扫描未登记代理

代码示例2 是一个影子扫描脚本:枚举租户内运行的代理(MCP 端点、云函数、定时任务),与已批准注册表比对,输出未登记名单。Defender 与 Intune 在微软租户里做的就是这件事的规模化版本。注意目的不是「禁止代理」,而是「先看见,再决策」——扫描结果应该进入评审队列,而不是直接封杀。

# shadow-scan.py — find unregistered agents in your tenant
import json, subprocess, sys

KNOWN = set(json.load(open("agent-registry.json"))["approved"])

def list_running_agents():
    # Example: enumerate MCP endpoints, cloud functions, and scheduled jobs
    out = subprocess.run(["somectl", "list", "--json"], capture_output=True, text=True)
    return {row["id"]: row for row in json.loads(out.stdout)}

found = list_running_agents()
shadow = [aid for aid in found if aid not in KNOWN]

for aid in shadow:
    print(f"SHADOW: {aid} — not in approved registry")
print(f"summary: {len(shadow)} unregistered agent(s)")

# Defender and Intune do this at scale for Microsoft tenants.
# The point is not to block agents — it is to see them, then decide.

四、Article 50:没有被推迟的合规义务

欧盟数字综合法案(Regulation (EU) 2026/1744)于 2026 年 7 月 27 日生效,头条是「推迟」:Annex III 高风险系统(招聘、信用评分)推迟到 2027 年 12 月 2 日,嵌入受监管产品的 AI 推迟到 2028 年 8 月 2 日。但 Article 50 没有动——告知用户正在与 AI 系统交互、标记合成内容,从 2026 年 8 月 2 日起适用。代码示例3 是一个交互前的强制披露函数:聊天显示横幅、语音播放声明、邮件加前缀。

// article50.ts — enforce EU AI Act transparency before every interaction
type Interaction = { channel: "chat" | "voice" | "email"; synthetic?: boolean };

const DISCLOSURE = {
  en: "You are interacting with an AI system. Content may be AI-generated.",
  de: "Sie interagieren mit einem KI-System. Inhalte können KI-generiert sein.",
  fr: "Vous interagissez avec un système d'IA. Le contenu peut être généré par IA.",
};

export function beforeInteraction(i: Interaction) {
  // Article 50 (Regulation (EU) 2026/1744): transparency obligations
  // apply from 2 August 2026 — telling people they interact with AI
  // and marking synthetic content did NOT get postponed.
  if (i.channel === "voice") {
    return { play: DISCLOSURE.en, markSynthetic: i.synthetic ?? true };
  }
  if (i.channel === "email") {
    return { subjectPrefix: "[AI-GENERATED]", bodyNote: DISCLOSURE.en };
  }
  return { banner: DISCLOSURE.en };
}
# High-risk Annex III obligations moved to Dec 2, 2027; AI embedded in
# regulated products moved to Aug 2, 2028. The headline says delay —
# the obligation that touches marketing, HR and customer service did not.

五、让审计变成一条 SQL

治理的最后一块拼图是审计日志。代码示例4 的 agent_audit 表记录每次代理动作:谁、哪个代理、动了什么数据、是否获批。配合周度汇总查询,审计员问什么你都能用一条 SQL 回答。「治理从原则变成了日期」——而日期的另一面,是随时可查的证据链。

# audit-log.sql — every agent action, queryable for compliance
CREATE TABLE IF NOT EXISTS agent_audit (
  id            BIGSERIAL PRIMARY KEY,
  agent_id      TEXT NOT NULL,
  actor         TEXT NOT NULL,
  action        TEXT NOT NULL,
  data_scope    TEXT NOT NULL,      -- e.g. 'customer-pii' | 'internal-only'
  approved      BOOLEAN NOT NULL,
  occurred_at   TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- Weekly compliance rollup: who ran which agent on what data
SELECT agent_id, actor, data_scope, COUNT(*) AS actions
FROM agent_audit
WHERE occurred_at >= date_trunc('week', now())
GROUP BY agent_id, actor, data_scope
ORDER BY actions DESC;
# 'Governance stopped being a principle and became a date.'
# If an auditor asks, you can answer with one query.

六、总结

2026 年的影子 AI 治理路径清晰:注册表建立基线 → 定期扫描发现影子 → 合规披露守住底线(Article 50)→ 审计日志随时可查。欧盟把高风险义务推迟了,但透明度义务按时生效——这意味着所有面向欧盟用户的 AI 交互,今天就必须能说出「我是 AI」。这不是可选项,是日期。

云端治理与合规

注册表 → 扫描 → 披露 → 审计

📌 常见问题 FAQ

什么是影子 AI(shadow AI)?

员工未经 IT 批准自行使用或部署的 AI 工具与代理。与影子 IT 不同,代理拥有读文件、调 API、改数据的权限,风险更高。

如何发现影子 AI?

建立已批准代理注册表,定期扫描租户内的 MCP 端点、云函数与定时任务,比对差异。Microsoft Defender 与 Intune 提供规模化检测能力。

欧盟 AI 法案 2026 年有哪些关键日期?

(EU) 2026/1744 号法规 7 月 27 日生效;Article 50 透明度义务 2026 年 8 月 2 日起适用;Annex III 高风险义务推迟到 2027 年 12 月 2 日;受监管产品内嵌 AI 推迟到 2028 年 8 月 2 日。

Article 50 要求做什么?

告知用户正在与 AI 系统交互,并标记合成内容。适用于聊天、语音、邮件等面向用户的所有交互渠道,未被推迟。

Agent 365 如何帮助治理?

它发现并治理你未部署的代理(含第三方与开源),注册表同步 AWS Bedrock 与 Google Cloud,并通过 Defender/Intune 检测影子 AI。