> [!NOTE]
> Premium and Enterprise (Deprecated) [service tiers](https://docs.cloud.google.com/security-command-center/docs/service-tiers.md.txt)

> [!CAUTION]
> The Security Command Center Enterprise service tier will shut down on May 21, 2027. If your organization uses the Enterprise service tier, then the organization will automatically move to the Premium service tier on or after May 21, 2027. Contact your account representative or a [Google Cloud sales specialist](https://cloud.google.com/contact) if you have questions.

This document describes a threat finding type in Security Command Center. Threat findings are generated by
[threat detectors](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources.md.txt#threats) when they detect
a potential threat in your cloud resources. For a full list of available threat findings, see [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).

## Overview

An AI agent granted a sensitive IAM role. Findings are classified
as **Medium** severity for medium-sensitivity roles, or
**High** severity for high-sensitivity roles. For more information,
see [Sensitive IAM roles and permissions for
AI](https://docs.cloud.google.com/security-command-center/docs/concepts-event-threat-detection-overview#sensitive-roles-perms-ai).

[Event Threat Detection](https://docs.cloud.google.com/security-command-center/docs/concepts-event-threat-detection-overview.md.txt) is the source of
this finding.

## How to respond

To respond to this finding, do the following:

### Step 1: Review finding details

1. Open the `Persistence: Sensitive Role Granted by AI Agent` finding as directed in
   [Reviewing
   findings](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats#reviewing_findings).
   The details panel for the finding opens to the **Summary** tab.

2. On the **Summary** tab, review the information in the following sections:

   - **What was detected** , especially the following fields:
     - **Principal email**: AI agent service account that assigned the role.
     - **Principal subject**: AI agent principal that assigned the role.
     - **Offending access grants**: details of the sensitive roles that were added.
   - **Affected resource**

   - **Related links**, especially the following fields:

     - **Cloud Logging URI**: link to Logging entries.
     - **MITRE ATT\&CK method**: link to the MITRE ATT\&CK documentation.

### Step 2: Check logs

1. On the **Summary tab** of the finding details panel, click the **Cloud Logging URI** link to open the **Logs Explorer**.
2. On the page that loads, look for new or updated IAM resources using the following filters:
   - `protoPayload.methodName="SetIamPolicy"`

### Step 3: Research attack and response methods

1. Review MITRE ATT\&CK framework entries for this finding type: [Valid Accounts: Cloud Accounts](https://attack.mitre.org/techniques/T1078/004/).
2. Review related findings by clicking the link on the **Related findings** row in the **Summary** tab of the finding details. Related findings are the same finding type and the same instance and network.
3. To develop a response plan, combine your investigation results with MITRE research.

### Step 4: Implement your response


The following response plan might be appropriate for this finding, but might also impact operations.
Carefully evaluate the information you gather in your investigation to determine the best way to
resolve findings.

- Contact the owner of the project with the AI agent that granted the role.
- If the agent was authenticated with a service account, you can [delete the
  compromised service
  account](https://docs.cloud.google.com/iam/docs/service-accounts-delete-undelete#deleting) and rotate and delete all service account access keys for the compromised project. After deletion, resources that use the service account for authentication lose access.
- Consider [deleting the AI
  agent](https://docs.cloud.google.com/agent-builder/agent-engine/manage/overview#delete).
- Delete project resources created by unauthorized AI agents, like unfamiliar Compute Engine instances, snapshots, service accounts, and IAM users. Recommender\](/iam/docs/recommender-overview).

## Example finding JSON

The following is an example of the finding JSON, with default values omitted.

```json
{
  "finding": {
    "name": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/locations/global/findings/FINDING_ID",
    "parent": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/locations/global",
    "resourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "state": "ACTIVE",
    "category": "Persistence: Sensitive Role Granted by AI Agent",
    "securityMarks": {
      "name": "organizations/ORGANIZATION_ID/sources/SOURCE_ID/locations/global/findings/FINDING_ID/securityMarks"
    },
    "eventTime": "TIMESTAMP",
    "createTime": "TIMESTAMP",
    "severity": "MEDIUM",
    "canonicalName": "projects/PROJECT_NUMBER/sources/SOURCE_ID/locations/global/findings/FINDING_ID",
    "findingClass": "THREAT",
    "access": {
      "callerIp": "IP_ADDRESS",
      "callerIpGeo": {
        "regionCode": "COUNTRY_CODE"
      },
      "userAgent": "USER_AGENT",
      "serviceName": "cloudresourcemanager.googleapis.com",
      "methodName": "SetIamPolicy",
      "principalSubject": "principal://agents.global.org-ORGANIZATION_ID.system.id.goog/resources/aiplatform/projects/PROJECT_NUMBER/locations/LOCATION/reasoningEngines/REASONING_ENGINE_ID"
    },
    "mitreAttack": {
      "primaryTactic": "PERSISTENCE",
      "primaryTechniques": [
        "ACCOUNT_MANIPULATION"
      ],
      "additionalTactics": [
        "PRIVILEGE_ESCALATION"
      ],
      "additionalTechniques": [
        "ADDITIONAL_CLOUD_ROLES"
      ]
    },
    "iamBindings": [
      {
        "action": "ADD",
        "role": "roles/secretmanager.admin",
        "member": "user:USER_EMAIL"
      }
    ],
    "parentDisplayName": "Event Threat Detection",
    "domains": [
      {
        "category": "AI"
      },
      {
        "category": "IDENTITY_AND_ACCESS"
      }
    ],
    "logEntries": [
      {
        "cloudLoggingEntry": {
          "insertId": "INSERT_ID",
          "logId": "cloudaudit.googleapis.com/activity",
          "resourceContainer": "projects/PROJECT_ID",
          "timestamp": "TIMESTAMP"
        }
      }
    ]
  },
  "resource": {
    "name": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "displayName": "PROJECT_ID",
    "type": "google.cloud.resourcemanager.Project",
    "cloudProvider": "GOOGLE_CLOUD_PLATFORM",
    "service": "cloudresourcemanager.googleapis.com",
    "gcpMetadata": {
      "project": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
      "projectDisplayName": "PROJECT_ID",
      "parent": "//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID",
      "parentDisplayName": "ORGANIZATION_DISPLAY_NAME",
      "organization": "organizations/ORGANIZATION_ID"
    },
    "resourcePath": {
      "nodes": [
        {
          "nodeType": "GCP_PROJECT",
          "id": "projects/PROJECT_NUMBER",
          "displayName": "PROJECT_ID"
        },
        {
          "nodeType": "GCP_ORGANIZATION",
          "id": "organizations/ORGANIZATION_ID"
        }
      ]
    },
    "resourcePathString": "organizations/ORGANIZATION_ID/projects/PROJECT_NUMBER"
  },
  "sourceProperties": {
    "sourceId": {
      "projectNumber": "PROJECT_NUMBER",
      "customerOrganizationNumber": "ORGANIZATION_ID"
    },
    "detectionCategory": {
      "ruleName": "sensitive_role_granted_by_ai_agent"
    },
    "detectionPriority": "MEDIUM",
    "affectedResources": [
      {
        "gcpResourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER"
      }
    ],
    "evidence": [
      {
        "sourceLogId": {
          "projectId": "PROJECT_ID",
          "resourceContainer": "projects/PROJECT_ID",
          "timestamp": {
            "seconds": "TIMESTAMP_SECONDS",
            "nanos": TIMESTAMP_NANOS
          },
          "insertId": "INSERT_ID",
          "logId": "cloudaudit.googleapis.com/activity"
        }
      }
    ],
    "findingId": "FINDING_ID",
    "contextUris": {
      "mitreUri": {
        "displayName": "MITRE Link",
        "url": "https://attack.mitre.org/techniques/T1078/003"
      },
      "cloudLoggingQueryUri": [
        {
          "displayName": "Cloud Logging Query Link",
          "url": "https://console.cloud.google.com/logs/query;query=timestamp%3D%22TIMESTAMP%22%0AinsertId%3D%22INSERT_ID%22?project=PROJECT_ID"
        }
      ]
    },
    "domains": [
      {
        "category": "AI"
      },
      {
        "category": "IDENTITY_AND_ACCESS"
      }
    ]
  }
}
```

## What's next

- Learn [how to work with threat
  findings in Security Command Center](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats).
- Refer to the [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).
- Learn how to [review a
  finding](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats#reviewing_findings) through the Google Cloud console.
- Learn about the [services that
  generate threat findings](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources#threats).