

# 結構描述限制條件
<a name="policy-schema-constraints"></a>

Amazon Bedrock AgentCore Gateway 的政策必須針對閘道 MCP 工具資訊清單自動產生的特定 Cedar 結構描述進行驗證。此結構描述會定義 政策中可行的項目。

**Topics**
+ [委託人類型](#policy-principal-type)
+ [資源類型](#policy-resource-type)
+ [動作](#policy-actions)
+ [Context](#policy-context)
+ [您無法執行的動作](#policy-limitations)

## 委託人類型
<a name="policy-principal-type"></a>

委託人類型取決於為您的 AgentCore Gateway 設定的身分驗證方法：

 `AgentCore::OAuthUser`   
+ 用於 OAuth 驗證的閘道
+ 具有 `id` 屬性 （來自 JWT 子宣告）
+ 支援 OAuth 宣告的標籤 （使用者名稱、範圍、角色等）

 `AgentCore::IamEntity`   
+ 用於 IAM 驗證的閘道 (AWS\_IAM 授權方）
+ 具有包含發起人的 IAM ARN 的`id`屬性
+ 不支援標籤；在 上使用模式比對`principal.id`以進行存取控制

## 資源類型
<a name="policy-resource-type"></a>
+ 必須為 `AgentCore::Gateway` 
+ 代表 MCP Gateway 執行個體
+ 可依類型 ( ) `is` 或特定 ARN ( `==` ) 比對
+ 必須使用特定 ARNs 來參考特定動作

## 動作
<a name="policy-actions"></a>
+ 每個 MCP 工具都會成為一個動作： `AgentCore::Action::"ToolName"`
+ 所有工具動作都會繼承自 CallTool → Mcp 階層
+ 範例： `Action::"RefundTool___process_refund"` 是 CallTool

## Context
<a name="policy-context"></a>
+ 只有可用的內容 `context.input` 
+ 包含 MCP 資訊清單中定義的工具輸入參數
+ 每個工具都有類型輸入結構 （例如 RefundTool\_\_\_process\_refundInput)
+ 參數類型會自動從 JSON 結構描述映射到 Cedar 類型：
  + 字串 → 字串
  + 整數 → 長
  + 布林值 → 布林值
  + 數字 → 小數位數

## 您無法執行的動作
<a name="policy-limitations"></a>
+ 無法參考 AgentCore 命名空間以外的實體類型
+ 無法存取 以外的內容欄位 `context.input`(`context.output` 只能與護欄搭配使用）
+ 無法在 OAuthUser 上使用自訂屬性 （改用標籤）
+ 無法在政策中定義新的實體類型