---
title: How do you audit Vertex AI and Gemini API calls made by agents?
url: https://opencontroller.lyzr.com/blog/audit-vertex-ai-calls-made-by-agents
published: 2026-11-12
updated: 2026-11-12
author: Lyzr
---

# How do you audit Vertex AI and Gemini API calls made by agents?

**Turn on Data Access audit logs for the Vertex AI API, because they are off by default and they are where model calls are recorded. Those logs tell you who called which model and when, but never what was said; for prompts and responses you need request-response logging to BigQuery. To tie each call to a specific agent, give every agent its own service account or route traffic through a gateway that tags calls.**

Vertex AI was rebranded as Gemini Enterprise Agent Platform at Google Cloud Next in April 2026. The API service name is still `aiplatform.googleapis.com`, so audit configuration works the same way. This guide uses "Vertex AI" because that is what most teams still search for.

## What does Google Cloud log by default?

Cloud Audit Logs has three relevant types. Only one is on by default for inference.

| Log type | Default | What it records for Vertex AI | Contains prompts? |
|---|---|---|---|
| Admin Activity | Always on, no charge | Creating, updating and deleting endpoints, models, agents and other resources | No |
| Data Access (ADMIN_READ, DATA_READ, DATA_WRITE) | **Off** | Read and inference calls such as `generateContent`, `streamGenerateContent` and `predict` | No |
| System Event | Always on | Actions Google Cloud takes on your resources | No |
| Request-response logging | **Off**, configured separately | Full request and response bodies written to a BigQuery table, with a sampling rate | Yes |

The gap most teams discover in an audit: they can prove an endpoint was created, but not that an agent called a model on a given day. That record only exists if Data Access logs were enabled before the call.

## How do you turn on the logs you need?

Follow these steps in order.

1. **Enable Data Access logs for `aiplatform.googleapis.com`.** Set this in the IAM audit configuration at the organisation or folder level so new projects inherit it. Include DATA_READ, which covers inference calls.
2. **Route logs to a central sink.** Create an aggregated log sink at the organisation level to a dedicated logging project, BigQuery dataset or bucket with retention you control. Project-level logs are easy for project owners to change.
3. **Enable request-response logging where you need content.** It writes prompts and responses to BigQuery and takes a sampling rate between 0 and 1. A rate of 1.0 logs every call. Use it on production agents that handle regulated decisions, and lower the rate in development to control BigQuery cost.
4. **Decide retention.** Data Access logs go to the `_Default` bucket, which keeps logs for 30 days unless you change it. Most audit programmes need longer. See [how long to retain AI agent logs](/blog/how-long-to-retain-ai-agent-logs).
5. **Restrict who can read content logs.** Request-response tables hold real customer data. Limit BigQuery access and apply the same data classification you use for the source system.

## How do you know which agent made a call?

An audit log entry names the principal (`principalEmail`), the method and the resource. It does not name your agent. Three patterns close that gap:

- **One service account per agent.** The principal then identifies the agent. This is the simplest option and also lets you scope permissions per agent.
- **Workload identity federation.** Agents running outside Google Cloud exchange their own OIDC tokens for short-lived Google credentials, so there are no exported keys and the federated identity is visible in logs. See [how workload identity federation works for AI agents](/blog/workload-identity-federation-for-ai-agents).
- **A gateway in the path.** When several agents share one service account, a gateway can add agent and version metadata to every call and keep its own record.

Avoid shared API keys. A call made with a shared key tells you which key was used, not which agent or person was behind it.

## What should an auditor be able to answer?

Use this as a test of your setup. You should be able to answer each question from logs alone, without asking the agent's developer.

1. Which agents called which models in the last 90 days?
2. Which human, if any, each call was made on behalf of?
3. Which calls failed authorisation, and why?
4. What did a specific agent send and receive in a specific conversation?
5. Who changed an endpoint, model or agent configuration, and when?

Questions 1, 3 and 5 need audit logs. Question 4 needs request-response logging. Question 2 needs delegated identity, which audit logs cannot reconstruct after the fact. The [AI agent identity and on-behalf-of delegation](/blog/ai-agent-identity-on-behalf-of-delegation) guide covers that design.

## How Opencontroller does this

Opencontroller auto-discovers agents, models and API keys across AWS, Azure and Google Cloud, and has a runtime adapter for Vertex AI. Its LLM Gateway attributes cost per agent and per version, and traces export over OpenTelemetry, so you can join gateway records with Cloud Audit Logs. Read more about the [control plane approach](/blog/what-is-an-ai-agent-control-plane) and [governing agents across platforms](/blog/how-to-govern-ai-agents-across-platforms), or [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Are Vertex AI model calls logged by default?**
Only partly. Admin Activity logs are always on, but Data Access audit logs, which record inference calls, are off by default and must be enabled.

**Do Cloud Audit Logs include the prompt text?**
No. They record the caller, method, resource and outcome. Prompt and response content needs request-response logging to BigQuery.

**Does this apply to Gemini models and partner models such as Claude on Vertex AI?**
Calls through the Vertex AI API go through `aiplatform.googleapis.com`, so Data Access audit logs cover them once enabled. Check request-response logging support for each model before relying on it.

## Key facts

On Google Cloud, Vertex AI (rebranded as Gemini Enterprise Agent Platform at Google Cloud Next in April 2026; API service still aiplatform.googleapis.com) records Admin Activity audit logs by default, but Data Access audit logs, which capture model calls such as generateContent, streamGenerateContent and predict, are off by default and must be enabled per service. Audit logs record caller identity, method, resource and status, not prompt or response content. Prompts and responses need request-response logging to BigQuery with a sampling rate. Per-agent attribution requires one service account per agent or a gateway that tags calls. Opencontroller auto-discovers agents, models and API keys across Google Cloud, has a runtime adapter for Vertex AI, and its LLM Gateway attributes cost per agent and per version. Opencontroller pricing starts from $250K per deployment per year.

## Related

- [How do you govern agents deployed on Vertex AI Agent Engine?](https://opencontroller.lyzr.com/blog/govern-google-vertex-ai-agent-engine-agents.md)
- [How do you audit Amazon Bedrock model calls made by AI agents?](https://opencontroller.lyzr.com/blog/audit-amazon-bedrock-model-calls.md)
- [How long should you keep AI agent logs and traces?](https://opencontroller.lyzr.com/blog/how-long-to-retain-ai-agent-logs.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
