Amazon Bedrock AgentCoreにおけるポリシーによる安全なAIエージェント
AWSはAmazon Bedrock AgentCoreのPolicy機能を発表し、AIエージェントの安全性を確保するために、実行時に確定的な境界を適用する原則的な方法を提供することで、規制産業での安全な展開を可能にします。
キーポイント
AIエージェントの安全性課題
自律的に行動するAIエージェントは、機密データへのアクセスや取引実行により重大なセキュリティリスクをもたらす可能性があり、特に規制産業では適切な境界設定が不可欠である。
Policy機能のアプローチ
Amazon Bedrock AgentCoreのPolicy機能は、エージェントを外界から隔離する「壁」のメンタルモデルに基づき、ゲートウェイ上の全トラフィックを傍受して確定的なルールを適用する安全層を提供する。
実装方法と応用例
自然言語で記述されたビジネスルールをCedarポリシーに変換し、細粒度のアイデンティティ対応制御を適用することで、医療予約スケジューリングエージェントなどの実用例で患者データの安全性を確保する。
技術的実現手段
Policyはエージェント自身の推論とは独立して動作する確定的な強制レイヤーとして機能し、ツールやデータへのアクセスをユーザーの権限に基づいて制限する。
ポリシー実装の手順
ポリシーエンジンを作成し、自然言語、フォームベース、直接Cedar記述の3つの方法でポリシーを作成し、LOG_ONLYモードで検証後にエンフォースモードでゲートウェイに関連付ける。
医療エージェントのポリシー例
患者は自身のレコードのみアクセス可能(IDベースポリシー)、読み取りと書き込みを分離(スコープベース制御)、スケジュール時間制限などのリスク制御を実装する。
ポリシー評価モデル
デフォルト拒否モデルで、一般的な操作には広範な許可ルールを、高リスク操作には特定の禁止ルールを追加する階層的アプローチを採用している。
影響分析・編集コメントを表示
影響分析
この発表は、生成AIエージェントの実用化における最大の障壁である安全性問題に対処する重要な進展であり、特に金融・医療などの規制産業でのAIエージェント導入を加速させる可能性がある。AWSが提供するこのアプローチは、業界標準となる可能性を秘めており、企業のAI導入における信頼性を高める重要な一歩となる。
編集コメント
AIエージェントの実用化における核心課題である安全性を、確定的なポリシー強制という技術的アプローチで解決するAWSの戦略は、規制産業でのAI導入を現実的なものにする重要な一歩。
規制産業においてAIエージェントを安全にデプロイすることは困難です。適切な境界がなければ、機密データにアクセスしたりトランザクションを実行したりするエージェントは、重大なセキュリティリスクをもたらす可能性があります。従来のソフトウェアとは異なり、AIエージェントは、ツールを呼び出し、データにアクセスし、環境やユーザーからのデータを用いて推論を適応させることで、目標を達成するためのアクションを選択します。この自律性こそがエージェントを強力にする一方で、セキュリティを妥協できない課題にしています。
エージェントの安全性について考える上で有用なメンタルモデルは、エージェントを外部世界から隔離することです。そのためには、エージェントの周囲に「壁」を設けると考えてください。この壁は、エージェントが何にアクセスでき、何と対話し、外部世界にどのような影響を与えられるかを定義します。明確に定義された壁がなければ、メールを送信したり、データベースをクエリしたり、コードを実行したり、金融取引をトリガーしたりできるエージェントは危険です。これらの機能は、データ流出、コードやインフラストラクチャへの意図しないアクセス、プロンプトインジェクション攻撃につながる可能性があります。イノベーションの速度を落とすことなく、大規模にAIの安全性を確実に実施するにはどうすればよいでしょうか?Amazon Bedrock AgentCoreのPolicyは、実行時にこれらの境界を大規模に実施するための確固たる方法を提供します。
この記事では、医療予約スケジューリングエージェントを例に、Amazon Bedrock AgentCoreのPolicyが、エージェント自身の推論とは独立して動作する決定論的実施レイヤーをどのように構築するかを説明します。医療分野はこの検討にうってつけです。この分野で動作するエージェントは、機密性の高い患者データを扱い、厳格なアクセス境界を順守し、ビジネスルールを一貫して実施する必要があります。これには、患者データの安全性と安全なランタイム操作を維持するための決定論的ポリシー実施が求められます。完全なサンプルはGitHubのamazon-bedrock-agentcore-samplesで公開されています。
ここでは、ビジネスルールの自然言語による記述をCedarポリシーに変換し、そのポリシーを用いてきめ細かいアイデンティティベースの制御を実施し、エージェントがユーザーに許可されたツールとデータのみにアクセスするようにする方法を学びます。また、AgentCore Gatewayを通じてPolicyを適用し、実行時にエージェントからツールへのすべてのリクエストを傍受・評価する方法も確認します。
欠落していたレイヤー: エージェントが外部ポリシー実施を必要とする理由
AIエージェントのセキュリティ確保は、従来のソフトウェアのセキュリティ確保よりも困難です。オープンエンドな推論、柔軟なツール使用、新しい状況への適応性といった、エージェントを強力にする特性は、同時に予測が難しく、安全に制御するのがはるかに難しい振る舞いも生み出します。エージェントは大規模言語モデル(LLM)の推論に依存しており、LLMは幻覚を起こす可能性があり、信頼された指示と付随的なテキストとの間に厳密な境界が組み込まれていません。このため、エージェントはプロンプトインジェクションや関連する敵対的攻撃に対して脆弱です。これらの攻撃はLLMの弱点を悪用し、セーフガードを無効化して意図した動作を妨害する可能性があります。こうしたリスクは、多くの場合、コード内でエージェントを制約することで管理されます。これは有効ですが、微妙なコストを伴います。エージェントの振る舞いは、そのラッパーコードの正確性に依存するため、そのコード自体が暗黙のセキュリティ境界となります。ポリシーが完全かどうかを判断するには、潜在的に大規模なコードベース全体を注意深くレビューする必要があります。セキュリティチームが適切なルールが適用されているかを監査する際、彼らは明確で監査可能なポリシー定義ではなく、アプリケーションコードを読むことになります。Amazon Bedrock AgentCoreのPolicyは異なるアプローチを取ります。ポリシーを完全にエージェントの外部に移すのです。これにより、ポリシーはエージェントによるツール呼び出しの前に、AgentCore Gatewayによって実施されます。したがって、ポリシーは、エージェントが何をするか、エージェントがどのようにプロンプトされたり操作されたりするか、エージェントコード自体にどのようなバグが存在するかに関わらず実施されます。この分離により、ツール呼び出しコードの各行を潜在的なセキュリティ境界として扱うことなく、機能の開発に集中できます。
Cedar: 決定論的ポリシー実施のための言語
ルールをエージェントコードに埋め込むのとは異なり、外部ポリシー実施は監査可能なセキュリティ境界を提供し、機能開発とセキュリティ上の懸念を分離します。この種の決定論的外部実施を実用的なものにするには、機械効率が良く、かつ人間が監査可能なポリシー言語が必要です。Amazon Bedrock AgentCoreのPolicyで使用されるCedarは、セキュリティ上の意図を正確で分析可能なポリシーに変換することで、この欠落していたレイヤーを提供します。
CedarがAgentCore Policyで使用される認可言語である理由は、実用的な認可言語であると同時に、自動化された数学的分析の対象となるように設計されているからです。各ポリシーは、主体(誰が)、アクション(何を)、リソース(どこで)を指定し、when句に条件を記述します。以下の例は、アリスだけが休暇写真を閲覧できるように許可する方法を示しています:
原文を表示
Deploying AI agents safely in regulated industries is challenging. Without proper boundaries, agents that access sensitive data or execute transactions can pose significant security risks. Unlike traditional software, an AI agent chooses actions to achieve a goal by invoking tools, accessing data, and adapting its reasoning using data from its environment and users. This autonomy is precisely what makes agents so powerful and what makes security a non-negotiable concern.
A useful mental model for agent safety is to isolate the agent from the outside world. To do this, think of walls around an agent that defines what the agent can access, what it can interact with, and what effects it can have on the outside world. Without a well-defined wall, an agent that can send emails, query databases, execute code, or trigger financial transactions is risky. These capabilities can lead to data exfiltration, unintended access to code or infrastructure, or prompt injection attacks. How can you enforce AI safety reliably, at scale, without slowing down innovation? Policy in Amazon Bedrock AgentCore gives you a principled way to enforce those boundaries at runtime, at scale.

In this post, we use a healthcare appointment scheduling agent to understand how Policy in Amazon Bedrock AgentCore creates a deterministic enforcement layer that operates independently of the agent’s own reasoning. Healthcare is a natural fit for this exploration. Agents operating in this domain must handle sensitive patient data, respect strict access boundaries, and enforce business rules consistently. This requires deterministic policy enforcement to maintain the safety of patient data and secure runtime operations. The full sample is available on GitHub at amazon-bedrock-agentcore-samples.
You will learn how to turn natural language descriptions of your business rules into Cedar policies, then use those policies to enforce fine-grained, identity-aware controls so that agents only access the tools and data that their users are authorized to use. You will also see how to apply Policy through AgentCore Gateway, intercepting and evaluating every agent-to-tool request at runtime.
The missing layer: Why agents need external policy enforcement
Securing AI agents is harder than securing traditional software. The things that make agents powerful, such as open-ended reasoning, flexible tool use, and adaptability to new situations, also create unpredictable behaviors that are much harder to safely control. Agents rely on large language model (LLM) inference, which can hallucinate and has no built-in hard separation between trusted instructions and incidental text. This makes agents vulnerable to prompt injection and related adversarial attacks that exploit these LLM weaknesses to override safeguards and subvert intended behavior. These risks are often managed by constraining the agent in code. This works, but it carries subtle costs. The agent’s behavior is now only as safe as the correctness of that wrapper code, which is now an implicit security boundary. Reasoning about whether the policy is complete requires careful code review across a potentially large code base. When a security team needs to audit whether the right rules are in place, they’re reading application code rather than a clear, auditable policy definition. Policy in Amazon Bedrock AgentCore takes a different approach: move the policy entirely outside the agent. Now the policy is enforced before the tool invocation by the agent through AgentCore Gateway. Thus, policy is enforced regardless of what the agent does, regardless of how the agent is prompted or manipulated, and regardless of what bugs exist in the agent code itself. With this separation, you can focus on capability without treating every line of tool-calling code as a potential security boundary.
Cedar: Language for deterministic policy enforcement
Unlike embedding rules in agent code, external policy enforcement provides auditable security boundaries and separates capability development from security concerns. To make this kind of deterministic external enforcement practical, you need a policy language that is both machine-efficient and human-auditable. Cedar, used by Policy in Amazon Bedrock AgentCore, provides this missing layer by turning security intent into precise, analyzable policies.
Cedar is the authorization language used in AgentCore Policy because it was designed to be both a practical authorization language and a target for automated mathematical analysis. Each policy specifies a principal (who), action (what), and resource (where), with conditions in the when clause. The following example shows how to permit only Alice to view the vacation photo:
permit( principal == User::"alice", action == Action::"view", resource == Photo::"VacationPhoto94.jpg");In addition to attributes on principals, resources, and actions, you can use Cedar to pass a context object whose attributes (for example, readOnly) can be referenced in policies to condition decisions on runtime information. This following example shows how you might create a policy that allows the user alice to perform a readOnly action:
permit( principal == PhotoFlash::User::"alice", action, resource) when { context has readOnly && context.readOnly == true };Cedar’s semantics including default deny, forbid wins over permit and order-independent evaluation, make it straightforward to reason about policies compositionally. Evaluation latency is also minimal because of the restricted loop-free structure. Cedar policies do not have side effects like file system access, system calls, or networking. So, they can be safely evaluated without sandboxing, even when written by untrusted authors.
Policy in Amazon Bedrock AgentCore
Building on the need for deterministic, external enforcement, Policy in Amazon Bedrock AgentCore provides the concrete mechanism that evaluates every agent-to-tool request against explicitly defined Cedar policies. A *policy engine* is a collection of policies expressed in Cedar. To make policy authoring accessible, policies can be created in two ways: authored directly as Cedar for fine-grained programmatic control or generated from plain English statements that are automatically formalized into Cedar. Starting from natural language, the service generates syntactically correct Cedar code, validates it against the gateway schema, and analyzes it to surface overly permissive, overly restrictive, or otherwise problematic policies before they are enforced. After defined, Policy in AgentCore intercepts agent traffic through Amazon Bedrock AgentCore Gateways, evaluating every agent-to-tool request against the policies in the policy engine before granting or denying tool access.
Applying policy to a healthcare appointment scheduling agent
To make these concepts concrete, let’s walk through how Policy in Amazon Bedrock AgentCore can be applied to a healthcare appointment scheduling agent. This is an AI system that helps inquire about current immunization status/schedule, checks appointment slots, and books appointments. We want to secure the AI system using Policy to help prevent unauthorized access to patient records, inadvertent exposure of protected health information (PHI), or a patient canceling another patient’s appointment.

Policy in Amazon Bedrock AgentCore has a default-deny posture and forbid wins over permit default-deny posture and forbid automatically wins over permit. Together with these principles, we show how policies can be composed from a small set of readable, auditable Cedar rules to improve the safety of the AI agent in production.
Getting started
To try this example yourself, start by cloning the Amazon Bedrock AgentCore samples repository and navigating to the healthcare appointment agent folder:
git clone https://github.com/awslabs/amazon-bedrock-agentcore-samples.git
cd amazon-bedrock-agentcore-samples/02-use-cases/healthcare-appointment-agentFrom there, follow the setup and deployment instructions in the README for this directory to configure your AWS environment, deploy the sample stack, and invoke the agent end-to-end.
Prerequisites
To use Policy in Amazon Bedrock AgentCore with your agentic application, verify that you have met the following prerequisites:
- An active AWS account
- Confirmation of the AWS Regions where Policy in AgentCore is available
- Appropriate IAM permissions to create, test, and attach policy engine to your AgentCore Gateway. (Note: The IAM policy should be fine-grained and limited to necessary resources using proper ARN patterns for production usage):
[ { "Sid": "PolicyEngineManagement", "Effect": "Allow", "Action": [ "bedrock-agentcore:CreatePolicyEngine", "bedrock-agentcore:UpdatePolicyEngine", "bedrock-agentcore:GetPolicyEngine", "bedrock-agentcore:DeletePolicyEngine", "bedrock-agentcore:ListPolicyEngines" ], "Resource": "arn:aws:bedrock-agentcore:${aws:region}:${aws:accountId}:policy-engine/*" }, { "Sid": "CedarPolicyManagement", "Effect": "Allow", "Action": [ "bedrock-agentcore:CreatePolicy", "bedrock-agentcore:GetPolicy", "bedrock-agentcore:ListPolicies", "bedrock-agentcore:UpdatePolicy", "bedrock-agentcore:DeletePolicy" ], "Resource": "arn:aws:bedrock-agentcore:${aws:region}:${aws:accountId}:policy-engine/*/policy/*" }, { "Sid": "NaturalLanguagePolicyGeneration", "Effect": "Allow", "Action": [ "bedrock-agentcore:StartPolicyGeneration", "bedrock-agentcore:GetPolicyGeneration", "bedrock-agentcore:ListPolicyGenerations", "bedrock-agentcore:ListPolicyGenerationAssets" ], "Resource": "arn:aws:bedrock-agentcore:${aws:region}:${aws:accountId}:policy-engine/*/policy-generation/*" }, { "Sid": "AttachPolicyEngineToGateway", "Effect": "Allow", "Action": [ "bedrock-agentcore:UpdateGateway", "bedrock-agentcore:GetGateway", "bedrock-agentcore:ManageResourceScopedPolicy", "bedrock-agentcore:ManageAdminPolicy" ], "Resource": "arn:aws:bedrock-agentcore:${aws:region}:${aws:accountId}:gateway/*" }]Replace ` and ` with your values. For production, scope the resource ARNs to specific policy engine and gateway IDs rather than using wildcards. For the complete set of permissions including Gateway execution role configuration, see AgentCore Gateway and Policy IAM Permissions
Policy implementation steps
- To get started, first create a policy engine that can hold the required policies that we will create for the healthcare appointment scheduling agent.
- There are three different options to author policies. You can generate Cedar statements from rules expressed in natural language, use a form-based approach to Cedar policy creation, or directly provide the Cedar statement. In the next section, we will look at some examples which cover these authoring options.
- Finally, the policy engine can be associated with a Gateway. This can be done in the LOG_ONLY mode to validate how policies work for your agent without disrupting production traffic. This is done by observing the behavior recorded in the observability logs. When you are confident that the agent has the expected behavior, you can associate the policy engine with the gateway in the enforce mode.

The healthcare appointment agent has the following tools:
- getPatient: GET /get_patient_emr — Get a patient record by the required query parameter patient_id (string).
- searchImmunization: POST /search_immunization_emr — Search immunization records with required parameter search_value (string; patient ID).
- bookAppointment: POST /book_appointment — Book an appointment by providing date_string (string; “YYYY-MM-DD HH:MM”).
- getSlots: GET /get_available_slots — Get available slots by required query parameter date_string (string; “YYYY-MM-DD”).
Now let’s author some policies for this agent to secure how the agent accesses these tools!
Identity-based policies
A fundamental rule in a healthcare agent is that patients should only be able to act on their own records. We want to create a policy that permits a patient to read their own patient/immunization records. For each tool, you can state that the tool parameter (patient_id in the case of the getPatient tool, search_value in the case of searchImmunization tool) must match the authenticated ID of the user. In the following image, we show you how you can author these policies by using statements in natural language and generating the corresponding Cedar policies.

Read vs. write separation
A common pattern in healthcare systems is to allow broad read access while tightly restricting write operations. An example policy for this agent would be to make reads possible only for an authenticated user with a suitable scope (for example, fhir:read) and keep the writes separately controlled. In the following image, you can see how the form-based policy creation works. You can choose the effect, principal, resource, action and provide the conditions to create a policy. The image shows the creation of a policy to allow users to access tools in the healthcare application’s gateway only when the principal contains fhir:read in the principal scope.

Like this policy for scoped read access, you can now use a scope appointment:write in the scope of the principal to control write access.
Risk controls on scheduling
Beyond access control, Policy can enforce business rules or dangerous patterns that help prevent abuse. By using explicit forbids to hard‑stop dangerous input patterns to tools, you can secure your application even if the agent is compromised. For example, let us create a policy to block showing appointment slots outside of limited hours.In the following image, you can see that the natural language statement “Allow users to get slots only between 9 am and 9 pm UTC” is converted to the Cedar policy.

You can now build more policies for your use case and create a coherent policy set coherent to establish a complete security posture. The Policy engine evaluation model is default-deny: if no permit policy matches a request, it is blocked. Use broad permit rules for common, low-risk operations. Add targeted forbid rules for high-risk tools, sensitive data boundaries, and known abuse vectors. This layered approach helps you create a policy set that is both readable by a security auditor and enforceable at runtime independent of what the agent’s LLM reasoning produces. Here, the agent doesn’t need to “know” these rules. It doesn’t need to be prompted to respect them, fine-tuned to follow them, or trusted to apply them correctly under adversarial conditions. Policy in Amazon Bedrock AgentCore enforces them at the gateway, before tool call execution, regardless of how the agent arrived at its decision.
Testing policy enforcement
Let us now understand the behavior of the policies we have created and associated with the gateway for the healthcare appointment scheduling agent. The following two test cases demonstrate the identity-scoped access policy in action when the agent invokes the getPatient tool on behalf of a user. In both cases, the authenticated user is patient adult-patient-001.The Cedar policy being tested is the patient read-only access rule. This rule permits the getPatient tool call only when the patient_id in the request matches the authenticated user’s identity:
permit( principal, action == AgentCore::Action::"Target1___getPatient", resource == AgentCore::Gateway::"{gateway_arn}") when { principal.hasTag("role") && principal.getTag("role") == "patient" && context.input has patient
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み