Google Cloud — Discovery
Connect your Google Cloud project (or a whole organization or folder) so SecureAI can inventory Vertex AI agents, endpoints, and models, along with the service accounts, keys, IAM bindings, audit logs, usage, and cost that surround them.This card only reads the project and never sends a prompt. If you want to run SecureAI’s LLM traffic on your own Google Cloud account, see Google Vertex AI — Inference on your account.
What SecureAI imports
- Vertex AI: agents (Agent Engine), serving endpoints, running batch and tuning jobs, and models — the Model Registry plus every publisher model in use (Gemini, Claude, open models).
- Agent Builder / Gemini Enterprise and Dialogflow CX (optional): Agent Builder (Discovery Engine) engines with their data stores, queried in the
global,us, andeulocations; and Dialogflow CX agents, queried inglobaland in the Vertex AI locations you configure. - Usage per model over the last 30 days: requests (and how many failed), input and output tokens, and prompt-cache tokens.
- Usage per credential over the last 30 days (Cloud Monitoring): total requests and requests to AI APIs (Vertex AI, Gemini API, Agent Builder, Dialogflow) for each service account and each API key. OAuth-client traffic (people and tools such as the console or
gcloud) is added up separately. It also gives the last use of those accounts and keys. - Usage by model and identity (optional): which service account or person called which Vertex AI model, taken from the Data Access audit logs if you have them on. See Usage by model and identity.
- Vertex AI used outside SecureAI: identities that called Vertex AI or Gemini directly, not through SecureAI’s inference connection. See Vertex AI used outside SecureAI.
- Cost over the last 30 days: this project’s actual AI spend from your BigQuery billing export, or an estimate at list price.
- NHIs: service accounts, user-managed service-account keys, API keys, Workload Identity Federation pools and providers, and OAuth clients — with their last use (from Policy Analyzer and from usage per credential) and their privilege risk. Revocable and restorable from the NHI Inventory, by hand or with automatic policies.
- IAM role bindings on the project.
- Cloud Audit Logs of the AI and identity services (Vertex AI, IAM, IAM Credentials, STS, API Keys, Resource Manager): the latest 200 events of the last 30 days.
Prerequisites
Enabled APIs
SecureAI reads each surface with the matching Google API. Enable them on the project (APIs & Services → Library, or withgcloud services enable):
A disabled API does not fail the sync: it shows up as a gap, API disabled in the project — enable it, naming the service. Agent Builder and Dialogflow are the exception: if their API is off, SecureAI takes it that the project does not use that product and does not flag it as a gap.
Roles
A service account that SecureAI acts as. Grant it these roles on the project (IAM & Admin → IAM → Grant access):
For actual cost, your Cloud Billing data must be exported to BigQuery, and the service account needs
roles/bigquery.dataViewer on the export dataset and roles/bigquery.jobUser on the project that runs the query.
To revoke and restore from SecureAI (optional), you need the role of each action you want to allow. If your deployment offers keyless access, grant them to a separate, revocation-only service account and keep the reading one with read-only roles; otherwise, grant them to the connector’s service account:
You do not need
roles/billing.viewer: it is a billing-account role, it cannot be granted on a project, and the connector does not use it.Credentials
Where to get them
Option A — JSON key- In the Google Cloud console, go to IAM & Admin → Service Accounts → Create service account (e.g.
secureai-discovery). - Go to IAM & Admin → IAM → Grant access, enter the service account’s email as the principal, and add the roles from Prerequisites.
- Back in Service Accounts, open the account → Keys → Add key → Create new key → JSON, and download the file.
- Paste the entire JSON into Service Account JSON, then delete the downloaded file.
gcloud:
- Create the service account and grant it the roles (steps 1 and 2 above).
-
In SecureAI’s connect form, the help text of the Service account to impersonate (keyless — instead of the JSON) field names the SecureAI account to authorize. In Google Cloud, open your service account → Permissions → Grant access, enter that account as the principal, and give it
roles/iam.serviceAccountTokenCreator. Withgcloud: - Enter your service account’s email in the field and leave the JSON empty.
Separate service account for revocation
If your deployment offers keyless access, you can keep reading and revoking apart. This is recommended over giving the revoke roles to the service account that reads:- Create a second service account (e.g.
secureai-revoke) and grant it only the revoke roles from Prerequisites. - On that account, grant
roles/iam.serviceAccountTokenCreatorto the SecureAI account named in the help text of the Service account for revocation (optional — separate from reading) field. - Enter its email in that field.
Organization or folder mode
To inventory several projects with one connector, fill in Organization or folder withorganizations/<number> or folders/<number> (e.g. organizations/123456789012).
- SecureAI finds the active projects with Cloud Asset Inventory and reads each one as if it were a single-project connector. The Google Cloud Project ID stays the quota and billing project.
- Grant the service account, on the organization or folder:
roles/cloudasset.viewer,roles/iam.securityReviewer, androles/aiplatform.viewer, plusroles/monitoring.viewerandroles/logging.viewerfor usage and audit. - Enable
cloudasset.googleapis.comon the service account’s project.
gcloud resource-manager folders add-iam-policy-binding <number> instead of gcloud organizations add-iam-policy-binding.
So that a sync finishes in reasonable time, each one has caps. The quota project goes first, then projects with Vertex AI resources:
Whatever falls outside a cap shows up as a partial gap, with how much was read. A project that cannot be read is also listed as a gap, and nothing of it is retired or pruned. When you connect, the test in this mode only enumerates the first page of projects and checks the quota project: reading each project is the sync’s job.
Connect
- Admin → Integrations → Cloud → Google Cloud — Discovery → Connect Integration.
- Enter the project ID, the location (or several in More Vertex AI Locations), and either the JSON key or the service account to impersonate. If you use them, add the service account for revocation, the organization or folder, and the billing fields.
- Click Connect. SecureAI checks the credentials with a real read of the project before saving — it takes a few seconds. If it cannot read the project, it shows why and saves nothing; what you entered stays in the form. The possible messages are in Troubleshooting.
- If it saves but some roles are missing, a warning lists them. Grant them and sync again.
- Sync now with the refresh button on the card. After that, SecureAI syncs automatically every 6 hours.
Verify
- Cloud Sensors lists the discovered agents. Click the Google Cloud card to open the GCP panel: usage and cost (requests, failures, tokens, cache, cost and its source), models and deployments, identity and access (service accounts and keys with their last use, IAM bindings), and audit.
- If the panel says Discovery could not read everything, review each line (see Troubleshooting) and sync again.
- The NHI Inventory shows the service accounts and keys.
Usage by model and identity
Cloud Monitoring tells how many requests each credential made, but not to which model. To know which identity called which model, SecureAI reads Vertex AI’s Data Access audit logs. It is optional and up to you:- SecureAI reads them only if DATA_READ or DATA_WRITE logs are on for
aiplatform.googleapis.com(or for all services). SecureAI detects this in the IAM policy; it never turns them on. - Turning them on has a Cloud Logging ingestion cost, at Google’s rates. You turn them on in IAM & Admin → Audit Logs → Vertex AI API → Data Read.
- The service account needs
roles/logging.privateLogViewer. - Per project and sync, SecureAI reads up to 5,000 entries or for 20 seconds, whichever comes first.
- If they are off, the panel shows an optional gap explaining how to turn them on. If you turned them on at the organization or folder but connect a single project, SecureAI cannot see it from the project’s policy and shows the gap anyway.
Privilege risk
With the IAM policy read, SecureAI flags a service account as privileged when it holds any of these roles:- Owner (
roles/owner) or Editor (roles/editor); - any admin role (
roles/<service>.adminor ending inAdmin); roles/iam.serviceAccountTokenCreatororroles/iam.serviceAccountUser, which let the holder act as other service accounts.
Vertex AI used outside SecureAI
In the GCP panel, the Identity & Access tab includes Vertex AI used outside SecureAI: the identities that called Vertex AI or Gemini directly in the last 30 days, not through the Vertex AI inference connection. Those prompts passed no DLP, policy, or signed receipt.- With Data Access audit logs on (see Usage by model and identity), each row names the models called and how many times, and only inference calls are counted.
- Without them, the count comes from Cloud Monitoring per credential (service account or API key) and includes every call to an AI API (Vertex AI, Gemini API, Agent Builder, Dialogflow), not only inference.
- The inference connection’s service account and the connector’s are never counted. People are not listed one by one: their calls go in a single aggregate row (People (Google accounts), or People and tools (OAuth): console, gcloud, apps).
- If SecureAI could not read the inference connection in that sync, it classifies nothing, reports it as an optional gap, and keeps what the previous sync found.
- It raises the Insights finding Google Vertex AI / Gemini is being used outside SecureAI: moderate, and critical when the caller is an API key (a long-lived credential). It maps to OWASP LLM02, ISO/IEC 42001 A.4.2 and A.6.2.6, and NIST AI RMF MAP-1.1 and GOVERN-6.1.
Cost
- With the billing export table: this project’s actual spend on AI services (Vertex AI, Gemini API, Agent Builder, Dialogflow, …), net of credits, in your billing account’s currency. When credits cover the usage the net can be zero; the panel then shows the amount before credits next to it. Google updates the export with a delay of several hours.
- Without it: an estimate — tokens from Cloud Monitoring × list price, including Claude and prompt-cache tokens. It does not reflect discounts or committed-use contracts.
Revocation and restore
GCP identities are revocable from the NHI Inventory (padlock) when the connector, or the service account for revocation, has the role of that action (see Prerequisites). What each one does at Google:
To undo a revocation, open the identity’s menu in the NHI Inventory and choose Restore (Undo the revocation at Google Cloud). The identity is enabled again in Google Cloud, and in SecureAI it is unblocked and stays In remediation until you review it.
- Only what SecureAI revoked at Google Cloud can be restored, by hand or through an automatic policy. It is not offered for a block on SecureAI’s gateway only, nor for an identity your team disabled directly in Google Cloud.
- A deleted service-account key cannot be restored: SecureAI refuses without calling Google.
- Restoring uses the same roles as revoking.
- The service account the connector uses, and its keys, cannot be revoked from SecureAI — that would cut discovery off. The same goes for the service account for revocation. Rotate them in Google Cloud.
- Nor can the service account that the Vertex AI inference connection authenticates with be revoked, nor the key it signs with: it would stop every governed call. With the keyless (impersonation) option only the service account is protected: its keys can still be revoked, because SecureAI signs with none of them. If SecureAI cannot check which identity the inference connection uses, it does not revoke any service account or service-account key (API keys are unaffected).
- Google’s default service accounts (Compute Engine default, App Engine, Cloud Build, service agents) ask for a second confirmation: disabling one stops every VM, app, or build that runs as it.
- If the connector lacks the role for an action, the error names the role.
Automatic NHI policies
Automatic NHI policies (NHI Inventory → Automatic policies) alert on or revoke Google Cloud identities by rule, without reviewing them one by one. They are evaluated at the end of every successful sync of the connector, over its identities only.
Each rule has three modes: Off, Alert, and Revoke. All start off. The safeguards:
- Simulation mode (dryRun) is on by default: with it, no rule set to Revoke cuts anything; it only lists what it would do. Turning it off is the only thing that enables real cuts. Simulate with this configuration shows the effect before you save.
- Revocation cap per run: 5 by default (1 to 50). If in one run the Revoke rules match more identities than the cap, nothing is cut and an alert is sent.
- Exclusions: no rule acts on an identity whose owner, name, or resource matches a pattern;
*is the only wildcard. - Only complete key listings are evaluated.
- A credential SecureAI uses (the connector’s, the revocation account’s, or the Vertex AI inference one) is never cut. Keys of Google’s default service accounts are never cut automatically: the rule only alerts, and a person decides.

