// ai security

Cloud AI Security Testing: Bedrock, Azure OpenAI, Vertex AI

Cloud AI security testing diagram concept: identities, data stores and agent tools around a managed model

Cloud AI security testing finds its worst bugs in the IAM, data access and logging around the model, not in the model itself. On Amazon Bedrock, Azure OpenAI Service and Google Vertex AI, an overprivileged knowledge base role or a leaked API key exposes more data than any jailbreak.

The short answer

  • Cloud AI security testing treats Bedrock, Azure OpenAI and Vertex AI as IAM workloads: who can invoke, which identity reads data, how tools are authorized, what is logged.
  • The highest-severity findings are overprivileged RAG service roles, account-level API keys, agent tools trusting model-chosen parameters and missing invocation logs.
  • Provider multi-tenancy is out of scope; test your own tenant isolation, network exposure and key policies instead.
  • Guardrails and content filters reduce harmful output but are not authorization boundaries.

Key takeaways

  • Cloud AI security testing is an IAM and data-perimeter test first; jailbreaks are rarely the highest-severity finding.
  • Knowledge base service roles, managed identities and service accounts often reach data the calling user cannot, which turns RAG into privilege escalation.
  • Azure OpenAI API keys are account-level bearer secrets with no per-user attribution; disable local auth and enforce Entra ID where possible.
  • Data-plane invocation logging is opt-in on Bedrock and Vertex AI, and Azure OpenAI needs diagnostic settings configured, so many teams cannot reconstruct what reached the model.
  • Provider multi-tenancy is out of scope; your own application's tenant isolation, agent tool authorization and logs are in scope and are where real leaks happen.

What is cloud AI security testing, and how does it differ from LLM application testing?

Cloud AI security testing examines the cloud workload around a managed model: who can invoke it, which identities its knowledge bases and agents run as, what data those identities reach, how tools are authorized and what gets logged. An LLM application test starts at the chat box and works inward. This one starts at IAM and works outward.

On all three platforms, model invocation is a data-plane API call authorized by cloud identity: AWS IAM for Bedrock, Microsoft Entra ID or API keys plus Azure RBAC for Azure OpenAI, and Google Cloud IAM for Vertex AI. That is why the high-severity findings look like cloud bugs rather than AI bugs.

Typical examples: a knowledge base role that reads an entire S3 bucket, an Azure OpenAI key shipped in a front-end bundle, an agent Lambda that trusts whatever user ID the model hands it, and no invocation log showing what left the building.

You need both layers. LLM application penetration testing covers prompts, output handling and plugins; the cloud layer covers the identities and data paths underneath. Map results to CWE-284, CWE-639 and CWE-269 on the access-control side.

On the AI side, use the OWASP Top 10 for LLM Applications (2025), mainly LLM01 Prompt Injection, LLM02 Sensitive Information Disclosure, LLM06 Excessive Agency, LLM08 Vector and Embedding Weaknesses and LLM10 Unbounded Consumption.

Shared responsibility and rules of engagement

The provider secures model serving, model weights, physical infrastructure and tenant separation inside the service. You secure everything you configure: IAM and RBAC assignments, API keys, service roles and managed identities, data source permissions, vector indexes, agent tools and their execution roles, network exposure, encryption key policies, logging and application logic.

AWS, Microsoft and Google generally permit testing of resources you own and prohibit testing their infrastructure or other customers. Get written authorization from the account owner, read the current service-specific terms before kickoff, and use synthetic data and canary strings instead of production records.

Managed AI defaults change often. Verify action names, role names and log categories against current vendor documentation at the start of every engagement.

How do you test Amazon Bedrock workloads?

Amazon Bedrock penetration testing starts with IAM: list every principal that holds Bedrock runtime actions and every role the Bedrock service itself assumes. The actions that matter include bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream, bedrock:Converse, bedrock:ConverseStream, bedrock:Retrieve, bedrock:RetrieveAndGenerate and bedrock:InvokeAgent.

  • bedrock:* on Resource: "*". Common in developer and CI roles. It covers every model the account enables later, including expensive ones, so a leaked role becomes an LLM10 cost problem.
  • Model access treated as authorization. Third-party model access is enabled per account and region, and it only decides which models are available. IAM separately governs which principals can invoke them. “We only enabled two models” says nothing about who can call those two.
  • Knowledge base service roles. The role that reads S3 and queries the vector store usually sees far more than any single user. A caller with bedrock:Retrieve on the knowledge base inherits that reach.
  • Agent execution roles. Check what the action group Lambda’s role can touch, not just what the agent is meant to do.
  • Trust policies. Look for missing aws:SourceAccount and aws:SourceArn conditions on roles Bedrock assumes, the classic confused-deputy gap.
  • PrivateLink. An interface endpoint keeps runtime traffic off the internet but authorizes nothing. Check the endpoint policy and whether IAM or SCP conditions actually force calls through it.
  • KMS. Read key policies and grants on keys protecting knowledge base data and logs. A broad decrypt grant is a data access path.

IAM Access Analyzer, the IAM Policy Simulator, Prowler, ScoutSuite and Steampipe cover the AWS side. Their Bedrock coverage is thinner than for EC2 or S3, so plan to write your own queries for service roles and action groups.

How do you test Azure OpenAI Service security?

Treat Azure OpenAI as a Cognitive Services account with two authentication paths, API keys and Entra ID tokens, and establish which one the workload actually uses. Keys are usually the first finding.

  • Keys are account-level bearer secrets. They are not scoped to a deployment and carry no per-user attribution in logs. Hunt for them in App Service settings, Function configuration, CI/CD variables, front-end JavaScript, mobile builds, repo history and application logs (CWE-522).
  • Local auth still enabled. If disableLocalAuth is not set, keys work no matter how carefully RBAC was designed. Disabling it forces Entra ID and managed identity.
  • Role scope. The data-plane inference role is commonly Cognitive Services OpenAI User. Any role that includes Microsoft.CognitiveServices/accounts/listKeys/action, such as Contributor or Owner, can retrieve keys and bypass Entra ID entirely. Review assignments at subscription and resource-group scope, and check Privileged Identity Management for standing access.
  • On your data. Connections to Azure AI Search, Blob Storage and Cosmos DB run under a managed identity. That identity’s index and storage permissions define what retrieval can return, independent of the end user.
  • Network. Check public network access, private endpoints, IP rules and VNet integration, then confirm Azure Policy enforces them. RBAC and network controls fail independently: a tight role on a publicly reachable account with a leaked key is still open.

How do you test Vertex AI, and how do the three platforms compare?

On Vertex AI, everything resolves to Google Cloud IAM bindings and the service accounts behind them. Gemini and third-party models in Vertex AI Model Garden are invoked with OAuth access tokens from a user or service account.

  • Project-level roles/aiplatform.user. It covers prediction across the whole project and is often granted far more widely than intended. Check whether a narrower role, such as roles/aiplatform.user on a specific endpoint or data store, exists for the API your workload calls, instead of granting it project-wide.
  • Service account keys. Downloaded JSON keys are long-lived credentials. Prefer workload identity federation with short-lived tokens, and test for keys in repos, containers and CI.
  • Vertex AI Search and Agent Builder data stores. Connectors pull from Cloud Storage, BigQuery, websites and third-party sources. Test IAM on the data store, the credentials stored per connector and whether document ACLs survive ingestion.
  • VPC Service Controls. A perimeter around Vertex AI is the strongest exfiltration control on this platform. Test access levels, ingress and egress rules, and which projects sit outside it.
  • Cloud KMS. Review CMEK key bindings as you would KMS grants on AWS.

Google’s IAM Policy Analyzer and Policy Troubleshooter answer “who can do what on this resource” faster than reading bindings by hand.

The three platforms share a shape: identity gates invocation, a service identity reads your data, and agent tools run with their own permissions. Names and defaults differ.

Test area Amazon Bedrock Azure OpenAI Vertex AI
Invocation auth AWS IAM roles and policies API keys or Entra ID plus Azure RBAC Google Cloud IAM, OAuth tokens
Long-lived secret to hunt IAM user access keys Account API keys, valid until local auth is disabled Service account JSON keys
Main invocation risk bedrock:* on all resources Account-level keys, local auth enabled Project-wide aiplatform.user
RAG service Bedrock Knowledge Bases (service role) On your data via Azure AI Search (managed identity) Vertex AI Search data stores (service account)
Agent tools Action groups (OpenAPI schema or function schema) backed by Lambda Function and tool calling executed by your app Tools and extensions via OpenAPI, service account
Invocation logging Model invocation logging, opt-in Diagnostic settings, must be configured Data Access audit logs and request-response logging, opt-in
Network control PrivateLink plus endpoint policy Private endpoints, public access off VPC Service Controls perimeter
Customer keys AWS KMS Customer-managed keys (Key Vault) Cloud KMS (CMEK)

How do you test RAG knowledge base access control and tenant isolation?

Assume retrieval runs as the service identity, not the user, and make the application prove otherwise. Most RAG builds fail, because permission to invoke the model and permission to read the data are separate grants.

The decisive test: plant a canary document with a unique string where a low-privilege test user cannot read it directly, let it index, then query for it as that user. If the string comes back, the knowledge base is a privilege escalation path (CWE-284).

Then work through the isolation model the team chose:

  • Application metadata filters. Look for a tenant_id or department filter built from request parameters. Change it, remove it, send an array. If the client controls the filter, it is IDOR with extra steps (CWE-639).
  • Native document ACLs. Azure AI Search supports security filters, but the application must pass the user’s identity and apply them on every query. Check the code path, not the feature list.
  • Per-tenant indexes or data stores. Stronger, but verify the application cannot be talked into a different index or knowledge base ID.
  • Ingestion authorization. Who can write to the S3 prefix, Blob container or Cloud Storage bucket that feeds the index? Write access there enables indirect prompt injection and RAG poisoning (LLM08) without ever touching the model.

Application-level tenant isolation

You cannot test the provider’s tenant isolation, and trying violates the cloud terms. Your own application’s isolation is where real cross-tenant leaks happen. Provision two test tenants and attack the boundary between them:

  • One knowledge base or vector index shared across tenants, separated only by a metadata field.
  • Vector namespaces treated as isolation with no application-enforced filter on every query.
  • A missing tenant filter in one code path, often an admin or export feature.
  • One static API key for every tenant, which also kills per-tenant attribution in logs.
  • IDOR on conversation, session or thread IDs that lets tenant A read tenant B’s chat history.

These are ordinary access-control bugs that happen to carry AI data, so rate them that way. A RAG pipeline security assessment runs these checks end to end, from source permissions through chunk provenance to what the model can cite.

What are agent action groups, and how do you test excessive agency?

An action group is the set of tools a Bedrock agent can call, defined by an OpenAPI schema or function schema and usually backed by a Lambda running under its own role. Azure OpenAI function calling and Vertex AI tools follow the same pattern: the model picks a tool and parameters, and some code executes it with real permissions.

Excessive agency (LLM06) is when that code does more than the user is entitled to. The tests:

  • Parameter trust. Ask the agent to act on another customer’s record. If the Lambda takes customer_id from model output instead of authenticated session attributes, you have a confused deputy.
  • Role reach. Compare the execution role’s permissions with the tool’s purpose. A refund tool whose role can write to unrelated DynamoDB tables is a finding before you exploit it.
  • Back-end auth. Call the API Gateway or Cloud Run endpoint behind the tool directly. Tools are often reachable without the agent in front.
  • Confirmation on side effects. Check whether payments, deletions and outbound messages require explicit user confirmation, and whether injected content can skip it.
  • Injection through tool output. Return attacker-controlled text from a tool or retrieved page and see whether it triggers the next call.

On Azure OpenAI the platform executes nothing; your application runs every function, so authorization lives entirely in your code. We cover the full method in how to test excessive agency in AI agents.

Guardrails are not an access control

Bedrock Guardrails, Azure OpenAI content filters and Vertex AI safety filters reduce harmful output. They do not decide who may read which document or call which tool. Test them for bypasses and for false positives, report results as defense in depth, and never accept a guardrail as the fix for an authorization finding.

Agent action group excessive agency concept for cloud AI security testing on managed AI platforms
Agent tools act with their execution role, not the user's rights.

What logging gaps exist, and how should findings be ranked?

The common gap: control-plane events are logged, data-plane invocations are not. You can see who created the knowledge base, but not which prompts pulled which documents out of it.

  • Bedrock: CloudTrail records management events. Model invocation logging, which writes requests and responses to CloudWatch Logs or S3, is opt-in. Check separately which data events CloudTrail captures for runtime calls.
  • Azure OpenAI: diagnostic settings export audit, request and metrics data to Azure Monitor Logs, Storage or Event Hub, but only once someone configures them.
  • Vertex AI: Admin Activity audit logs are on by default. Data Access logs are opt-in, and request-response logging to BigQuery or Cloud Logging must be configured.

Azure OpenAI abuse monitoring may also retain prompts and completions for up to 30 days with possible human review, and eligible customers can apply for modified handling. Check Microsoft’s current policy and make sure your data protection team knows which regime applies.

Send a canary prompt through the application, then ask the SOC to find it, attribute it to a user and say what data came back. With invocation logging off, incident response has no record of what reached the model. With shared keys, the best answer is “someone with the key.”

When logging is on, test the opposite problem. Prompt and response logs hold the same sensitive data as the knowledge base (CWE-532). Check who can read the log group, bucket or BigQuery dataset, and whether the protecting KMS key is scoped to match.

Test sequence and tooling

  1. Inventory: accounts, subscriptions and projects; deployments; knowledge bases and data stores; agents and tools; every attached identity.
  2. Invocation rights: who can call which model, with keys or identities, from which networks.
  3. Data reach: service identities tested with canary documents.
  4. Tools: execution roles, back-end auth, parameter trust, confirmation flows.
  5. Tenant boundary: two-tenant tests on indexes, filters and session IDs.
  6. Prompt layer: direct and indirect injection with promptfoo, garak or PyRIT, on synthetic data.
  7. Logging: canary tracing and access review of the logs themselves.

For IAM analysis, pair the cloud-native analyzers named above with Prowler or ScoutSuite across accounts. Report in this order: cross-tenant and cross-user data access, agent actions beyond the user’s rights, exposed or shared keys, missing invocation logging, network exposure, then guardrail bypasses. Map findings to MITRE ATLAS and the NIST AI RMF functions when the client reports against them.

Cloud AI security testing concept: an overprivileged service identity reaching storage beyond a managed AI model
Service roles often reach far more data than the users who call them.
RAG knowledge base access control test with a canary document leaking through retrieval in cloud AI security testing
A canary document is the fastest proof that retrieval ignores user permissions.

FAQ

Can I pentest Amazon Bedrock, Azure OpenAI or Vertex AI without asking the provider?

Generally you may test resources you own without prior approval, but not provider infrastructure or other customers. Read the current service-specific terms, get written authorization from the account owner and use synthetic data.

Does enabling only a few Bedrock models limit who can use them?

No. Model access decides which models are available in an account and region. IAM decides which principals can invoke them, so a broad bedrock:* grant still reaches every enabled model.

Is Azure AI Search document-level security automatic for RAG?

No. Azure AI Search supports security filters, but your application must pass the user's identity and apply the filter on every query. Test the code path that builds the query.

Are content filters and guardrails enough to stop data leaks?

No. They shape model output. Access to documents and tools is decided by IAM, service identity permissions and application authorization, so leaks must be fixed there.

Which tools help with cloud AI IAM analysis?

IAM Access Analyzer and the IAM Policy Simulator on AWS, Google's IAM Policy Analyzer and Policy Troubleshooter, plus Prowler, ScoutSuite and Steampipe. Expect to write custom queries for AI service roles and agent tools.

agent::offense tests managed AI workloads from IAM to invocation logs, with canary-driven proof for every data path. See our LLM application penetration testing service to scope a Bedrock, Azure OpenAI or Vertex AI engagement.



// get started

Work with AgentOffense

Tell us about your target and goals. We’ll reply with scope and a fixed-price quote — usually within one business day.

./request_engagement