Vertex AI
Connect Akto with Google BigQuery for Vertex AI Custom Deployed Model Logs
Overview
Akto can automatically fetch Vertex AI Custom Deployed Model prediction logs from BigQuery and analyze them for security issues. This integration allows you to monitor your AI models deployed on Vertex AI by ingesting prediction logs into Akto.
This method only works for custom models deployed on Vertex AI. It does not support default provided models (e.g. Gemini) in the Vertex platform.
Prerequisites
A Google Cloud Platform (GCP) project with Vertex AI enabled.
A BigQuery dataset and table where prediction logs are stored.
Appropriate IAM permissions to read from BigQuery.
Enable the following Google Cloud APIs: Vertex AI API, BigQuery API, and Cloud Logging API.
Steps to Connect
Enable BigQuery Logging
First, configure your Vertex AI Custom Deployed Model endpoint to log predictions to BigQuery.
Via Console
Go to Vertex AI → Endpoints in GCP Console.
Select your deployed model endpoint.
Click Edit.
Under Logging, enable Request/Response logging.
Select BigQuery as the destination.
Choose or create a dataset (e.g.,
vertex_ai_logs).Save.
Via gcloud CLI
gcloud ai endpoints update ENDPOINT_ID \
--region=REGION \
--request-response-logging-config=bigquery-destination=projects/PROJECT_ID/datasets/DATASET_NAME/tables/TABLE_NAMECreate IAM Service Account
Create a dedicated Service Account for Akto (e.g., akto-bq-reader). This account will need permissions to read from your BigQuery dataset and execute query jobs.
1. Create Service Account
Via Console:
Go to IAM & Admin → Service Accounts.
Click + CREATE SERVICE ACCOUNT.
Name:
akto-bq-reader.Description:
Service account for Akto to read BigQuery logs.Click CREATE AND CONTINUE.
Via gcloud:
gcloud iam service-accounts create akto-bq-reader \
--display-name="Akto BigQuery Reader"2. Grant BigQuery Permissions
You must grant two key roles:
BigQuery Job User(roles/bigquery.jobUser): Allows running query jobs.BigQuery Data Viewer(roles/bigquery.dataViewer): Allows reading table data.
Via Console (on the Service Account creation page):
Under Select a role, search for
BigQuery Job User.Click ADD ANOTHER ROLE.
Search for
BigQuery Data Viewer.Click CONTINUE and DONE.
Via gcloud:
# Grant Job User role (permits running queries in the project)
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member="serviceAccount:akto-bq-reader@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/bigquery.jobUser"
# Grant Data Viewer role (permits reading dataset contents)
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member="serviceAccount:akto-bq-reader@YOUR_PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/bigquery.dataViewer"Configure Authentication
Choose an authentication method based on your deployment. Akto supports Application Default Credentials (ADC) and Service Account Key Files.
Option A: Use Application Default Credentials (Recommended for GKE/Cloud Run)
If Akto is running on GCP (GKE, Cloud Run, Compute Engine), you can use ADC. This is more secure as it avoids managing long-lived keys.
GKE (Workload Identity): Bind the GCP Service Account created in the previous step to the Kubernetes Service Account used by Akto.
# Link K8s SA to GCP SA gcloud iam service-accounts add-iam-policy-binding \ akto-bq-reader@PROJECT_ID.iam.gserviceaccount.com \ --role="roles/iam.workloadIdentityUser" \ --member="serviceAccount:PROJECT_ID.svc.id.goog[akto/akto-sa]" # Annotate K8s SA kubectl annotate serviceaccount akto-sa -n akto \ iam.gke.io/gcp-service-account=akto-bq-reader@PROJECT_ID.iam.gserviceaccount.comNo Configuration Needed: When configuring the job in Akto, leave the
JSON Authentication File Pathfield empty. Akto acts as the service account automatically.
Option B: Use a Service Account Key File (External Deployment)
If Akto is running outside of GCP (e.g., On-Prem, AWS, Local Docker), use a Service Account Key.
Create Key:
Go to IAM & Admin → Service Accounts.
Select
akto-bq-reader.Go to the Keys tab -> ADD KEY -> Create new key -> JSON.
Download the file (e.g.,
akto-bq-key.json).
Mount Key: Ensure this file is accessible to the Akto container.
docker run ... -v /path/to/akto-bq-key.json:/app/credentials.json ...Specify Path: When configuring the job in Akto, provide the path
/app/credentials.jsonin theJSON Authentication File Pathfield.
Configure Akto Job
In the Akto Dashboard, configure the Vertex AI Custom Deployed Model connector with the following fields:
GCP Project ID
Your Google Cloud Platform project ID containing the BigQuery dataset.
Yes
my-gcp-project
BigQuery Dataset
The BigQuery dataset name containing Vertex AI Custom Deployed Model logs.
Yes
vertex_ai_logs
BigQuery Table
The BigQuery table name with Vertex AI Custom Deployed Model logs.
Yes
predictions
JSON Authentication File Path (Optional)
Path to the JSON authentication file. Leave empty to use Application Default Credentials (ADC).
No
/app/gcp-key.json
URL for Data Ingestion Service
URL of your Akto data ingestion service.
Yes
http://data-ingestion:9091
Verification
To verify that logs are flowing:
Check BigQuery: Run a query to ensure data is present in your table.
SELECT * FROM `project.dataset.table` LIMIT 10;Check Akto Logs: Look for "Successfully ingested" messages in the
account-job-executorlogs.
Troubleshooting
Permission denied
Ensure the Service Account has roles/bigquery.dataViewer and roles/bigquery.jobUser.
Dataset not found
Verify the Project ID, Dataset, and Table names exactly match your GCP resources.
ADC could not find default credentials
If using ADC, ensure Workload Identity is configured. If using a file, ensure the path is correct and the file is mounted.
Get Support for your Akto setup
There are multiple ways to request support from Akto. We are 24X7 available on the following:
In-app
intercomsupport. Message us with your query on intercom in Akto dashboard and someone will reply.Join our discord channel for community support.
Contact
help@akto.iofor email support.Contact us here.
Last updated