Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Run through the Getting Started section of the notebook.
/ 10
Run through the Supported models section of the notebook.
/ 10
Run through the Computer Use: agent loop section of the notebook.
/ 10
Run through the 1. Send a request to the model section of the notebook.
/ 10
Run through the 2. Receive the model response section of the notebook.
/ 10
Run through the 3. Execute the received actions section of the notebook.
/ 10
Run through the 4. Capture the new environment state section of the notebook.
/ 10
Clean up by closing the browser and stopping the session
/ 15
Run through the Build an agent loop section of the notebook.
/ 15
Run through the Getting Started section of the notebook.
/ 10
Run through the Supported models section of the notebook.
/ 10
Run through the Computer Use: agent loop section of the notebook.
/ 10
Run through the 1. Send a request to the model section of the notebook.
/ 10
Run through the 2. Receive the model response section of the notebook.
/ 10
Run through the 3. Execute the received actions section of the notebook.
/ 10
Run through the 4. Capture the new environment state section of the notebook.
/ 10
Clean up by closing the browser and stopping the session
/ 15
Run through the Build an agent loop section of the notebook.
/ 15
Automation of repetitive web-based tasks—such as data entry, price comparison, or application testing—is often a time-consuming manual process for developers and data analysts. Manually navigating complex UIs to extract or input information lacks scalability and is prone to human error.
In this lab, you solve this problem by building an autonomous web agent using the Gemini Computer Use model. You use the Agent Platform SDK for Python and Playwright to create a system that can "see" a browser screen via screenshots and "act" by simulating mouse clicks and keyboard inputs. You implement a continuous "agent loop" that allows the model to process feedback from the environment and iterate until a specific goal is achieved.
Before starting this lab, you should be familiar with:
In this lab, you use the
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
In the Google Cloud console, you open an Agent Platform Workbench instance.
Open the
In the Select Kernel dialog, choose Python 3 (Local) from the list of available kernels.
Run through the Getting Started section of the notebook. The Project ID and Location are pre-configured for you.
In this task, you open your Agent Platform Workbench instance and initialize the notebook. You configure the SDK to use global endpoints to access the
Click the
Run through the Get started section of the notebook.
Install the Agent Platform SDK for Python for Python using the pip command. This library provides the essential tools required to interact with the
Install Playwright. This is a tool for browser automation.
Prepares your environment to build an AI agent that can "see" and interact with the web. It combines the Google Agent Platform SDK for Python for intelligent decision-making with Playwright for browser automation, providing all the necessary tools for the AI to navigate websites, run functions, and perform complex tasks autonomously.
This code connects your project to Google Cloud's AI power. By defining your Project ID and Location, you're telling the system where to work, while the genai.Client acts as the secure bridge to access Agent Platform models.
Click Check my progress to verify the objective.
Set the
Click Check my progress to verify the objective.
In this task, you explore the iterative agent loop and set up its secure execution environment.
Run through the Explore an agent loop section in the notebook to learn about the iterative process required for an AI model to interact with a dynamic environment like a web browser. Unlike standard LLM interactions, which are "stateless," a Computer Use agent must continuously observe, reason, and act to reach a goal.
Run through the Prerequisites: Set up your environment section to launch a virtual, high-definition browser session using Playwright so your AI can navigate and interact with websites in the background.
Click Check my progress to verify the objective.
In this section you walk through the code for a single turn of the agent loop, from sending the first request to preparing for the next one.
Click Check my progress to verify the objective.
FunctionCalls, which define the specific UI actions it wants to execute.Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
This shuts down the browser and terminates the active Playwright session to clean up system resources. This follows best practices and ensures resource efficiency, environment stability, and security.
Click Check my progress to verify the objective.
In this task, you build an autonomous execution loop to reason and call tools by combining the steps in the previous section.
Click Check my progress to verify the objective.
You've successfully built an autonomous web agent using the Gemini Computer Use model. By combining the Agent Platform SDK for Python with Playwright, you implemented an iterative agent loop capable of navigating live browser environments, executing UI actions, and processing real-time visual feedback to complete complex automation tasks.
Check out the following resources to learn more about Gen AI and the Gemini Enterprise Agent Platform:
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated May 18, 2026
Lab Last Tested March 31, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one