Skip to main content
With CloudTrail data events turned on for your Amazon Bedrock AgentCore gateways, your trail records who called which tool and whether the gateway allowed it. A gateway is the endpoint that AgentCore agents call their tools through. CloudTrail does not log these events by default, and Plerion does not turn them on for you.

What to turn on

Add one data event selector to a trail that logs the gateway’s account. This can be an organization trail, which only its management account can change. The selector has eventCategory set to Data and resources.type set to AWS::BedrockAgentCore::Gateway. A trail logs data events only in the regions it covers. Use a multi-region trail, or one trail in each region that has a gateway. AWS charges $0.10 for every 100,000 data events the trail delivers. A gateway produces one event for each request it receives, which includes requests that list tools as well as tool calls. See AWS CloudTrail pricing.

Add the selector to a trail

  1. In the CloudTrail console, choose Trails and open the trail.
  2. In Data events, choose Edit.
  3. If the trail logs no data events yet, select the Data events check box. If it does, choose Add data event type.
  4. For Resource type, choose Bedrock-AgentCore Gateway.
  5. For the log selector template, choose Log all events.
  6. Choose Save changes.

Check that it worked

After the next scan, [PLERION-AWS-1239] “CloudTrail does not log data events for AgentCore gateways” passes for each gateway the trail covers.

What Plerion reads

Once the trail logs these events, Plerion receives them through the Cloud Detection and Response (CDR) integration, which forwards events from the regions its stack is deployed in. Deploy it in each region that has a gateway. From each event it reads:
  • The IAM role and session that made the request, with the source IP address and user agent
  • The tool that was called, and on which gateway
  • Whether the call succeeded, or the error it returned. A call the gateway’s policy denies is logged with HTTP status 200 and the JSON-RPC error code -32002.
Plerion shows each tool call in the gateway’s Event history, with the tool name and whether the gateway allowed it. Plerion does not receive the arguments sent to a tool or the result it returned. AWS replaces both with REDACTED in the event. Plerion reads the caller for gateways that use IAM authorization. For a gateway that authorizes its callers with a JSON Web Token (JWT), AWS documents that the event carries claims from the token in place of an IAM identity.