智能体
dev.to ·
@lixingliangsy
你的安全策略是一份 PDF,而你的 AI Agent 读不了 PDF
文章指出多数公司的安全与数据处理策略停留在文档层面,而获得生产工具权限的 AI Agent 并未读取这些策略,因此不知道哪些数据不可外传、哪些操作需要二次审批。作者认为把策略粘贴进 system prompt 只是请求而非控制,因为提示注入可覆盖同一上下文中的规则,并提出将策略转化为可执行检查的更强方案。
AI推荐理由 指出企业安全策略文档与 AI Agent 实际执行之间的落差,并讨论把策略粘贴进 system prompt 的局限(提示注入可覆盖),提出将策略转为可执行检查的思路,对 Agent 落地治理有实际参考价值;属观点性文章,未给出完整实现或验证数据。
62
正文
Most companies I've seen have a security or data-handling policy that lives in a document. It gets written, reviewed, approved, filed away. It's very clear about what an employee may and may not do.
Then the company gives an AI agent access to production tools, and the agent has read exactly none of it.
The agent doesn't know that customer records shouldn't be exported to personal drives. It doesn't know that refund approvals over a certain amount need a second pair of eyes. It knows what its system prompt says, and the system prompt says "you are a helpful assistant."
The gap between policy and enforcement
There's a well-meaning attempt at a fix that goes: paste the policy into the system prompt. It helps a little. It's still just words the model is asked to respect, sitting in the same context window as everything a prompt injection attack tries to override. A rule that lives in the prompt is a request, not a control.
The stronger version of that idea: turn the policy into checks the agent has to pass, not text it's asked to remember. "Refunds over $500 require a manager" becomes a function the agent must call before executing a refund. "Customer data stays in the EU region" becomes a validation on the tool's arguments.
What AgentPolicy actually does
AgentPolicy takes your company policy text and produces agent-callable policy checks plus a compliance checklist, and maps them to the EU AI Act obligations that apply. The output is exportable rules — something you can wire into the agent's tool layer, so the enforcement point is code, not context.
The EU AI Act mapping is worth a sentence on its own. If your agent makes decisions about people, some of the Act's obligations probably reach you, and "we have a policy document" doesn't satisfy them by itself. Having the mapping generated alongside the rules means the compliance story and the enforcement story stay in one place instead of drifting apart.
What it is not
It is not legal advice, and I want that in plain text rather than a tooltip. Generated checks are a starting point for your review, not a reviewed control set. A policy-to-rules conversion can also only be as good as the policy text you feed it — vague policies produce vague rules, which is arguably useful feedback about the policy itself.
The test I'd run
Pick one policy sentence that your team clearly follows. Ask: if an AI agent had the credentials to violate this tomorrow morning, would anything stop it, technically? Not procedurally — technically. If the honest answer is "someone would notice in the audit logs," that's a detection, not a prevention, and the gap is worth closing before an agent shows up to widen it.
agentpolicy.lxsaihub.com — and if the generated rules miss something your policy clearly says, that's the most useful feedback I can get.