AI Agent Activity Audit for AWS Log in

How to audit what AI coding agents and MCP servers did in your AWS account with CloudTrail

AI coding agents and MCP servers now run AWS CLI and SDK calls for developers. They usually run with the developer's own credentials, often an administrator role from single sign-on. In CloudTrail, the agent's calls look like the person's calls. After an incident, nobody can say what the agent read, what it changed, or what it tried and was denied.

Do it yourself with CloudTrail event history

Every AWS account has CloudTrail event history: the last 90 days of management events, per region, at no extra cost and with no trail to set up.

  1. Pull the write calls for one person in one region:
    aws cloudtrail lookup-events --region us-east-1 \
      --lookup-attributes AttributeKey=Username,AttributeValue=jane@example.com \
      --start-time 2026-11-20T00:00:00Z --query 'Events[].CloudTrailEvent' --output json \
      | jq -r '.[] | fromjson | select(.readOnly==false)
          | [.eventTime, .eventSource, .eventName, .userAgent, .errorCode // "-"] | @tsv'
  2. Look at the user agent. Each event records the userAgent of the client. The AWS CLI and SDKs identify themselves there, and some agent tools and frameworks add their own name.
  3. Look at the identity. userIdentity.arn includes the role session name for assumed roles. If agents use their own role or session name, you can filter on it directly.
  4. Check the errors. Events with errorCode set to AccessDenied or similar show what the agent tried and could not do, which is often the most useful part.

Make the next audit easier

Gotchas

How AI Agent Activity Audit for AWS automates it

You connect an AWS account with a read-only IAM role that can read CloudTrail event history and IAM role metadata. Every 10 minutes we read new events and pick out agent calls by user agent signature, role session name, roles you mark as agent roles, or your own patterns, and every detection says why it matched. Calls are grouped into agent sessions with a timeline of reads, writes, errors and AccessDenied. You get instant Slack or email alerts for high-risk calls such as IAM changes and deletes, a daily digest of agent writes, risk findings such as agents on admin roles, and a least-privilege policy built from the calls your agents really made. We store only calls that match an agent rule.

Try it free