PIVTR-D
ROracle Cloud playbook · Compute and containers

OCI Generative AI abused

The attacker calls OCI Generative AI models with a stolen IAM credential or a Generative AI API key, and the tenancy pays for the tokens. Some attackers also create dedicated AI clusters, add data sources or tools to agents, or turn off agent guardrails to reach the data behind them. Cut off the stolen credential and the attacker's API keys first, then save the policies and agent settings they changed.

Look here

LogSearch for
Audit, Generative AI managementAPI key, cluster and endpoint changes: CreateApiKey, UpdateApiKey, SetApiKeyState, RenewApiKey, CreateDedicatedAiCluster, CreateEndpoint. data.eventName is the API operation name, so confirm the names in your export
Audit, agentsChanges to agent endpoints, data sources, ingestion jobs and tools: UpdateAgentEndpoint, CreateDataSource, UpdateDataSource, CreateDataIngestionJob, CreateTool, UpdateTool
Audit, policiesPolicies that open Generative AI to new principals: CreatePolicy and UpdatePolicy whose statements name generative-ai-family or generative-ai-chat, or allow any-user where request.principal.type='generativeaiapikey'
Audit, inference, and copies of promptsInference calls, if Audit records them. Search the export for Chat and EmbedText and record whether they appear, because the Generative AI documentation does not say. GenerateText has been unavailable since June 26, 2026. Audit has no field for the request body, and Generative AI has no entry in the Logging service log reference. Prompts exist only where your application or API Gateway logged them, or in agent traces returned to the caller
Monitoring metricsInvocation and token volume, documented for hosting dedicated AI clusters and endpoints: TotalInvocationCount, InputTokenCount, OutputTokenCount
CostDaily cost by service and SKU: oci usage-api usage-summary request-summarized-usages --tenant-id <tenancy-ocid> --time-usage-started <utc> --time-usage-ended <utc> --granularity DAILY --query-type COST --group-by '["service","skuName"]'
Current state, API keysAPI keys the owners do not recognize: oci generative-ai api-key-collection list-api-keys -c <compartment-ocid> --all
Current state, dedicated AI clustersClusters no approved change explains: oci generative-ai dedicated-ai-cluster-collection list-dedicated-ai-clusters -c <compartment-ocid> --all
Current state, agent endpointsGuardrail settings of each agent endpoint: oci generative-ai-agent agent-endpoint list -c <compartment-ocid> --all

Contain

#Item
1Block the IAM user or workload that made the calls, as in API key or auth token or instance principal
2Deactivate each secret of every suspect Generative AI API key. Deactivation is reversible and keeps the key for evidence. Run the command once per secret: oci generative-ai api-key set-api-key-state --api-key-id <ocid> --key-name <key-name> --state INACTIVE
3Save each policy that grants Generative AI to any-user, then remove or narrow those statements: oci iam policy update --policy-id <ocid> --statements file://known-good.json
4If IAM deny policies are already enabled, deny the suspect group. Deny overrides allow. Enabling deny policies is permanent, so leave that to the tenancy owner: deny group <group> to use generative-ai-chat in tenancy
5Set agent endpoint guardrails back to the baseline. The file sets content moderation, prompt injection and personally identifiable information (PII) protection to Block: oci generative-ai-agent agent-endpoint update --agent-endpoint-id <ocid> --guardrail-config file://guardrails.json
6Record, then delete the endpoints the attacker created destructive: oci generative-ai endpoint delete --endpoint-id <ocid>
7Record, then delete the dedicated AI clusters the attacker created destructive: oci generative-ai dedicated-ai-cluster delete --dedicated-ai-cluster-id <ocid>
8Once the case owner agrees, revoke the stolen secrets irreversible: oci generative-ai api-key set-api-key-state --api-key-id <ocid> --key-name <key-name> --state REVOKED

Eradicate and recover

#Item
1List the data sources of each knowledge base. Remove unknown ones and re-ingest from known sources: oci generative-ai-agent data-source list -c <compartment-ocid> --knowledge-base-id <ocid> --all
2List the tools of each agent and remove unknown ones: oci generative-ai-agent tool list -c <compartment-ocid> --agent-id <ocid>
3Issue new API keys with expiry dates, store them in Vault, and rotate through the standby secret
4Limit API key policies to named keys and models with request.principal.id and target.model.id
5Serve models through a Generative AI private endpoint
6Add a budget on the AI compartment: oci budgets budget budget create -c <tenancy-ocid> --amount <n> --reset-period MONTHLY --target-type COMPARTMENT --targets '["<compartment-ocid>"]'
7Add a forecast alert to the budget: oci budgets budget alert-rule create --budget-id <ocid> --type FORECAST --threshold 80 --threshold-type PERCENTAGE
Watch out
  • Each API key has two secrets, and either one authenticates. Set the state on both.
  • Prompts and outputs kept by your application, API Gateway or agent traces can contain sensitive data. Restrict access to those copies and preserve them as evidence.
  • Cost Analysis data can take up to 48 hours to appear, and budget alerts are evaluated every 24 hours. Re-run the cost query two days after containment before closing the case.
  • A hosting dedicated AI cluster has a minimum commitment of 744 unit-hours, and Oracle's billing example charges that minimum for shorter use.

Oracle documentation: Generative AI API keys, activating, deactivating and revoking an API key, adding API key permissions, IAM policies for Generative AI, API-level permissions for API keys and for chat, Enterprise AI governance, metric details, paying for dedicated AI clusters, creating an endpoint in Generative AI Agents, Audit overview, contents of an Audit log event, Logging service log reference, deny policies, Cost Analysis, cost reports, Budgets overview; OCI CLI help for generative-ai, generative-ai-agent, usage-api and budgets. Checked September 2026. Rechecked October 2026: Generative AI API keys, Generative AI release notes (deprecated APIs), Audit overview, Logging service log reference, and every command against OCI CLI 3.94.2.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.