Skip to main content
Google ADK Agents run before_model_callback and after_model_callback around every model invocation. Dome uses these callbacks to scan inputs and outputs with Guardrails. Generate both callbacks from one Dome instance to add protection in a few lines.

Install

See Install Dome for the full list of extras. Use vijil-dome[trust-adapters] instead when you also want identity and tool access control through Trust Runtime.

Guard an Agent

Both generators accept two optional arguments:
Dome is asynchronous internally and ADK does not yet support asynchronous model callbacks. Apply nest_asyncio before you build the Agent if you hit a nested event loop error.

Add the Full Trust Stack

secure_agent() adds identity, constraints, tool-level access control, attestation, and audit events to the content Guards. It modifies the ADK Agent in place:
See Trust Runtime for constraint sources and enforcement modes.

Deploy to Cloud Run

Follow the ADK Cloud Run deployment guide with the gcloud CLI, and add vijil-dome to your Agent’s requirements.txt. Request a container large enough for the Detector models, such as --cpu=4 --memory=8Gi.
Deploying through the ADK CLI is not supported, because it provides no way to declare extra requirements or increase the container size. Its default of 1 CPU and 512 MB is not enough for Dome’s default configuration.
The annoy package that backs the embeddings extra is not compatible with ADK Agents on Cloud Run. Use the default in-memory option when you need embeddings-based Detectors there.

Next Steps

Configure Guardrails

Tune the Guards behind the callbacks

Trust Runtime

Identity, tool access control, and audit events
Last modified on November 3, 2026