使用时间性策略保护Amazon Bedrock AgentCore中的AI代理
摘要
AWS在Amazon Bedrock AgentCore中引入时间性策略,在网关层基于代理的会话轨迹进行授权决策,以解决传统静态访问控制在代理场景下无法捕获上下文风险的问题。
核心要点
- 时间性策略在AgentCore Gateway外围运行,位于代理代码之外,代理无法拦截或操纵,因此不能绕过。
- 策略基于代理轨迹(由principal和session ID标识的有界动作序列)评估当前请求,默认拒绝,禁止优于允许。
- 每个需要时间性策略评估的请求必须携带x-amzn-bedrock-agentcore-policy-session-id请求头以标识会话。
- 典型应用包括:强制输出完整性(要求当前工具调用的参数与之前调用的输出精确匹配,防止幻觉值)、强制工具调用顺序、要求人工审批后才执行特权操作、强制数据新鲜度等。
- 文章演示了如何利用时间性策略防止数据伪造、限制每会话累计金融敞口,以及在无人值守时自动收紧权限。
原文佐证
- Temporal policies in Amazon Bedrock AgentCore let you define stateful rules that determine authorization to AgentCore Gateway targets by evaluating the current request in the context of prior events in an agent’s trajectory.
- Because these policies run at the AgentCore Gateway perimeter, outside the agent’s own code, the agent cannot intercept or manipulate them.
- Agents never see the policy logic, never touch the state store, and cannot alter the controls.
AI 洞察
这标志着AI代理安全从静态的请求级控制迈向动态的会话级控制,是对代理自主行为风险的重要补充。未来,代理安全将越来越依赖运行环境的策略执行与监控,而不仅是模型自身的对齐或训练。此功能可能推动其他平台和框架引入类似的状态化授权机制,成为AI代理安全的基础能力。