Opinion

Anuj Tambwekar
May 21, 2025
In our previous blog post, we showed how easily you can test agents built with Google ADK for reliability, safety, and security using Vijil Evaluate. We uncovered some failure modes of the ADK Travel Concierge agent in the process–particularly its vulnerability to various jailbreak attacks.
In this blog post, we'll show how to defend an agent built with ADK using Vijil Dome, our holistic guardrails module that protects against jailbreaks and prompt injections, prevents toxic content generation, ensures PII is obfuscated from agent responses, and a lot more.
We'll continue with the same travel agent example from our previous post and show you how to integrate Vijil Dome into your workflow.
Add Dome to Your Agent
Agents in ADK have before_model_callback and after_model_callback functions that are executed right before and after the model in the agent is invoked. Following ADK best practices, add the input and output guardrails of Dome into the agent via these callbacks.
Replace the existing agent.py file in the travel_concierge folder with the code below:
Note: Dome is designed to be async-first. However, ADK does not yet support async before and after model callbacks, which is why we use nest_asyncio.
The code block above just does three things that the original agent.py file does not:
It instantiates an instance of Dome with our recommended default configuration
It creates two functions - guard_input and guard_output, that use Dome to scan inputs and outputs to determine if they are safe
It applies guard_input and guard_output to the callback of every sub-agent and the root agent.
By applying these functions to every sub-agent, we ensure that every agent is individually protected, reducing the impact and reach of a malicious tool call or rogue agent in the multi-agent setup.
Run the Agent
Dome is now a part of your agent. You can run the travel concierge agent just like you normally would:
You can also evaluate it with Vijil Evaluate just like you would the base agent.
Deploy ADK Agents Protected with Dome
ADK agents protected with Dome can be deployed using Cloud Run. We recommend using Cloud Run as it makes it easy to include the wheel files needed to install Dome in the container, and allows you to provision a container that is sufficiently large to host your agent.
Deployment Steps
Create the dome directory structure. You likely already did this during the setup step.
Create a requirements.txt file in the travel_concierge directory with the following content::
Create a Dockerfile in the travel_concierge directory with the following content:
Deploy the agent with the following command:
Important: We recommend using 4 CPUs with 8GB of memory to prevent your container from running out of memory under load. The default settings of 1 CPU and 512MB of memory are insufficient for Dome's default configuration.
That's it! You can invoke your protected agent in the exact same fashion you would invoke any other agent deployed on ADK via Cloud Run.
Comparing Trust Scores
The standard ADK Travel Concierge scored 81.23 on our security evaluation and was vulnerable to multiple jailbreaks such as ILANA and Miasma. It was also capable of generating malware and leaking private information.
Defended by Dome, the Travel Concierge gains 15.6 points on the security score, achieving 96.77, and blocks all the failure modes we found earlier. We also see a small increase in the overall Trust Score to 95.65.

This is clearly an example of how Dome can improve the trustworthiness of an agent. We expect that your custom agent is instructed to perform a broader role with more domain-specific tasks. Vijil Dome is designed to augment the perimeter defense around custom agents. We’d love to hear from you about the difference you notice in your own testing before and after using Vijil Dome.
Next Step
Dome makes it easy to ensure that your agents remain compliant with your policies.
Vijil Dome is available as a Python package for a free private preview. Contact us at contact@vijil.ai and we'll send you a link to install Dome and try it out at no cost.