Skip to content

Commit 7686848

Browse files
seanzhougooglecopybara-github
authored andcommitted
feat: Add Vertex AI Agent Engine Sandbox integration for computer use
Implement AgentEngineSandboxComputer, a BaseComputer implementation that uses Vertex AI Agent Engine Computer Use Sandbox as a remote browser environment. This enables computer-use agents to operate in secure, isolated cloud-based browser environments. Key features: - SandboxClient: Low-level CDP client using vertexai SDK send_command() - AgentEngineSandboxComputer: BaseComputer implementation with session state management for sandbox sharing across invocations - Support for both auto-provisioning and bring-your-own-sandbox (BYOS) modes - Automatic token refresh and retry logic for transient navigation errors - Fix wait_5_seconds adapter to properly pass tool_context Co-authored-by: Xiang (Sean) Zhou <seanzhougoogle@google.com> PiperOrigin-RevId: 900292803
1 parent 9ca8c38 commit 7686848

File tree

11 files changed

+2122
-10
lines changed

11 files changed

+2122
-10
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Vertex AI Agent Engine Computer Use Sandbox integration.
16+
17+
This module provides a BaseComputer implementation that uses Vertex AI
18+
Agent Engine Computer Use Sandbox as the remote browser environment.
19+
20+
Example:
21+
```python
22+
from google.adk.integrations.vmaas import AgentEngineSandboxComputer
23+
from google.adk.tools.computer_use import ComputerUseToolset
24+
25+
computer = AgentEngineSandboxComputer(
26+
project_id="my-project",
27+
service_account_email="sa@my-project.iam.gserviceaccount.com",
28+
)
29+
toolset = ComputerUseToolset(computer=computer)
30+
agent = Agent(tools=[toolset], ...)
31+
```
32+
"""
33+
34+
from .sandbox_client import SandboxClient
35+
from .sandbox_computer import AgentEngineSandboxComputer
36+
37+
__all__ = [
38+
"AgentEngineSandboxComputer",
39+
"SandboxClient",
40+
]

0 commit comments

Comments
 (0)