Skip to main content

Logging Kiro tool calls with AWS CloudTrail

Kiro records AWS CloudTrail events when it lists or calls Kiro service MCP tools, such as web search. Security and audit teams can see who made the request, which tool was called, when it ran, and whether it failed. These events do not cover MCP servers that users or administrators add to Kiro. Events replace tool arguments with a placeholder and do not include tool results.

Kiro records privileged tool calls as management events without setup. To record tool listings and read-only tool calls, add a data event selector. This logging does not change how developers use Kiro.

Review the events Kiro records

Kiro records each supported MCP request as an AwsMcpEvent from codewhisperer-mcp.amazonaws.com.

ActivityeventNameeventCategoryreadOnlyDefault trail settings
List available toolsListToolsDatatrueNot logged
Call a read-only toolCallReadOnlyToolDatatrueNot logged
Call any other toolCallPrivilegedToolManagementfalseLogged

Kiro records a tool call as CallPrivilegedTool when it cannot determine the tool's classification. This happens when Kiro rejects the request before it reaches the tool, for example because authentication failed, the request was throttled, or the request was invalid. It also happens when the tool name is not recognized. After Kiro identifies the tool, the event name follows the tool's classification even if the call fails. A denied call to a read-only tool is therefore recorded as a CallReadOnlyTool data event with errorCode set to AccessDenied.

CloudTrail event history includes the last 90 days of management events. It does not include data events. To keep data events, add an advanced event selector to a trail or CloudTrail Lake event data store.

Choose where to view events

NeedCloudTrail feature
Review recent privileged calls without setupEvent history
Keep an ongoing record in Amazon S3Trail
Query events across accounts and AWS RegionsCloudTrail Lake

Log Kiro data events

Data events are not logged by default. These steps add Kiro data events to a trail that already uses advanced event selectors.

  1. In the trail's home Region, save its current selectors:

    bash
    aws cloudtrail get-event-selectors \ --trail-name <trail-name> \ --region <trail-home-region> \ > current-selectors.json
  2. Open current-selectors.json. If it contains EventSelectors instead of AdvancedEventSelectors, follow the CloudTrail guide for advanced event selectors before continuing.

  3. Create advanced-selectors.json as a JSON array. Copy every object from the current AdvancedEventSelectors list into it.

  4. Add this object to the array:

    json
    { "Name": "Log Kiro MCP data events", "FieldSelectors": [ { "Field": "eventCategory", "Equals": ["Data"] }, { "Field": "resources.type", "Equals": ["AWS::CodeWhisperer::Profile"] }, { "Field": "eventSource", "Equals": ["codewhisperer-mcp.amazonaws.com"] } ] }
  5. Apply the full array:

    bash
    aws cloudtrail put-event-selectors \ --trail-name <trail-name> \ --region <trail-home-region> \ --advanced-event-selectors file://advanced-selectors.json

Verify data event logging

  1. Run get-event-selectors again. Confirm that the output includes Log Kiro MCP data events and every selector you kept.
  2. As a user whose Kiro profile has Web Tools enabled, ask Kiro to search the web for current information. Confirm that its response cites web sources. For this setting, see Settings.
  3. Open the trail's Amazon S3 bucket. Find a CallReadOnlyTool event with eventSource set to codewhisperer-mcp.amazonaws.com.

CloudTrail usually delivers logs within about five minutes, but delivery can take longer. If no event appears, confirm that the Kiro profile is in US East (N. Virginia) or Europe (Frankfurt). Also confirm that the trail records that Region and still has the Kiro selector.

Review event record fields

Kiro events use the CloudTrail record format with an added mcpEventDetails field. The following fields help you audit tool use:

FieldWhat it shows
userIdentityThe identity that made the request
sourceIPAddressThe request's source IP address
userAgentThe Kiro client that made the request
requestParametersThe JSON-RPC version and id, MCP method, and tool name in params.name
resourcesThe Kiro profile ARN
mcpEventDetailssessionId, toolName, and executionTimeMs
errorCode and errorMessageWhy a request did not complete. ClientCancelled means the client stopped reading the response

For tool calls, requestParameters.params.arguments is always HIDDEN_DUE_TO_SECURITY_REASONS. Kiro does not include tool results in the event. mcpEventDetails.sessionId matches the event's requestID.

Kiro does not record a request that is rejected as malformed before processing, or one that does not name a usable Kiro profile. If authentication fails, userIdentity.type is Unknown. In that event, treat its account and profile values as unverified request data.

To review the full event format, see CloudTrail record contents.

Page updated: November 12, 2026