领域深度 · 安全与合规Field guide · Safety and compliance

AI 安全与合规:从数据流到上线门禁AI safety and compliance: from data flow to a launch gate

很多团队给客服机器人加一句“不要泄露用户信息”,就当安全做完了。真出事时,问题通常不在那句话,而在机器人能读哪些订单、能把什么内容发给谁、日志里又留了多久。先把保护对象和数据流画出来,再谈护栏。Many teams add “do not leak user data” to a support bot and call safety done. When something goes wrong, the problem is rarely that sentence. It is which orders the bot can read, who it can send what to, and how long the logs keep it. Draw the assets and data flow before talking about guardrails.

适合谁For 要把 AI 功能接进真实业务、需要过评审的人Anyone connecting an AI feature to real business and facing review 读完能拿到You leave with 一张数据流图、一张权限表,和一张上线前证据清单A data-flow map, a permission table and a pre-launch evidence checklist 大概多久Time 先读 15 分钟;做一次最小评审约 1 天15 minutes to read; about a day for a minimum review 最后核对 2026-11-25Last checked 25 Nov 2026

本页是 Specul 的防御性安全与合规判断框架,不是法律意见,也不是渗透、攻击或规避方法的教程。具体义务、许可与合规结论以适用法律、监管解释、合同与原始来源为准。This is Specul’s defensive safety and compliance framework, not legal advice or a tutorial in penetration, attack or evasion. Specific obligations, licences and compliance conclusions remain with applicable law, regulator interpretations, contracts and original sources.

如果你只有 5 分钟If you only have five minutes
  1. 先定保护对象:人、数据、钱、可用性、声誉、法律责任。Name the assets first: people, data, money, availability, reputation and legal exposure.
  2. 把数据从哪进、经过谁、存到哪、谁还能读画出来。Map where data enters, who touches it, where it is stored and who can still read it.
  3. 护栏分输入、输出、检索、工具四层,每层都要能验证。Guardrails sit at four layers: input, output, retrieval and tools. Each layer needs a test.

完整版从下面开始;表格是查的时候用,不用背。The full guide starts below. Use the tables for reference; you do not need to memorise them.

拿一个具体活走一遍One concrete job

假设一个具体活:公司要把知识库问答机器人接进飞书,能读合同、能发消息、能查客户订单。先画数据流,再决定哪些工具默认关闭。Take one concrete job: a knowledge-base bot inside Feishu that can read contracts, send messages and look up customer orders. Draw the data flow first, then decide which tools are off by default.

不能落到数据流、权限和证据的安全,只是口号。不能复跑的评测,只是意见。Safety that does not reach data flow, permissions and evidence is a slogan; evaluation that cannot rerun is an opinion.

1 · 先定保护对象:人、数据、钱、可用性、声誉、法律责任1 · Define what to protect: people, data, money, availability, reputation, legal exposure

“AI 安全”太宽,宽到无法验收。先列保护对象:用户的人身与心理安全、个人信息与商业机密、账户与资金、服务可用性、品牌声誉、法律与合同义务。每个对象对应不同伤害、不同攻击面和不同证据。只写“防止有害内容”,会漏掉数据外泄、工具越权、账号接管和服务中断。“AI safety” is too broad to accept. List the assets: users’ physical and psychological safety, personal and commercial data, accounts and funds, service availability, brand reputation, legal and contractual obligations. Each has different harms, exposure and evidence. Writing only “prevent harmful content” misses data exfiltration, tool overreach, account takeover and outage.

保护对象要写成一句可验证的话:“不让客服 Agent 读取其他租户的订单”“不让生成结果直接执行 shell”“不让未审核的模型输出进入对外邮件”。越具体,越能设计权限、评测和告警。Write each asset as a testable sentence: “the support agent must not read another tenant’s orders”, “generated output must not execute a shell”, “unreviewed model output must not enter outbound email”. The more specific, the easier to design permissions, evaluation and alerts.

保护对象Asset伤害Harm攻击面Exposure证据Evidence
人People骚扰、歧视、自伤诱导、隐私侵犯Harassment, discrimination, self-harm inducement, privacy对话、推荐、生成、数字人Dialogue, recommendation, generation, avatars红队样本、人工复核、事件记录Red-team samples, human review, incident log
数据Data个人信息、商业机密、训练数据外泄Personal data, trade secrets, training-data leak检索、工具、日志、缓存、第三方Retrieval, tools, logs, caches, third parties数据流图、访问日志、DLLP 测试Data-flow map, access logs, DLP tests
钱 / 账户Money / accounts欺诈、未授权交易、额度滥用Fraud, unauthorised transactions, quota abuse支付工具、API Key、会话接管Payment tools, API keys, session takeover审批记录、限额、对账Approval records, limits, reconciliation
可用性Availability服务中断、成本失控、资源耗尽Outage, runaway cost, resource exhaustion长上下文、批量调用、重试风暴Long context, batch calls, retry storms压测、限流、成本曲线Load test, rate limits, cost curve
声誉Reputation错误回答、品牌冒犯、合成内容争议Wrong answers, brand offence, synthetic-media controversy对外发布、社交媒体、数字人Publication, social media, avatars发布前评审、标注、撤回记录Pre-release review, labelling, withdrawal log
法律 / 合同Legal / contract违反许可、隐私、行业监管或客户合同Licence, privacy, sector rules or client contract breach数据来源、模型条款、跨境、留存Data sources, model terms, transfer, retention规则登记、合同、审计证据Rule register, contracts, audit evidence
保护对象写不成一句可验证的话,后面的护栏就没有验收标准。If the asset cannot be written as one testable sentence, the guardrail has no acceptance criterion.

↑ 回到目录↑ Back to contents

2 · 画数据流:数据从哪进、经过谁、存到哪、谁还能读2 · Draw the data flow: where data enters, who sees it, where it rests, who can still read it

先画一张图:用户输入 → 应用 → 模型/检索 → 工具/第三方 → 日志/缓存 → 输出。每个箭头标明数据类型、信任边界、加密状态、保留期限和负责人。没有这张图,权限、脱敏、留存和跨境都只能靠猜。Draw one map: user input → application → model/retrieval → tools/third parties → logs/caches → output. Label every arrow with data type, trust boundary, encryption, retention and owner. Without it, permissions, redaction, retention and cross-border transfer are guesswork.

信任边界不是“内网 / 外网”两个框。模型输出进入工具参数、检索结果进入提示、日志进入分析平台、第三方子处理者接触数据,都是边界。每跨一次边界,都要重新问:这条数据还需要原样保留吗?谁能读?留多久?A trust boundary is not just “internal / external”. Model output entering tool arguments, retrieval results entering prompts, logs entering analytics and subprocessors touching data are all boundaries. At each crossing ask again: does this data still need to be kept in full, who may read it, and for how long?

环节Stage经过什么数据Data边界问题Boundary question要写清什么Record
输入Input用户文本、文件、语音、图像User text, files, audio, images是否含个人信息、机密、未成年人Personal data, secrets, minors采集目的、告知、保留期限Purpose, notice, retention
应用Application会话、用户 ID、权限、配置Session, user ID, permissions, config谁能读、能否跨租户Who can read, cross-tenant access租户隔离、最小权限Tenant isolation, least privilege
模型 / 检索Model / retrieval提示、上下文、知识库片段Prompts, context, knowledge chunks是否包含越权文档、缓存残留Over-permissioned documents, cache residue检索过滤、上下文清理Retrieval filtering, context clearing
工具 / 第三方Tools / third parties参数、结果、凭证、回调Arguments, results, credentials, callbacks工具权限、出网、子处理者Tool scope, egress, subprocessors逐工具作用域、审批、审计Per-tool scope, approval, audit
日志 / 缓存Logs / caches原文、摘要、错误、指标Raw text, summaries, errors, metrics是否二次留存敏感数据Secondary retention of sensitive data脱敏、访问控制、保留期Redaction, access control, retention
输出Output回答、文件、图像、动作Answers, files, images, actions是否可直接执行、发布、外发Direct execution, publication, outbound人工确认、引用、标识Human confirmation, citation, labelling
每跨一次信任边界,都要重新问:还需要原样保留吗?At every trust boundary, ask again whether the data still needs to be kept in full.

↑ 回到目录↑ Back to contents

3 · 威胁模型:按场景列,不按“模型好坏”列3 · Threat model: enumerate by scenario, not by model quality

威胁模型要写“谁、在什么入口、想达到什么、需要什么条件”。提示注入、工具滥用、数据外泄、不安全输出、供应链、资源耗尽、过度依赖和隐私推断,都是场景问题,不是“模型不够安全”一句话。模型换强了,工具权限和出网边界仍然可能让问题成立。A threat model says who, through which entry point, wants what, under which conditions. Prompt injection, tool abuse, data exfiltration, insecure output, supply chain, resource exhaustion, overreliance and privacy inference are scenario problems, not one line about “the model not being safe enough”. A stronger model does not fix tool permissions or egress boundaries.

每个威胁配一个先验指标和一个缓解措施,再配一个“怎么知道它失败了”的检测。没有检测的缓解,只是假设。没有先验指标的检测,只会淹没在告警里。Pair each threat with an observable indicator, a mitigation and a way to know it failed. A mitigation without detection is an assumption; detection without an indicator drowns in alerts.

威胁Threat场景Scenario先验指标Indicator缓解与检测Mitigation and detection
提示注入Prompt injection网页、文档、邮件、工具返回内容进入提示Web pages, documents, email or tool results enter the prompt指令性文本命中、越权工具调用Instruction-like text hits, out-of-scope tool calls来源标记、指令隔离、工具白名单;记录触发样本Source marking, instruction isolation, tool allowlist; log triggers
工具滥用Tool abuse模型可发消息、改数据、付款、执行代码Model can message, mutate data, pay or execute code高权限工具调用、异常参数、频率High-privilege calls, unusual arguments, rate最小权限、人工确认、限额;审计每次调用Least privilege, human confirmation, quotas; audit each call
数据外泄Data exfiltration检索、日志、错误信息、第三方回调Retrieval, logs, errors, third-party callbacks敏感字段出现在输出/日志/出网Sensitive fields in output, logs or egress字段级脱敏、出网白名单、DLP 告警Field-level redaction, egress allowlist, DLP alerts
不安全输出Insecure output生成代码、命令、配置、HTML 被直接执行Generated code, commands, config or HTML executed directly未转义、危险参数、权限过高Unescaped output, dangerous arguments, excess privilege沙箱、转义、静态校验、人工复核Sandbox, escaping, static checks, human review
供应链Supply chain模型、插件、依赖、数据集来源不明Unknown model, plugin, dependency or dataset版本突变、权限扩张、来源缺失Version drift, permission growth, missing provenance锁版本、验签名、许可与来源清单Version pinning, signature checks, licence and provenance manifest
资源耗尽Resource exhaustion长上下文、批量请求、重试风暴Long context, batch requests, retry storms成本曲线、队列延迟、错误率Cost curve, queue latency, error rate配额、超时、退避、熔断;成本告警Quotas, timeouts, backoff, circuit breaker; cost alerts
过度依赖Overreliance用户把生成结果当成事实或专业意见Users treat output as fact or professional advice无引用、无确认、纠错率No citations, no confirmation, correction rate引用、置信提示、人工确认、领域边界Citations, confidence cues, human confirmation, domain limits
隐私推断Privacy inference模型从公开或半公开数据推断个人属性Model infers personal attributes from public or semi-public data敏感属性推断、重识别风险Sensitive-attribute inference, re-identification用途限制、输出过滤、禁止推断清单Use limits, output filters, no-inference list
每个威胁都要有指标、缓解和检测。三者缺一,都是假设。Every threat needs an indicator, a mitigation and a detection. Missing one leaves an assumption.

↑ 回到目录↑ Back to contents

4 · 权限与工具:默认不给,逐项开口子4 · Permissions and tools: deny by default, open one scope at a time

Agent 的风险主要不在“说了什么”,在“能做什么”。文件读写、发消息、改数据库、付款、执行代码、访问内网,每一项都要单独授权、单独限额、单独审计。默认全禁,按任务开最小作用域。能用只读就不用写,能草稿就不能直接发送,能沙箱就不能碰生产。Agent risk sits less in what it says than in what it can do. File access, messaging, database mutation, payment, code execution and intranet access each need separate authorisation, quota and audit. Deny by default, open the minimum scope per task: read-only before write, draft before send, sandbox before production.

高风险动作要有人工确认,而且确认要看到“具体参数、影响范围、不可逆性”,不能只点“同意”。密钥不进提示、不进日志、不进模型上下文。工具凭据按用户、按会话、按任务隔离,任务结束即回收。High-risk actions need human confirmation that shows the exact arguments, impact and reversibility, not a generic “agree” button. Secrets do not enter prompts, logs or model context. Tool credentials are isolated per user, session and task, and revoked when the task ends.

默认拒绝
怎么做:工具清单默认关闭,按任务申请
验收:新任务没有多余工具
Deny by default
How: Tool list off by default; request per task
Acceptance: No extra tools on a new task

最小作用域
怎么做:只读、单目录、单收件人、单额度
验收:越界调用被拒绝并记录
Least scope
How: Read-only, one directory, one recipient, one quota
Acceptance: Out-of-scope calls rejected and logged

人工确认
怎么做:展示参数、影响、是否可逆
验收:确认记录能回溯到具体动作
Human confirmation
How: Show arguments, impact and reversibility
Acceptance: Record traces to the exact action

沙箱
怎么做:代码、文件解析、浏览器在隔离环境
验收:不能读宿主凭证、不能任意出网
Sandbox
How: Code, file parsing and browser in isolation
Acceptance: Cannot read host credentials or roam the network

出网白名单
怎么做:只允许必要域名与协议
验收:未知域名被阻断并告警
Egress allowlist
How: Only necessary domains and protocols
Acceptance: Unknown domains blocked and alerted

凭据隔离
怎么做:短期令牌、按会话、任务后回收
验收:日志与上下文中无明文密钥
Credential isolation
How: Short-lived tokens, per session, revoked after task
Acceptance: No plaintext secrets in logs or context

限额与熔断
怎么做:按用户/任务/时间限制调用与花费
验收:异常峰值自动停
Quotas and breaker
How: Limit calls and spend per user, task and time
Acceptance: Automatic stop on abnormal spikes

默认不给,逐项开口子。能用只读就不用写,能草稿就不直接发送。Deny by default and open one scope at a time: read-only before write, draft before send.

↑ 回到目录↑ Back to contents

5 · 护栏:输入、输出、检索、工具四层,各有边界5 · Guardrails: input, output, retrieval and tools each have limits

护栏不是单一分类器。输入层做意图与来源检查,检索层做权限与新鲜度过滤,输出层做 schema、转义、引用与敏感信息检查,工具层做参数校验与作用域。每层都要知道“挡什么、不挡什么”,否则会把正常请求误杀,或者把绕过留给下一层。A guardrail is not one classifier. Input checks intent and source; retrieval filters permission and freshness; output checks schema, escaping, citations and sensitive data; tools validate arguments and scope. Each layer must state what it blocks and what it does not, or it will kill legitimate requests or leave bypasses to the next layer.

分类器有假阳性和假阴性,不能当唯一门槛。高风险场景要叠加规则、人工复核、限额和审计。低风险场景也不要无限拦截,否则用户会学会绕过。护栏的验收要同时看拦截率、误杀率、延迟和可解释记录。Classifiers have false positives and false negatives and cannot be the only gate. High-risk cases combine rules, human review, quotas and audit; low-risk cases must not be blocked indefinitely, or users learn to bypass. Acceptance measures block rate, false-positive rate, latency and explainable records together.

输入
挡什么:明显违规意图、超大输入、可疑文件
不挡什么:语义改写、跨轮诱导
验收:拦截率、误杀率、延迟
Input
Blocks: Clearly disallowed intent, oversized input, suspicious files
Does not block: Paraphrase, multi-turn inducement
Acceptance: Block rate, false positives, latency

检索
挡什么:越权文档、过期版本、未授权来源
不挡什么:文档内部的错误事实
验收:权限命中、引用可回原文
Retrieval
Blocks: Over-permissioned documents, stale versions, unauthorised sources
Does not block: Wrong facts inside an authorised document
Acceptance: Permission hits, citation resolves to source

输出
挡什么:敏感字段、未转义代码、无引用断言
不挡什么:语气、隐喻、上下文误导
验收:schema 通过、DLP 命中、引用率
Output
Blocks: Sensitive fields, unescaped code, uncited claims
Does not block: Tone, metaphor, contextual misleading
Acceptance: Schema pass, DLP hits, citation rate

工具
挡什么:越界参数、危险命令、未知域名
不挡什么:工具返回的恶意内容
验收:拒绝记录、沙箱、人工确认
Tools
Blocks: Out-of-scope arguments, dangerous commands, unknown domains
Does not block: Malicious content returned by a tool
Acceptance: Rejection log, sandbox, human confirmation

护栏要写“挡什么、不挡什么”。只写“更安全”无法验收。A guardrail must state what it blocks and what it does not. “Safer” is not an acceptance criterion.

↑ 回到目录↑ Back to contents

6 · 评测与红队:用可复跑的题集,不用一次性演示6 · Evaluation and red teaming: a rerunnable set, not a one-off demo

安全评测要有题集、评分器、阈值和复跑记录。题集覆盖正常、边界、对抗、跨语言、多轮和工具场景。评分器可以是规则、人工或模型辅助,但必须知道一致性。阈值要区分“必须拦截”“可以提示”“允许通过”。只拿几个成功案例做演示,不叫评测。Safety evaluation needs an item set, scorer, thresholds and rerun records. Items cover normal, boundary, adversarial, multilingual, multi-turn and tool scenarios. The scorer can be rules, humans or a model, but its agreement must be known. Thresholds separate “must block”, “may warn” and “allowed”. A few successful demos is not an evaluation.

红队的目标是找“系统在真实链路里怎么失败”,不是收集一堆提示词。每次红队记录入口、权限、模型版本、工具配置、预期结果和实际结果。修复后复跑同一题,确认不是换了一个模型碰巧挡住。Red teaming looks for how the system fails in the real chain, not for a pile of prompts. Record entry point, permissions, model version, tool config, expected and actual result. After a fix, rerun the same item to confirm it is not a different model happening to block it.

题集
要写什么:正常、边界、对抗、多轮、跨语言、工具
验收:每类有最小样本量与来源
Item set
Write: Normal, boundary, adversarial, multi-turn, multilingual, tool
Acceptance: Minimum sample size and source per class

评分器
要写什么:规则/人工/模型辅助、判定标准
验收:一致性可测、争议可裁决
Scorer
Write: Rules, human or model-assisted; criteria
Acceptance: Agreement measurable, disputes adjudicable

阈值
要写什么:必须拦截、可以提示、允许通过
验收:阈值与风险等级绑定
Threshold
Write: Must block, may warn, allowed
Acceptance: Threshold tied to risk tier

红队
要写什么:入口、权限、配置、实际链路
验收:发现可复现、修复可复跑
Red team
Write: Entry, permissions, config, real chain
Acceptance: Findings reproducible, fixes rerunnable

回归
要写什么:每次模型/提示/工具变更复跑
验收:分数不降、旧问题不复活
Regression
Write: Rerun on every model, prompt or tool change
Acceptance: No score drop, old issues do not return

留痕
要写什么:版本、日期、样本、结果、负责人
验收:能回到同一题与同一配置
Record
Write: Version, date, samples, results, owner
Acceptance: Trace to the same item and config

红队不是收集提示词。是找真实链路里的可复现失败。Red teaming is not collecting prompts; it is finding reproducible failures in the real chain.

↑ 回到目录↑ Back to contents

7 · 监控、日志与事件响应:先能发现,再谈止损7 · Monitoring, logs and incident response: detect before containing

日志要能回答“谁在什么时候让哪个模型、用哪个工具、读了哪些数据、做了什么动作、结果如何”。但日志本身也是敏感数据:原文、提示、工具参数可能含个人信息或机密。要脱敏、分权、设保留期,并限制谁能读。Logs must answer who, when, which model, which tool, which data, which action and what result. But logs are also sensitive: raw text, prompts and tool arguments may contain personal or confidential data. Redact, restrict access, set retention and limit who can read them.

事件响应要有分级、止损、取证、通知和复盘。先能一键停用某个工具/模型/租户,再谈追根因。先保存证据,再清理现场。通知对象和时限写进 runbook。没有 kill switch 和回滚,监控只能看见事故变大。Incident response needs severity, containment, evidence, notification and review. First be able to disable one tool, model or tenant; then investigate. Preserve evidence before cleaning up, and write notification audiences and deadlines into the runbook. Without a kill switch and rollback, monitoring only watches the incident grow.

日志字段
最小要求:用户/租户、模型版本、工具、参数摘要、结果、耗时
验收:能还原一次完整调用
Log fields
Minimum: User/tenant, model version, tool, argument summary, result, latency
Acceptance: Reconstruct one full call

脱敏
最小要求:提示与参数中的个人信息、密钥、机密
验收:抽样无明文敏感字段
Redaction
Minimum: Personal data, secrets, confidential data in prompts and arguments
Acceptance: Sampled logs contain no plaintext sensitive fields

告警
最小要求:权限越界、异常出网、成本峰值、错误率
验收:有阈值、有负责人、有降噪
Alerting
Minimum: Scope violations, unusual egress, cost spikes, error rate
Acceptance: Threshold, owner, noise control

止损
最小要求:按工具/模型/租户停用
验收:一键生效、可回滚
Containment
Minimum: Disable per tool, model or tenant
Acceptance: One action works, rollback available

取证
最小要求:时间线、版本、调用记录、影响范围
验收:可导出、可复核
Evidence
Minimum: Timeline, versions, calls, affected scope
Acceptance: Exportable, reviewable

通知 / 复盘
最小要求:监管、客户、用户、内部
验收:对象与时限写进 runbook
Notification / review
Minimum: Regulator, client, user, internal
Acceptance: Audiences and deadlines in the runbook

没有 kill switch 和回滚,监控只能看着事故变大。Without a kill switch and rollback, monitoring only watches the incident grow.

↑ 回到目录↑ Back to contents

8 · 供应商与模型变更:把“能力”与“义务”分开核8 · Vendors and model changes: check capability and obligation separately

模型供应商不只是“能力提供方”,还是数据处理者、子处理者和服务连续性的承担方。要核数据驻留与跨境、日志与训练使用、子处理者清单、安全认证、模型版本变更通知、服务等级、退出与数据导出。能力评测再好,不能替代合同与数据处理条款。A model vendor is not only a capability provider but also a data processor, subprocessor and continuity party. Check residency and transfer, logging and training use, subprocessor list, security certifications, model-version change notice, service levels, exit and data export. A good capability evaluation does not replace contract and data-processing terms.

模型升级会改变输出、成本和失败模式。每次版本变更要复跑安全题集、回归业务评测、核对价格与限额,再决定是否切换。不要因为“新模型更强”就跳过发布门禁。A model upgrade changes output, cost and failure modes. On every version change, rerun the safety set, regress the business evaluation, check pricing and quotas, then decide. Do not skip the release gate because “the new model is stronger”.

数据驻留 / 跨境
要看什么:区域、存储、备份、跨境路径
不能替代:“全球服务”一句话
Residency / transfer
Look for: Region, storage, backup, transfer path
What does not substitute: One line saying “global service”

训练使用
要看什么:是否用客户数据训练、能否关闭
不能替代:隐私政策摘要
Training use
Look for: Whether customer data trains the model, whether it can be disabled
What does not substitute: A privacy-policy summary

子处理者
要看什么:清单、变更通知、责任链
不能替代:主合同一家签
Subprocessors
Look for: List, change notice, responsibility chain
What does not substitute: One main contract

安全证据
要看什么:认证、审计报告、漏洞响应
不能替代:产品页徽章
Security evidence
Look for: Certifications, audit reports, vulnerability response
What does not substitute: A badge on the product page

版本变更
要看什么:通知周期、弃用、回滚
不能替代:“自动升级”
Version change
Look for: Notice period, deprecation, rollback
What does not substitute: “Automatic upgrade”

退出 / 导出
要看什么:数据导出格式、期限、删除证明
不能替代:口头承诺
Exit / export
Look for: Export format, deadline, deletion proof
What does not substitute: A verbal promise

能力评测不能替代合同与数据处理条款。模型升级必须重跑门禁。A capability evaluation does not replace contract and data-processing terms; every model upgrade reruns the gate.

↑ 回到目录↑ Back to contents

9 · 合规:规则、证据、责任人三列,不写“应该没问题”9 · Compliance: rules, evidence and owners in three columns, not “should be fine”

合规不是一张通用清单。先登记适用规则:法律、监管解释、行业规范、客户合同、平台条款、内部政策。每条写适用范围、义务、证据、责任人、复核日。不同司法辖区与行业可能同时适用,冲突时找专业意见,不在页面上替读者下结论。Compliance is not one universal checklist. Register applicable rules: statutes, regulator interpretations, sector norms, client contracts, platform terms and internal policy. For each, write scope, obligation, evidence, owner and review date. Different jurisdictions and sectors may apply at once; when they conflict, seek professional advice rather than concluding on this page.

证据要能独立复核:政策版本、培训记录、评审纪要、日志样本、合同条款、测试报告。只写“已合规”拿不出可复核的证据,审计时过不了。规则会变,复核日到了要重新核,不要把一次结论用三年。Evidence must be independently reviewable: policy versions, training records, review minutes, log samples, contract clauses, test reports. “Compliant” without evidence is nothing in an audit. Rules change; when the review date arrives, check again rather than reusing one conclusion for three years.

规则
写什么:名称、条款、适用范围、生效日
例子:某行业隐私规则适用于客服对话
Rule
Write: Name, clause, scope, effective date
Example: A sector privacy rule applies to support chats

义务
写什么:必须做/不得做/需告知/需留存
例子:保存授权记录并支持删除
Obligation
Write: Must do, must not do, must notify, must retain
Example: Keep authorisation records and support deletion

证据
写什么:文件、日志、测试、合同、纪要
例子:季度权限审计与样本
Evidence
Write: Documents, logs, tests, contracts, minutes
Example: Quarterly permission audit and samples

责任人
写什么:谁维护、谁签字、谁复核
例子:安全负责人 + 业务负责人
Owner
Write: Who maintains, signs and reviews
Example: Security owner plus business owner

复核日
写什么:下次核对时间与触发条件
例子:法规变化、模型升级、事故后
Review date
Write: Next check and trigger
Example: Rule change, model upgrade, incident

合规写三列:规则、证据、责任人。只写“已合规”却拿不出证据,审计时过不了。Write three columns: rule, evidence and owner. “Compliant” alone is no evidence.

↑ 回到目录↑ Back to contents

10 · 发布门禁:风险分级、证据清单、签字与回滚10 · Release gate: risk tier, evidence list, sign-off and rollback

发布门禁不是“安全团队点个头”。先按风险分级:是否面向公众、是否处理个人信息、是否能花钱/改数据/执行代码、是否面向未成年人、是否受行业监管。级别决定需要哪些证据、谁签字、灰度范围和回滚条件。A release gate is not a nod from the security team. Tier the risk first: public-facing, personal data, ability to spend money, mutate data or execute code, minors, sector regulation. The tier determines evidence, signatories, rollout scope and rollback conditions.

门禁要允许“带条件上线”,但条件必须具体、可核查、有时限:比如只对内部开放、只读、每日人工抽检 50 条、两周后复核。禁止用“先上线再说”绕过。也禁止用“永久例外”代替修复。The gate may allow a conditional launch, but conditions must be specific, checkable and time-bound: internal only, read-only, 50 manual samples daily, review in two weeks. Do not bypass with “launch first” or replace a fix with a permanent exception.

低
典型场景:内部草稿、只读、无个人数据
最低证据:基本评测、使用边界
上线方式:小范围、可随时关
Low
Typical case: Internal draft, read-only, no personal data
Minimum evidence: Basic evaluation, usage limits
Rollout: Small scope, kill switch

中
典型场景:外部用户、有限工具、可能有个人信息
最低证据:安全题集、权限审计、日志与回滚
上线方式:灰度、限额、人工抽检
Medium
Typical case: External users, limited tools, possible personal data
Minimum evidence: Safety set, permission audit, logs and rollback
Rollout: Canary, quotas, human sampling

高
典型场景:可付款/改数据/执行代码、未成年人、受监管
最低证据:红队、人工复核、合同/DPA、事件演练
上线方式:小流量、逐笔确认、强监控
High
Typical case: Payment, data mutation, code execution, minors, regulated
Minimum evidence: Red team, human review, contract/DPA, incident drill
Rollout: Small traffic, per-action confirmation, strong monitoring

禁止
典型场景:无法缓解的高伤害、许可不清、无法回滚
最低证据:不发布
上线方式:先改设计或换范围
Blocked
Typical case: Unmitigable high harm, unclear licence, no rollback
Minimum evidence: Do not ship
Rollout: Redesign or change scope

允许带条件上线,但条件要具体、可核查、有时限。不接受永久例外。Conditional launch is allowed when conditions are specific, checkable and time-bound; permanent exceptions are not.

↑ 回到目录↑ Back to contents

11 · 失败分支:先止损,再定位,不要先解释11 · Failure branches: contain first, locate second, explain last

安全事件里最贵的不是“出了一个问题”,而是“发现了却没有停”。先按工具、模型、租户或入口止损,再保存证据、定位影响范围、通知责任人。不要先在群里解释“模型本来就会这样”,那只会拖过止损窗口。The expensive part of a safety incident is not that something failed, but that it was detected and not stopped. Contain by tool, model, tenant or entry point first, then preserve evidence, scope impact and notify owners. Do not spend the containment window explaining that “the model does this sometimes”.

越权工具调用
先做什么:停用该工具/会话
再查:权限配置、参数、调用链
不要做什么:继续让 Agent 重试
Out-of-scope tool call
First action: Disable the tool or session
Then check: Permission config, arguments, call chain
Do not: Let the agent retry

敏感数据出现在输出
先做什么:停止输出/撤回消息
再查:检索权限、日志、缓存
不要做什么:只改提示词
Sensitive data in output
First action: Stop output or recall the message
Then check: Retrieval permission, logs, caches
Do not: Only edit the prompt

异常成本峰值
先做什么:限额/熔断
再查:重试、批量、长上下文
不要做什么:先优化模型
Cost spike
First action: Quota or circuit breaker
Then check: Retries, batching, long context
Do not: Optimise the model first

模型版本后回归
先做什么:回滚版本
再查:题集、配置、价格
不要做什么:直接接受新版本
Regression after model change
First action: Roll back the version
Then check: Item set, config, pricing
Do not: Accept the new version

许可/合规质疑
先做什么:下架相关数据/功能
再查:来源、条款、合同
不要做什么:先发声明再补证据
Licence or compliance challenge
First action: Remove the data or feature
Then check: Source, terms, contract
Do not: Issue a statement before evidence

告警洪水
先做什么:降噪、分级、设负责人
再查:阈值、重复、根因
不要做什么:关掉全部告警
Alert flood
First action: Reduce noise, tier, assign owner
Then check: Threshold, duplicates, root cause
Do not: Turn all alerts off

先止损,再定位,最后解释。顺序反了,事故会变大。Contain, then locate, then explain. Reverse the order and the incident grows.

↑ 回到目录↑ Back to contents

12 · 一条最小路径:从保护对象到可回滚上线12 · A minimum path: from protected asset to rollback-ready launch

下面这条路径适用于一个要接工具、读数据或对外发布的 AI 功能。每一步都留下证据,下一才能开始。This path fits an AI feature that uses tools, reads data or ships externally. Each step leaves evidence before the next begins.

  • 列保护对象:人、数据、钱、可用性、声誉、法律义务,各写一句可验证的话。List protected assets: people, data, money, availability, reputation, legal duty; write one testable sentence each.
  • 画数据流:输入、应用、模型/检索、工具/第三方、日志/缓存、输出,标信任边界。Draw the data flow: input, application, model/retrieval, tools/third parties, logs/caches, output; mark trust boundaries.
  • 写威胁模型:谁、从哪进、想达到什么、需要什么条件。每个威胁配指标与检测。Write the threat model: who, entry, goal, conditions; pair each threat with an indicator and detection.
  • 定权限:默认拒绝,逐工具最小作用域,人工确认、限额、沙箱、出网白名单。Set permissions: deny by default, per-tool least scope, human confirmation, quotas, sandbox, egress allowlist.
  • 搭护栏:输入、检索、输出、工具四层,写清挡什么、不挡什么、误杀与延迟。Build guardrails across input, retrieval, output and tools; state what is blocked, what is not, false positives and latency.
  • 建评测:题集、评分器、阈值、红队、回归与留痕。Build evaluation: item set, scorer, thresholds, red team, regression and records.
  • 接监控:日志字段、脱敏、告警、kill switch、回滚、事件 runbook。Connect monitoring: log fields, redaction, alerts, kill switch, rollback and incident runbook.
  • 核供应商与规则:数据驻留、训练使用、子处理者、合同、适用规则与证据。Check vendors and rules: residency, training use, subprocessors, contracts, applicable rules and evidence.
  • 过发布门禁:风险级、证据清单、签字、灰度范围、回滚条件。Pass the release gate: risk tier, evidence list, sign-off, canary scope, rollback conditions.
  • 上线后复跑:模型/提示/工具变更、告警复盘、权限审计、规则复核日。Rerun after launch: model/prompt/tool changes, alert review, permission audit, rule review dates.
最小路径不是“最快上线”。它是能止损、能复跑、能回滚的最短闭环。The minimum path is not the fastest launch; it is the shortest loop that can contain, rerun and roll back.

↑ 回到目录↑ Back to contents

来源与延伸阅读Sources and further reading

以下链接用于核对事实、许可证与官方口径。外部页面可能更新;引用时以原文与核验日为准。These links are for checking facts, licences and official scope. External pages may change; cite the original text and check date.

下一步Next

如果你照着做时卡住了,先回到对应主题路线,不要从头重读。If you get stuck while following it, go back to the matching route instead of rereading the whole guide.

← 回到首页← Back to home 发现错误?提交纠错Spot an error? Send a correction