View a markdown version of this page

AgentCore 在 AgentCore 可觀測性資料中產生的政策 - Amazon Bedrock AgentCore

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

AgentCore 在 AgentCore 可觀測性資料中產生的政策

對於政策和政策引擎資源類型,Amazon Bedrock AgentCore 預設會將調用指標發佈至 CloudWatch。為連接的 AgentCore Gateway 資源啟用追蹤時,可以使用其他跨度資料,這會在 AgentCore 相關操作中發出政策跨度。請參閱啟用 AgentCore 執行期、記憶體、閘道、內建工具和身分資源的可觀測性,以進一步了解啟用。

提供的指標資料

Amazon Bedrock AgentCore 預設會將下列調用指標發佈至 AWS/Bedrock-AgentCore CloudWatch 命名空間。這些指標可用於觀察和監控政策評估和整體效能。

指標 說明 單位

調用

對服務提出的請求數量

計數

SystemErrors

伺服器端錯誤數目 (5xx)

計數

UserErrors

用戶端錯誤的數量 (4xx)

計數

延遲

從傳送請求到接收回應所經過的總時間

毫秒

AllowDecisions

導致 ALLOW 的決策數量

計數

DenyDecisions

導致 DENY 的決策數量

計數

TotalMismatchedPolicies

由於缺少屬性或類型不相符,特定請求的失敗政策數量

計數

PolicyMismatch

因缺少屬性或類型不相符而導致特定政策的失敗次數

計數

MismatchErrors

由於至少一個不相符政策而失敗的請求數量

計數

DeterminingPolicies

決定請求政策的數量

計數

NoDeterminingPolicies

由於沒有決定政策而拒絕的請求數量

計數

GuardrailLatency

評估請求護欄所花費的時間

毫秒

ConfidenceScore

Bedrock Guardrails 為評估政策而傳回的分數。在 Bedrock Guardrails 文件中,此值稱為內容篩選條件和提示攻擊的嚴重性分數,以及敏感資訊篩選條件的可信度分數。請參閱 Bedrock Guardrails 分數定義。

無

ConfidenceThreshold

護欄政策設定的分數閾值

無

SuppressOutputs

政策使用 suppressOutput效果抑制的輸出數量

計數

LogOnlyMatches

LOG_ONLY 符合的政策數量

計數

LogOnlyDecisionFlips

LOG_ONLY 政策提升為 時變更授權決策的政策符合數量 ACTIVE

計數

LogOnlyEvalIncomplete

LOG_ONLY 政策評估未完成的請求數量

計數

TemporalLatency

評估時間政策所花費的時間。每次時間評估都會發出一個範例。使用 SampleCount 計算評估。請參閱 CloudWatch 統計資料定義。

毫秒

指標維度

下列維度適用於上述指標。這些維度可讓您在更精細的細節層級篩選和分析指標資料。

維度 說明

OperationName

API 操作的名稱,有效值為 AuthorizeAction和 PartiallyAuthorizeActions

PolicyEngine

與指標相關聯的政策引擎識別符

政策

與指標相關聯的政策識別符

TargetResource

與請求相關聯的 AgentCore Gateway 資源識別符

ToolName

指標套用到的工具名稱

Mode

在 AgentCore Gateway 上設定的強制執行模式,有效值為 LOG_ONLY和 ENFORCE

Category

護欄防護類型。有效值為 contentFilter、promptAttack 和 sensitiveInformation。請參閱政策中的護欄。

篩選條件

護欄篩選條件或敏感資訊實體,例如 VIOLENCE、 PROMPT_INJECTION或 EMAIL

PolicyEnforcementMode

個別政策的強制執行模式。有效值為 ACTIVE 和 LOG_ONLY。此維度適用於 ConfidenceScore、 ConfidenceThreshold和 MismatchErrors。請參閱在 LOG_ONLY 模式中測試政策。

提供的跨度資料

Amazon Bedrock AgentCore 透過 AgentCore Gateway 可觀測性提供額外的結構化跨度資料,提供更深入的 API 調用洞察。AgentCore 跨度資料中的政策會在啟用 AgentCore Gateway 資源的追蹤後提供,並且可以在 CloudWatch aws/spans日誌群組中找到。

作業 跨度屬性 說明

AuthorizeAction

aws.agentcore.policy.authorization_decision

評估政策之後的授權決策,有效值為 ALLOW和 DENY

aws.agentcore.policy.authorization_reason

授權決策的原因

aws.agentcore.policy.determining_policies

決定決策結果的政策識別符清單

aws.agentcore.policy.mismatched_policies

由於缺少屬性或類型不相符而失敗的政策識別符清單

aws.agentcore.policy.target_resource.id

套用請求的 AgentCore Gateway 資源識別符

aws.agentcore.gateway.policy.arn

在 AgentCore Gateway 上設定的 政策引擎 Amazon Resource Name (ARN)

aws.agentcore.gateway.policy.mode

在 AgentCore Gateway 上設定的政策引擎強制執行模式,有效值為 LOG_ONLY和 ENFORCE

aws.agentcore.policy.guardrails.<category>.scores

做為政策識別符、篩選條件和分數元組的護欄調查結果。有效類別為 contentFilter、 promptAttack和 sensitiveInformation

aws.agentcore.policy.types

用於確定政策的政策識別符和政策類型元組。有效的政策類型為 Cedar和 Guardrail

aws.agentcore.policy.effects

政策識別符和效果元組。有效效果為 PERMIT、 FORBID和 SuppressOutput

aws.agentcore.policy.guardrails.latency_ms

評估護欄所花費的時間,以毫秒為單位

aws.agentcore.policy.log_only_matched_policies

符合請求LOG_ONLY的政策識別符清單

aws.agentcore.policy.log_only_decision_flipping_policies

提升為 時變更授權決策LOG_ONLY的政策識別符清單 ACTIVE

aws.agentcore.policy.log_only_mismatched_policies

由於缺少屬性或類型不相符而失敗LOG_ONLY的政策識別符清單

aws.agentcore.policy.log_only_eval_incomplete

LOG_ONLY 政策評估未完成true時的字串。否則會省略 屬性

aws.agentcore.policy.log_only_matched_policies.guardrails.<category>.scores

將相符LOG_ONLY政策的護欄調查結果做為政策識別符、篩選條件和分數元組

aws.agentcore.policy.log_only_decision_flipping_policies.guardrails.<category>.scores

做為LOG_ONLY政策識別符、篩選條件和分數元組之決策翻轉政策的護欄調查結果

aws.agentcore.policy.temporal.latency_ms

評估時間政策所花費的時間,以毫秒為單位

aws.agentcore.policy.temporal.evaluation_invoked

是否針對請求執行時間政策評估。這不表示時間政策符合或決定決策

aws.agentcore.policy.temporal.event_timestamp_ns

時間評估器用來排序請求事件的確切事件時間戳記,以奈秒為單位

PartiallyAuthorizeActions

aws.agentcore.policy.allowed_tools

評估為ALLOW決策的工具名稱清單

aws.agentcore.policy.denied_tools

評估為DENY決策的工具名稱清單

aws.agentcore.policy.target_resource.id

套用請求的 AgentCore Gateway 資源識別符

aws.agentcore.gateway.policy.arn

在 AgentCore Gateway 上設定的 政策引擎 Amazon Resource Name (ARN)

aws.agentcore.gateway.policy.mode

在 AgentCore Gateway 上設定的政策引擎強制執行模式,有效值為 LOG_ONLY和 ENFORCE