Gemini의 컴퓨터 사용 도구를 사용하면 그래픽 사용자 인터페이스 (GUI)에서 태스크와 상호작용하고 태스크를 자동화하는 브라우저, 모바일, 데스크톱 제어 에이전트를 빌드할 수 있습니다. 컴퓨터 사용이 사용 설정되면 모델은 스크린샷을 사용하여 화면을 관찰하고 마우스 클릭, 스크롤, 키보드 입력과 같은 특정 UI 작업을 생성하여 작동합니다.
Gemini는 다음과 같은 여러 고급 컴퓨터 사용 기능을 지원합니다.
- 다중 환경 지원: 브라우저, 모바일, 데스크톱 환경을 위한 에이전트를 빌드합니다.
- 인텐트를 사용한 간소화된 작업: 작업에는 각 단계의 모델 추론을 설명하는
intent필드가 포함됩니다. - 구성 가능한 안전 정책: 기본 제공 정책 카테고리와 재정의를 사용하여 안전 동작을 미세 조정합니다.
- 프롬프트 인젝션 감지: 숨겨진 적대적 요청을 감지하기 위해 스크린샷 스캔을 선택합니다.
컴퓨터 사용을 활용하여 다음 작업을 할 수 있는 에이전트를 빌드할 수 있습니다.
- 웹사이트와 데스크톱 애플리케이션에서 반복적인 데이터 입력과 양식 작성을 자동화합니다.
- 웹, 모바일, 데스크톱 사용자 플로우의 자동 테스트를 수행합니다.
- 웹사이트와 애플리케이션을 탐색하여 조사 자료를 수집합니다 (예: 제품 정보, 가격, 리뷰 비교).
- 여러 애플리케이션에서 여러 단계로 이루어진 일련의 작업을 수행하여 사용자를 지원합니다.
이 가이드에서는 다음을 설명합니다.
- 컴퓨터 사용 작동 방식
- 컴퓨터 사용을 사용 설정하는 방법
- 환경을 설정하고, 요청을 전송하고, 응답을 수신하고, 에이전트 루프를 빌드하는 방법
- 지원되는 환경 및 커스텀 함수
- 지원되는 컴퓨터 작업
- 안전 및 보안 지원
- 가격 책정
함수 호출과 마찬가지로 컴퓨터 사용 함수 호출을 수신하고 해당 작업을 실행하는 클라이언트 측 애플리케이션 코드를 작성해야 합니다.
이 가이드에서는 개발자가 Python용 Google 생성형 AI SDK를 사용하고 Playwright API에 익숙하다고 가정합니다.
GitHub에서 컴퓨터 사용을 위한 참조 구현을 찾을 수 있습니다.
지원되는 모델
컴퓨터 사용은 다음 모델에서 지원됩니다.
클릭하여 지원되는 모델 펼치기
컴퓨터 사용 작동 방식
Computer Use는 텍스트 대답을 생성하는 대신 마우스 클릭과 같은 특정 UI 작업을 수행할 시점을 결정하고 이러한 작업을 수행하는 데 필요한 파라미터를 반환합니다. 컴퓨터 사용 function_call을 수신하고 해당 작업을 실행하는 클라이언트 측 애플리케이션 코드를 작성해야 합니다.
컴퓨터 사용 상호작용은 에이전트 루프 프로세스를 따릅니다.
모델에 요청 보내기
- API 요청에 컴퓨터 사용 (및 선택적으로 추가 도구)을 추가합니다.
- 사용자 요청과 GUI 현재 상태를 나타내는 스크린샷을 사용하여 모델에 프롬프트를 전송합니다.
모델 대답 수신
- 모델은 사용자 요청과 스크린샷을 분석하고 UI 작업을 나타내는 추천
function_call(예: '좌표(x,y) 클릭' 또는 ''텍스트' 입력')이 포함된 대답을 생성합니다. 모델에서 사용할 수 있는 모든 작업 목록은 지원되는 작업을 참조하세요. - API 응답에는 모델의 제안된 작업을 확인한 내부 안전 시스템의
safety_decision도 포함될 수 있습니다. 이safety_decision는 작업을 다음과 같이 분류합니다.- 일반 또는 허용됨: 작업이 안전하다고 간주됩니다.
safety_decision가 없는 것으로도 나타낼 수 있습니다. - 확인 필요: 모델이 위험할 수 있는 작업을 수행하려고 합니다 (예: '쿠키 배너 수락' 클릭).
- 일반 또는 허용됨: 작업이 안전하다고 간주됩니다.
- 모델은 사용자 요청과 스크린샷을 분석하고 UI 작업을 나타내는 추천
수신된 작업 실행
- 클라이언트 측 코드에서
function_call및 함께 제공되는safety_decision를 수신합니다. safety_decision가 일반 또는 허용을 나타내는 경우(또는safety_decision가 없는 경우) 클라이언트 측 코드는 대상 환경(예: 웹브라우저)에서 지정된function_call을 실행할 수 있습니다.safety_decision에 확인이 필요하다고 표시되면 애플리케이션은function_call을 실행하기 전에 최종 사용자에게 확인하라는 메시지를 표시해야 합니다. 사용자가 확인하면 작업을 실행합니다. 사용자가 거부하면 작업을 실행하지 마세요.
- 클라이언트 측 코드에서
새 환경 상태 캡처
- 작업이 실행되면 클라이언트가 GUI의 새 스크린샷과 현재 URL을 캡처하여
function_response의 일부로 모델에 다시 전송합니다. - 안전 시스템에서 작업을 차단하거나 사용자가 확인을 거부하면 애플리케이션에서 모델에 다른 의견 양식을 전송하거나 상호작용을 종료할 수 있습니다.
- 작업이 실행되면 클라이언트가 GUI의 새 스크린샷과 현재 URL을 캡처하여
업데이트된 상태로 모델에 새 요청이 전송됩니다. 이 프로세스는 2단계부터 반복되며 모델은 새 스크린샷 (제공된 경우)과 지속적인 목표를 사용하여 다음 작업을 제안합니다. 태스크가 완료되거나 오류가 발생하거나 프로세스가 종료될 때까지 (예: 안전 필터나 사용자 결정에 의해 응답이 차단된 경우) 루프는 계속됩니다.
다음 다이어그램은 컴퓨터 사용의 작동 방식을 보여줍니다.

컴퓨터 사용 사용 설정
컴퓨터 사용을 사용 설정하려면 애플리케이션이 지원되는 모델 중 하나를 사용하고 있는지 확인하고 사용 설정된 도구 목록에 컴퓨터 사용을 추가합니다.
Python
from google import genai from google.genai import types from google.genai.types import Content, Part client = genai.Client( enterprise=True, project="PROJECT_ID", location="global", ) # Add computer use to the list of tools generate_content_config = types.GenerateContentConfig( tools=[ types.Tool( computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER, ) ), ] ) contents = [ Content( role="user", parts=[ Part(text="Go to google.com and search for 'weather in New York'"), ], ) ] response = client.models.generate_content( model="gemini-3.8-flash", contents=contents, config=generate_content_config, ) print(response)
Node.js
import { GoogleGenAI, Environment } from '@google/genai'; const ai = new GoogleGenAI({ enterprise: true, project: 'PROJECT_ID', location: 'global', }); const response = await ai.models.generateContent({ model: 'gemini-3.8-flash', contents: "Go to google.com and search for 'weather in New York'", config: { tools: [ { computerUse: { environment: Environment.ENVIRONMENT_BROWSER, }, }, ], }, }); console.log(response);
REST API
curl -X POST "https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/google/models/gemini-3.8-flash:generateContent" \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ -d '{ "contents": [ { "role": "user", "parts": [ { "text": "Go to google.com and search for '\''weather in New York'\''" } ] } ], "tools": [ { "computer_use": { "environment": "ENVIRONMENT_BROWSER" } } ] }'
실행 환경 설정
컴퓨터 사용 도구로 빌드하기 전에 다음을 설정하세요.
- 안전한 실행 환경: 샌드박스 가상 머신 (VM) 또는 컨테이너 (예: Docker)에서 에이전트를 실행하여 호스트 시스템에서 격리합니다.
- 클라이언트 측 작업 핸들러: 마우스 클릭, 키보드 입력, 스크린샷 캡처를 실행하는 클라이언트 로직을 구현합니다.
먼저 SDK 및 브라우저 종속 항목을 설치한 후 환경을 구성합니다.
pip install --upgrade google-genai playwright termcolor playwright install chromium export GOOGLE_CLOUD_PROJECT="PROJECT_ID" export GOOGLE_CLOUD_LOCATION="global" export GOOGLE_GENAI_USE_ENTERPRISE=True
그런 다음 정규화된 좌표 (0~1000)가 정확하게 조정되도록 명시적인 표시 영역 크기로 Playwright 브라우저 인스턴스를 초기화합니다.
from playwright.sync_api import sync_playwright SCREEN_WIDTH = 1440 SCREEN_HEIGHT = 900 playwright = sync_playwright().start() browser = playwright.chromium.launch(headless=False) context = browser.new_context( viewport={"width": SCREEN_WIDTH, "height": SCREEN_HEIGHT} ) page = context.new_page() page.goto("https://www.google.com")
요청 전송
컴퓨터 사용 도구를 구성한 후 사용자 목표와 GUI 초기 스크린샷이 포함된 프롬프트를 모델에 전송합니다.
다음을 선택적으로 추가할 수도 있습니다.
- 제외된 작업: 모델에서 수행하지 않기를 원하는 작업이 지원되는 UI 작업 목록에 있으면
excluded_predefined_functions에 이러한 작업을 지정합니다. - 사용자 정의 함수: 컴퓨터 사용 외에 커스텀 사용자 정의 함수를 포함할 수 있습니다.
다음 샘플 코드는 컴퓨터 사용을 사용 설정하고 모델에 요청을 전송합니다.
Python
from google import genai from google.genai import types from google.genai.types import Content, Part client = genai.Client() # Specify predefined functions to exclude (optional) excluded_functions = ["drag_and_drop"] # Configuration for computer use with browser environment generate_content_config = genai.types.GenerateContentConfig( tools=[ # 1. Computer Use tool with browser environment types.Tool( computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER, # Optional: Exclude specific predefined functions excluded_predefined_functions=excluded_functions ) ), # 2. Optional: Custom user-defined functions (need to defined above) # types.Tool( # function_declarations=custom_functions # ) ], ) # Create the content with user message contents: list[Content] = [ Content( role="user", parts=[ Part(text="Search for highly rated smart fridges with touchscreen, 2 doors, around 25 cu ft, priced below 4000 dollars on Google Shopping. Create a bulleted list of the 3 cheapest options in the format of name, description, price in an easy-to-read layout."), # Optional: include a screenshot of the initial state # Part.from_bytes( # data=screenshot_image_bytes, # mime_type='image/png', # ), ], ) ] # Generate content with the configured settings response = client.models.generate_content( model='gemini-3.8-flash', contents=contents, config=generate_content_config, ) # Print the response output print(response.text)
커스텀 사용자 정의 함수를 포함하여 모델 기능을 확장할 수도 있습니다. 브라우저별 작업을 제외하면서 open_app, long_press_at, go_home과 같은 작업을 추가하여 모바일 사용 사례에 맞게 컴퓨터 사용을 구성하는 방법에 대한 자세한 내용은 Gemini 3.5 Flash 이상 및 모바일 또는 데스크톱 사용 사례를 참조하세요.
응답 수신
모델은 태스크를 완료하는 데 UI 작업이나 사용자 정의 함수가 필요하다고 판단되면 FunctionCalls 하나 이상으로 응답합니다. 애플리케이션 코드는 이러한 작업을 파싱 및 실행하고 결과를 수집해야 합니다.
컴퓨터 사용은 병렬 함수 호출을 지원합니다. 즉, 모델이 싱글턴에서 독립적인 작업을 여러 개 반환할 수 있습니다.
Gemini 3.5 Flash 이상 모델의 경우 각 작업에는 해당 단계의 모델 추론을 설명하는 intent 인수가 포함됩니다.
{ "content": { "parts": [ { "function_call": { "name": "type", "args": { "x": 450, "y": 320, "text": "smart fridge touchscreen 2 doors 25 cu ft under $4000", "press_enter": true, "intent": "Type the search query into the Google search box and submit." } } } ] } }
작업에 따라 API 응답은 함수 호출 인수 내에서 safety_decision를 반환할 수도 있습니다.
{ "content": { "parts": [ { "function_call": { "name": "click", "args": { "x": 60, "y": 100, "intent": "Click the 'I'm not a robot' verification checkbox.", "safety_decision": { "explanation": "I have encountered a CAPTCHA challenge that requires interaction. I need you to complete the challenge by clicking the 'I'm not a robot' checkbox and any subsequent verification steps.", "decision": "require_confirmation" } } } } ] } }
수신된 작업 실행
대답을 받은 후 function_call를 파싱하고 정규화된 0~1000 그리드에서 실제 표시 영역 픽셀 크기로 좌표를 조정한 후 작업을 실행합니다.
import time
from typing import Any, Dict, List, Tuple
import termcolor
def denormalize_x(x: int, screen_width: int) -> int:
"""Convert normalized x coordinate (0-1000) to actual pixel coordinate."""
return int(x / 1000 * screen_width)
def denormalize_y(y: int, screen_height: int) -> int:
"""Convert normalized y coordinate (0-1000) to actual pixel coordinate."""
return int(y / 1000 * screen_height)
def get_safety_confirmation(safety_decision: Dict[str, Any]) -> str:
"""Prompt user for confirmation when safety check is triggered."""
termcolor.cprint("Safety service requires explicit confirmation!", color="red")
print(safety_decision.get("explanation", ""))
decision = ""
while decision.lower() not in ("y", "n", "ye", "yes", "no"):
decision = input("Do you wish to proceed? [Y]es/[N]o\n")
if decision.lower() in ("n", "no"):
return "TERMINATE"
return "CONTINUE"
def execute_function_calls(
response, page, screen_width: int, screen_height: int
) -> List[Tuple[str, Dict[str, Any]]]:
"""Extract and execute modern and legacy function calls from Gemini response."""
candidate = response.candidates[0]
function_calls = []
thoughts = []
for part in candidate.content.parts:
if hasattr(part, "function_call") and part.function_call:
function_calls.append(part.function_call)
elif hasattr(part, "text") and part.text:
thoughts.append(part.text)
if thoughts:
print(f"Model Reasoning: {' '.join(thoughts)}")
results: List[Tuple[str, Dict[str, Any]]] = []
for function_call in function_calls:
fname = function_call.name
args = function_call.args or {}
action_result: Dict[str, Any] = {}
print(f" -> Executing: {fname} (Intent: {args.get('intent', 'N/A')})")
# Check for safety decision before executing
if "safety_decision" in args:
decision = get_safety_confirmation(args["safety_decision"])
if decision == "TERMINATE":
print("Terminating agent loop")
break
action_result["safety_acknowledgement"] = "true"
try:
if fname in ("open_web_browser", "open_app", "take_screenshot"):
pass
elif fname in (
"click",
"click_at",
"double_click",
"triple_click",
"middle_click",
"right_click",
"mouse_down",
"mouse_up",
"move",
"hover_at",
):
actual_x = denormalize_x(args["x"], screen_width)
actual_y = denormalize_y(args["y"], screen_height)
if fname in ("click", "click_at"):
page.mouse.click(actual_x, actual_y)
elif fname == "double_click":
page.mouse.dblclick(actual_x, actual_y)
elif fname == "triple_click":
page.mouse.click(actual_x, actual_y, click_count=3)
elif fname == "middle_click":
page.mouse.click(actual_x, actual_y, button="middle")
elif fname == "right_click":
page.mouse.click(actual_x, actual_y, button="right")
elif fname == "mouse_down":
page.mouse.move(actual_x, actual_y)
page.mouse.down()
elif fname == "mouse_up":
page.mouse.move(actual_x, actual_y)
page.mouse.up()
elif fname in ("move", "hover_at"):
page.mouse.move(actual_x, actual_y)
elif fname in ("type", "type_text_at"):
actual_x = denormalize_x(args["x"], screen_width) if "x" in args else None
actual_y = denormalize_y(args["y"], screen_height) if "y" in args else None
text = args["text"]
press_enter = args.get("press_enter", False)
clear_before_typing = args.get("clear_before_typing", True)
if actual_x is not None and actual_y is not None:
page.mouse.click(actual_x, actual_y)
time.sleep(0.1)
if clear_before_typing:
page.keyboard.press("ControlOrMeta+A")
page.keyboard.press("Backspace")
page.keyboard.type(text)
if press_enter:
page.keyboard.press("Enter")
elif fname in ("scroll", "scroll_at", "scroll_document"):
if "x" in args and "y" in args:
page.mouse.move(denormalize_x(args["x"], screen_width), denormalize_y(args["y"], screen_height))
direction = args.get("direction", "down")
magnitude = args.get("magnitude_in_pixels", args.get("magnitude", 300))
dx, dy = 0, 0
if direction == "down":
dy = magnitude
elif direction == "up":
dy = -magnitude
elif direction == "right":
dx = magnitude
elif direction == "left":
dx = -magnitude
page.mouse.wheel(dx, dy)
elif fname == "drag_and_drop":
start_x = denormalize_x(args.get("start_x", args.get("x", 0)), screen_width)
start_y = denormalize_y(args.get("start_y", args.get("y", 0)), screen_height)
end_x = denormalize_x(args.get("end_x", args.get("destination_x", 0)), screen_width)
end_y = denormalize_y(args.get("end_y", args.get("destination_y", 0)), screen_height)
page.mouse.move(start_x, start_y)
page.mouse.down()
page.mouse.move(end_x, end_y)
page.mouse.up()
elif fname == "press_key":
page.keyboard.press(args["key"])
elif fname == "key_down":
page.keyboard.down(args["key"])
elif fname == "key_up":
page.keyboard.up(args["key"])
elif fname == "hotkey":
page.keyboard.press("+".join(args.get("keys", [])))
elif fname == "key_combination":
page.keyboard.press(args["keys"])
elif fname == "navigate":
page.goto(args["url"])
elif fname == "search":
page.goto("https://www.google.com")
elif fname == "go_back":
page.go_back()
elif fname == "go_forward":
page.go_forward()
elif fname in ("wait", "wait_5_seconds"):
time.sleep(5 if fname == "wait_5_seconds" else args.get("seconds", 1))
else:
action_result["warning"] = f"unhandled_function: {fname}"
page.wait_for_load_state(timeout=5000)
time.sleep(1)
except Exception as e:
print(f"Error executing {fname}: {e}")
action_result["error"] = str(e)
results.append((fname, action_result))
return results
반환된 safety_decision이 require_confirmation이면 작업을 실행하기 전에 사용자에게 확인을 요청해야 합니다. 서비스 약관에 따라 인간 확인 요청을 우회할 수 없습니다.
새 상태 캡처
작업을 실행한 후 각 작업 결과와 업데이트된 스크린샷을 FunctionResponse에 패키징하여 모델에 반환합니다.
from google.genai import types from google.genai.types import Content, FunctionResponse, Part def get_function_responses( page, results: List[Tuple[str, Dict[str, Any]]] ) -> Content: """Capture screenshot and URL and package them as FunctionResponses.""" screenshot = page.screenshot(type="png") current_url = page.url function_response_parts = [] for name, action_result in results: function_response_parts.append( Part( function_response=FunctionResponse( name=name, response={ "url": current_url, **action_result, }, parts=[ types.FunctionResponsePart( inline_data=types.FunctionResponseBlob( mime_type="image/png", data=screenshot, ) ) ], ) ) ) return Content( role="user", parts=function_response_parts, )
에이전트 루프 빌드
이러한 단계를 모델과 실행 환경 간에 지속적으로 반복되는 엔드 투 엔드 루프로 결합합니다.
Python
from google import genai from google.genai import types from google.genai.types import Content, Part from playwright.sync_api import sync_playwright def has_function_calls(response) -> bool: """Check if model response contains any function calls.""" candidate = response.candidates[0] return any( hasattr(part, "function_call") and part.function_call for part in candidate.content.parts ) def main(): client = genai.Client( enterprise=True, project="PROJECT_ID", location="global", ) generate_content_config = types.GenerateContentConfig( tools=[ types.Tool( computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER, enable_prompt_injection_detection=True, ) ) ], ) screen_width, screen_height = 1440, 900 with sync_playwright() as p: browser = p.chromium.launch(headless=False) context = browser.new_context( viewport={"width": screen_width, "height": screen_height} ) page = context.new_page() page.goto("https://www.google.com") initial_screenshot = page.screenshot(type="png") contents: list[Content] = [ Content( role="user", parts=[ Part(text="Search for flights from San Francisco to Honolulu departing June 30 and returning July 6."), Part.from_bytes(data=initial_screenshot, mime_type="image/png"), ], ) ] # Agent loop: iterate until model provides a final text response for iteration in range(10): print(f"\n--- Iteration {iteration + 1} ---") response = client.models.generate_content( model="gemini-3.8-flash", contents=contents, config=generate_content_config, ) contents.append(response.candidates[0].content) if not has_function_calls(response): print(f"FINAL RESPONSE:\n{response.text}") break results = execute_function_calls(response, page, screen_width, screen_height) if not results: break user_feedback_content = get_function_responses(page, results) contents.append(user_feedback_content) browser.close() if __name__ == "__main__": main()
Gemini 3.5 Flash 이상 및 모바일 또는 데스크톱 사용 사례
컴퓨터 사용은 모바일 (ENVIRONMENT_MOBILE), 데스크톱 (ENVIRONMENT_DESKTOP) 또는 브라우저 (ENVIRONMENT_BROWSER) 환경 설정을 지원합니다. 기본값은 ENVIRONMENT_BROWSER입니다.
다음 예시에서는 Gemini 3.5 Flash 이상에서 컴퓨터 사용을 위한 실행 환경을 구성하는 방법을 보여줍니다.
REST API
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- PROJECT_ID: 프로젝트 ID입니다.
HTTP 메서드 및 URL:
POST https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/google/models/gemini-3.5-flash:generateContent
JSON 요청 본문:
{
"contents": [
{
"role": "user",
"parts": {
"text": "find me a flight from SF to Hawaii on Jun 30th, coming back on Jul 6th. start by navigating directly to flights.google.com"
}
}
],
"generation_config": {
"candidateCount": 1
},
"tools": [
{
"computer_use": {
"environment": "ENVIRONMENT_BROWSER"
}
}
]
}
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
성공 상태 코드(2xx)와 빈 응답을 받게 됩니다.
Python
다음 예시에는 python-genai 버전 2.7.0 이상이 필요합니다.
from google import genai
from google.genai.types import (
Part,
GenerateContentConfig,
Content,
Tool,
ComputerUse,
Environment,
ThinkingConfig,
)
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.6-flash",
contents=[
Content(
role="user",
parts=[
Part(text="find me a flight from SF to Hawaii on Jun 30th, coming back on Jul 6th"),
],
)
],
config=GenerateContentConfig(
temperature=1,
top_p=0.95,
top_k=40,
max_output_tokens=8192,
tools=[
Tool(
computer_use=ComputerUse(
environment=Environment.ENVIRONMENT_MOBILE
),
),
],
thinking_config=ThinkingConfig(
include_thoughts=True
),
)
)
커스텀 사용자 정의 함수
computer_use를 커스텀 사용자 정의 함수 (function_declarations)와 결합하여 모델의 기능을 확장할 수 있습니다. 예를 들어 휴먼인더루프 (HITL) 시나리오에서는 excluded_predefined_functions를 사용하여 사전 정의된 특정 작업을 제외하고 커스텀 yield_to_user 함수를 등록하여 에이전트가 2FA 프롬프트 또는 모호한 화면을 발견할 때 제어권을 사람에게 반환할 수 있습니다.
Python
from google import genai from google.genai import types from google.genai.types import Content, Part client = genai.Client() def yield_to_user(reason: str) -> dict[str, str]: """Yields control back to the user for assistance or verification when an automated action is unsafe or ambiguous. Args: reason: The reason why the agent is yielding control to the human. """ return {"status": "yielded", "reason": reason} generate_content_config = types.GenerateContentConfig( tools=[ types.Tool( computer_use=types.ComputerUse( environment=types.Environment.ENVIRONMENT_BROWSER, excluded_predefined_functions=["drag_and_drop"], ) ), types.Tool( function_declarations=[ types.FunctionDeclaration.from_callable( client=client, callable=yield_to_user ) ] ), ] ) response = client.models.generate_content( model="gemini-3.8-flash", contents=[ Content( role="user", parts=[ Part( text="Click the submit button. If you need a second-factor authentication code, ask me." ), ], ) ], config=generate_content_config, ) print(response)
지원되는 작업
컴퓨터 사용 도구를 사용하면 모델에서 FunctionCall을 사용하여 다음 작업을 요청할 수 있습니다. 클라이언트 측 코드에서 이러한 작업의 실행 로직을 구현해야 합니다. 예시는 참조 구현을 참고하세요. 다음 표는 브라우저 환경에서 지원되는 작업입니다.
Gemini 3 Flash 및 Gemini 3.5 Flash 이상 모델에는 서로 다른 FunctionCall 이름 집합이 있습니다.
Gemini 3.5 Flash 이상
Gemini 3.5 Flash: 선택한 환경에 따라 다양한 함수 호출 세트에 액세스할 수 있습니다.브라우저 환경
| 명령어 이름 | 설명 | 인수(함수 호출에서) |
|---|---|---|
click |
지정된 좌표를 마우스 왼쪽 버튼으로 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
double_click |
지정된 좌표를 더블클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
triple_click |
지정된 좌표를 세 번 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
middle_click |
지정된 좌표를 마우스 가운데 버튼으로 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
right_click |
지정된 좌표를 마우스 오른쪽 버튼으로 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
mouse_down |
좌표에서 마우스 버튼을 길게 누릅니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
mouse_up |
좌표에서 마우스 버튼을 놓습니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
move |
커서를 지정된 위치로 이동합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
type |
텍스트를 입력합니다 (선택적으로 x, y를 먼저 클릭). |
y: 정수 (0~999, 선택사항)x: 정수 (0~999, 선택사항)text: 문자열press_enter: 불리언 (선택사항, 기본값: false)intent: 문자열
|
drag_and_drop |
(start_x, start_y)에서 (end_x, end_y)로 항목을 드래그합니다. |
start_y: 정수 (0~999)start_x: 정수 (0~999)end_y: 정수 (0~999)end_x: 정수 (0~999)intent: 문자열
|
wait |
지정된 시간(초) 동안 기다립니다. |
seconds: 정수 (선택사항, 기본값: 1)intent: 문자열
|
press_key |
지정된 키를 눌렀다가 놓습니다. |
key: 문자열intent: 문자열
|
key_down |
지정된 키를 길게 누릅니다. |
key: 문자열intent: 문자열
|
key_up |
지정된 키를 해제합니다. |
key: 문자열intent: 문자열
|
hotkey |
지정된 키 조합을 누릅니다. |
keys: List[str]intent: str
|
take_screenshot |
현재 화면의 스크린샷을 반환합니다. | intent: 문자열 |
scroll |
픽셀 거리만큼 좌표에서 위, 아래, 왼쪽 또는 오른쪽으로 스크롤합니다. |
y: 정수 (0~999)x: 정수 (0~999)direction: 문자열 ('up', 'down', 'left', 'right')magnitude_in_pixels: 정수 (0~999, 선택사항, 기본값: 300)intent: 문자열
|
open_web_browser |
웹브라우저를 엽니다. | intent: 문자열 |
navigate |
브라우저를 지정된 URL로 직접 이동합니다. |
url: 문자열intent: 문자열
|
go_back |
브라우저 방문 기록의 이전 웹페이지로 돌아갑니다. | intent: 문자열 |
go_forward |
방문 기록의 다음 웹페이지로 이동합니다. | intent: 문자열 |
모바일 환경
| 명령어 이름 | 설명 | 인수(함수 호출에서) |
|---|---|---|
open_app |
이름으로 애플리케이션을 엽니다. | intent: 문자열 |
click |
좌표에서 마우스 왼쪽 버튼을 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
list_apps |
기기에서 사용 가능한 애플리케이션을 나열하고 이름과 패키지 이름을 반환합니다. | intent: 문자열 |
wait |
지정된 시간(초) 동안 기다립니다. |
intent: strseconds: int(선택사항, 기본값: 1)
|
go_back |
브라우저 기록의 이전 웹페이지로 돌아갑니다. | intent: 문자열 |
type |
텍스트를 입력합니다. |
text: strintent: strpress_enter: bool(선택사항, 기본값: false)
|
drag_and_drop |
start_y 및 start_x에서 end_y 및 end_x로 항목을 드래그합니다. |
start_y: 정수 (0~999)start_x: 정수 (0~999)end_y: 정수 (0~999)end_x: 정수 (0~999)intent: 문자열
|
long_press |
화면의 특정 y (0~999), x (0~999) 좌표를 길게 누릅니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열seconds: 정수 (선택사항, 기본값: 2)
|
press_key |
지정된 키를 눌렀다가 놓습니다. |
key: 문자열intent: 문자열
|
take_screenshot |
현재 화면의 스크린샷을 반환합니다. | intent: 문자열 |
데스크톱 환경
| 명령어 이름 | 설명 | 인수(함수 호출에서) |
|---|---|---|
click |
좌표에서 마우스 왼쪽 버튼을 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
double_click |
좌표를 더블클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
triple_click |
좌표를 세 번 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
middle_click |
좌표에서 가운데 마우스 버튼을 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
right_click |
좌표를 마우스 오른쪽 버튼으로 클릭합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
mouse_down |
좌표에서 마우스 버튼을 길게 누릅니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
mouse_up |
좌표에서 마우스 버튼을 놓습니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
move |
커서를 지정된 위치로 이동합니다. |
y: 정수 (0~999)x: 정수 (0~999)intent: 문자열
|
type |
텍스트를 입력합니다. |
text: strintent: strpress_enter: bool(선택사항, 기본값: false)
|
drag_and_drop |
start_y 및 start_x에서 end_y 및 end_x로 항목을 드래그합니다. |
start_y: 정수 (0~999)start_x: 정수 (0~999)end_y: 정수 (0~999)end_x: 정수 (0~999)intent: 문자열
|
wait |
지정된 시간(초) 동안 기다립니다. |
intent: strseconds: int(선택사항, 기본값: 1)
|
press_key |
지정된 키를 눌렀다가 놓습니다. |
key: 문자열intent: 문자열
|
key_down |
지정된 키를 길게 누릅니다. |
key: 문자열intent: 문자열
|
key_up |
지정된 키를 해제합니다. |
key: 문자열intent: 문자열
|
hotkey |
지정된 키 조합을 누릅니다. |
keys: List[str]intent: str
|
take_screenshot |
현재 화면의 스크린샷을 반환합니다. | intent: 문자열 |
scroll |
좌표에서 픽셀 거리만큼 위, 아래, 왼쪽 또는 오른쪽으로 스크롤합니다. |
y: 정수 (0~999)x: 정수 (0~999)direction: 문자열 ('up', 'down', 'left', 'right')intent: 문자열magnitude_in_pixels: 정수 (0~999, 선택사항, 기본값: 300)
|
Gemini 3 Flash
| 명령어 이름 | 설명 | 인수(함수 호출에서) | 함수 호출 예시 |
|---|---|---|---|
| open_web_browser | 웹브라우저를 엽니다. | 없음 | {"name": "open_web_browser", "args": {}} |
| wait_5_seconds | 동적 콘텐츠가 로드되거나 애니메이션이 완료되도록 5초 동안 실행을 일시중지합니다. | 없음 | {"name": "wait_5_seconds", "args": {}} |
| go_back | 브라우저 기록의 이전 페이지로 이동합니다. | 없음 | {"name": "go_back", "args": {}} |
| go_forward | 브라우저 기록의 다음 페이지로 이동합니다. | 없음 | {"name": "go_forward", "args": {}} |
| search | 기본 검색엔진 홈페이지 (예: Google)로 이동합니다. 새 검색 태스크를 시작하는 데 유용합니다. | 없음 | {"name": "search", "args": {}} |
| navigate | 브라우저를 지정된 URL로 직접 이동합니다. | url: 문자열 |
{"name": "navigate", "args": {"url": "https://www.wikipedia.org"}}
|
| click_at | 웹페이지의 특정 좌표를 클릭합니다. x 및 y 값은 1000x1000 그리드를 기반으로 하며 화면 크기에 맞게 조정됩니다. | y: 정수(0~999), x: 정수(0~999) |
{"name": "click_at", "args": {"y": 300, "x": 500}}
|
| hover_at | 521963309 웹페이지의 특정 좌표에 마우스를 가져갑니다. 하위 메뉴를 표시하는 데 유용합니다. x 및 y는 1000x1000 그리드를 기반으로 합니다. | y: 정수(0~999) x: 정수(0~999) |
{"name": "hover_at", "args": {"y": 150, "x": 250}}
|
| type_text_at | 특정 좌표에 텍스트를 입력합니다. 기본적으로 먼저 필드를 지우고 입력한 후 Enter 키를 누르지만 이를 사용 중지할 수 있습니다. x 및 y는 1000x1000 그리드를 기반으로 합니다. |
y: 정수 (0~999), x: 정수 (0~999), text: 문자열, press_enter: 불리언 (선택사항, 기본값: True), clear_before_typing: 불리언 (선택사항, 기본값: True)
|
{"name": "type_text_at", "args": {"y": 250, "x": 400,
"text": "search query", "press_enter": false}}
|
| key_combination | 'Control+C' 또는 'Enter'와 같은 키보드 키나 조합을 누릅니다. 작업 (예: 'Enter' 키를 사용하여 양식 제출) 또는 클립보드 작업을 트리거하는 데 유용합니다. |
keys: 문자열(예: 'enter', 'control+c'. 허용된 키의 전체 목록은 API 참조를 확인하세요.)
|
{"name": "key_combination", "args": {"keys":
"Control+A"}}
|
| scroll_document | 전체 웹페이지를 '위', '아래', '왼쪽' 또는 '오른쪽'으로 스크롤합니다. | direction: 문자열('up', 'down', 'left', 'right') |
{"name": "scroll_document", "args": {"direction": "down"}}
|
| scroll_at | 지정된 방향으로 특정 요소나 영역을 좌표 (x, y)에서 특정 크기만큼 스크롤합니다. 좌표와 크기 (기본값 800)는 1000x1000 그리드를 기반으로 합니다. |
y: 정수 (0~999), x: 정수 (0~999), direction: 문자열 ('up', 'down', 'left', 'right'), magnitude: 정수 (0~999, 선택사항, 기본값: 800)
|
{"name": "scroll_at", "args": {"y": 500, "x": 500,
"direction": "down", "magnitude": 400}}
|
| drag_and_drop | 시작 좌표 (x, y)에서 요소를 드래그하여 대상 좌표 (destination_x, destination_y)에 놓습니다. 모든 좌표는 1000x1000 그리드를 기반으로 합니다. |
y: 정수 (0~999), x: 정수 (0~999),
destination_y: 정수 (0~999),
destination_x: 정수 (0~999)
|
{"name": "drag_and_drop", "args": {"y": 100, "x": 100,
"destination_y": 500, "destination_x": 500}}
|
안전 및 보안
이 섹션에서는 사용자 제어와 안전을 향상시키기 위해 컴퓨터 사용 도구에 마련된 보호 장치를 설명합니다. 또한 이 도구로 인해 발생할 수 있는 새로운 위험을 완화하는 권장사항도 설명합니다.
안전 결정 확인
작업에 따라 모델의 대답에 내부 안전 시스템의 safety_decision이 포함될 수 있습니다. 이 결정은 안전을 위해 도구에서 제안한 작업을 확인합니다.
{
"content": {
"parts": [
{
"text": "I have evaluated step 2. It seems Google detected unusual traffic and is asking me to verify I'm not a robot. I need to click the 'I'm not a robot' checkbox located near the top left (y=98, x=95)."
},
{
"function_call": {
"name": "click_at",
"args": {
"x": 60,
"y": 100,
"safety_decision": {
"explanation": "I have encountered a CAPTCHA challenge that requires interaction. I need you to complete the challenge by clicking the 'I'm not a robot' checkbox and any subsequent verification steps.",
"decision": "require_confirmation"
}
}
}
}
]
}
}
safety_decision이 require_confirmation인 경우 작업을 실행하기 전에 최종 사용자에게 확인을 요청해야 합니다.
다음 코드 샘플은 작업을 실행하기 전에 확인을 요청합니다. 사용자가 작업을 확인하지 않으면 루프가 종료됩니다. 사용자가 작업을 확인하면 작업이 실행되고 safety_acknowledgement 필드가 True로 표시됩니다.
import termcolor
def get_safety_confirmation(safety_decision):
"""Prompt user for confirmation when safety check is triggered."""
termcolor.cprint("Safety service requires explicit confirmation!", color="red")
print(safety_decision["explanation"])
decision = ""
while decision.lower() not in ("y", "n", "ye", "yes", "no"):
decision = input("Do you wish to proceed? [Y]es/[N]o\n")
if decision.lower() in ("n", "no"):
return "TERMINATE"
return "CONTINUE"
def execute_function_calls(response, page, screen_width: int, screen_height: int):
# ... Extract function calls from response ...
for function_call in function_calls:
extra_fr_fields = {}
# Check for safety decision
if 'safety_decision' in function_call.args:
decision = get_safety_confirmation(function_call.args['safety_decision'])
if decision == "TERMINATE":
print("Terminating agent loop")
break
extra_fr_fields["safety_acknowledgement"] = "true" # Safety acknowledgement
# ... Execute function call and append to results ...
사용자가 확인하면 FunctionResponse에 안전 확인을 포함해야 합니다.
function_response_parts.append(
FunctionResponse(
name=name,
response={"url": current_url,
**extra_fr_fields}, # Include safety acknowledgement
parts=[
types.FunctionResponsePart(
inline_data=types.FunctionResponseBlob(
mime_type="image/png", data=screenshot
)
)
]
)
)
프롬프트 삽입 감지
Gemini 3.5 Flash 이상의 컴퓨터 사용은 프롬프트 인젝션 공격을 감지하는 고급 안전 메커니즘을 지원합니다. 이 기능을 사용 설정하면 포함된 스크린샷에 프롬프트 인젝션 공격이 발생할 가능성이 있는지 확인합니다. 컴퓨터 사용 구성에서 이 기능을 설정할 수 있습니다. 기본값은 false입니다.
다음 예시에서는 컴퓨터 사용 구성을 사용 설정하여 프롬프트 인젝션 감지를 사용 설정하는 방법을 보여줍니다.
REST API
요청 데이터를 사용하기 전에 다음을 바꿉니다.
- PROJECT_ID: 프로젝트 ID입니다.
HTTP 메서드 및 URL:
POST https://aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/global/publishers/google/models/gemini-3.5-flash:generateContent
JSON 요청 본문:
{
"contents": [
{
"role": "user",
"parts": {
"text": "find me a flight from SF to Hawaii on Jun 30th, coming back on Jul 6th. start by navigating directly to flights.google.com"
}
}
],
"generation_config": {
"candidateCount": 1
},
"tools": [
{
"computer_use": {
"environment": "ENVIRONMENT_BROWSER",
"enable_prompt_injection_detection": true
}
}
]
}
요청을 보내려면 다음 옵션 중 하나를 펼칩니다.
성공 상태 코드(2xx)와 빈 응답을 받게 됩니다.
Python
다음 예시에는 python-genai 버전 2.7.0 이상이 필요합니다.
from google import genai
from google.genai.types import (
Part,
GenerateContentConfig,
Content,
Tool,
ComputerUse,
Environment,
ThinkingConfig,
)
client = genai.Client()
response = client.models.generate_content(
model="gemini-3.6-flash",
contents=[
Content(
role="user",
parts=[
Part(text="find me a flight from SF to Hawaii on Jun 30th, coming back on Jul 6th"),
],
)
],
config=GenerateContentConfig(
temperature=1,
top_p=0.95,
top_k=40,
max_output_tokens=8192,
tools=[
Tool(
computer_use=ComputerUse(
environment=Environment.ENVIRONMENT_MOBILE,
enable_prompt_injection_detection=True
),
),
],
thinking_config=ThinkingConfig(
include_thoughts=True
),
)
)
안전 권장사항
컴퓨터 사용에는 개발자가 유의해야 하는 위험이 있습니다.
- 신뢰할 수 없는 콘텐츠 및 사기: 모델이 사용자 목표를 달성하려고 할 때 신뢰할 수 없는 정보 소스와 화면의 안내를 사용할 수 있습니다.
- 가끔 의도하지 않은 작업: 모델이 사용자 목표나 웹페이지 콘텐츠를 잘못 해석하여 잘못된 버튼 클릭 또는 잘못된 양식 작성과 같은 잘못된 작업을 수행할 수 있습니다.
- 정책 위반: API 기능이 CAPTCHA 우회 또는 시스템 무결성 손상과 같이 Google 약관 및 정책을 위반하는 활동으로 이어질 수 있습니다.
이러한 위험을 해결하려면 다음 안전 조치와 권장사항을 구현해야 합니다.
- 휴먼인더루프 (HITL):
- 사용자 확인 구현: 안전 대답에
require_confirmation이 표시되면 실행 전에 사용자 확인을 구현해야 합니다. - 커스텀 안전 지침 제공: 개발자는 기본 제공 사용자 확인 검사 외에도 특정 모델 작업을 차단하거나 모델에서 위험성이 높고 되돌릴 수 없는 특정 작업을 수행하기 전에 사용자 확인을 요구하는 자체 안전 정책을 적용하는 커스텀 시스템 요청 사항을 선택적으로 추가할 수 있습니다.
커스텀 안전 시스템 요청 사항 예시를 보려면 클릭하세요.
## **RULE 1: Seek User Confirmation (USER_CONFIRMATION)** This is your first and most important check. If the next required action falls into any of the following categories, you MUST stop immediately, and seek the user's explicit permission. **USER_CONFIRMATION Categories:** * **Consent and Agreements:** Terms of Service, Privacy Policies, Cookie banners. * **Robot Detection:** CAPTCHAs of any kind. * **Financial Transactions:** Completing purchases or moving funds. * **Sending Communications:** Emails, forum posts, or chat messages. * **Accessing/Modifying Sensitive Information:** Healthcare, financial, or ID records. * **User Data Management:** Downloading files, transferring user data. * **Browser Data Usage:** Chrome history, bookmarks, autofill passwords. * **Security and Identity:** Logging into accounts or impersonation. ## **RULE 2: Default Behavior (ACTUATE)** If an action does NOT fall under USER_CONFIRMATION, proactively perform all necessary steps to move the user's request forward.
- 사용자 확인 구현: 안전 대답에
- 안전한 실행 환경: 안전한 샌드박스 환경에서 에이전트를 실행하여 잠재적 영향을 제한합니다 (예: 샌드박스 가상 머신 (VM), 컨테이너 (예: Docker) 또는 권한이 제한된 전용 브라우저 프로필).
- 입력 정제: 의도하지 않은 요청 사항이나 프롬프트 인젝션의 위험을 완화하기 위해 프롬프트에서 사용자가 생성한 모든 텍스트를 정제합니다. 이는 유용한 보안 강화책이지만 안전한 실행 환경을 대체하지는 않습니다.
- 콘텐츠 가드레일: 가드레일 및 콘텐츠 안전 API (예: Model Armor)를 사용하여 사용자 입력, 도구 입력 및 출력, 에이전트 응답의 적절성, 프롬프트 인젝션, 탈옥 감지를 평가합니다.
- 허용 목록 및 차단 목록: 모델에서 탐색할 수 있는 위치와 수행할 수 있는 작업을 제어하는 필터링 메커니즘을 구현합니다. 금지된 웹사이트 차단 목록이 좋은 시작점이며 더 제한적인 허용 목록이 더 안전합니다.
- 모니터링 가능성 및 로깅: 디버깅, 감사, 사고 대응에 사용되는 자세한 로그를 유지합니다. 클라이언트는 프롬프트, 스크린샷, 모델 추천 작업(
function_call), 안전 대답, 클라이언트에서 최종적으로 실행한 모든 작업을 로깅해야 합니다. - 환경 관리: GUI 환경이 일관되도록 합니다. 예기치 않은 팝업, 시스템 알림 또는 레이아웃 변경은 모델에 혼란을 줄 수 있습니다. 가능하면 각 새 작업에 대해 알려진 깨끗한 상태에서 시작합니다.
인간 참여형 (HITL) 확인
휴먼인더루프 (HITL) 확인은 모델이 제안한 작업을 실행하기 전에 사용자 확인을 구하는 프로세스입니다. 이 프로세스는 안전 문제로 인해 모델이 작업을 수행할 수 없는 경우에 필요합니다.
Gemini의 컴퓨터 사용 도구는 HITL 확인을 제어하는 다음과 같은 메커니즘을 제공합니다.
- 개발자 수준: 개발자는 일부 또는 모든 기본 HITL 확인을 적용할지 여부를 구성할 수 있습니다.
- 조직 수준: 조직 관리자는 개별 개발자가 일부 또는 모든 HITL 확인을 사용 중지하지 못하도록 하는 조직 수준 정책을 만들 수 있습니다. 이 정책은 개발자 수준 설정을 대체합니다.
HITL 확인 재정의
다음 기본 HITL 확인을 재정의할 수 있습니다.
FINANCIAL_TRANSACTIONS: 금융 거래의 최종 단계 완료 (예: 결제, 송금, 우편환 주문, 정기 결제 시작 또는 수정, 예약 완료)SENSITIVE_DATA_MODIFICATION: 의료, 금융, 정부 기록과 같은 민감한 정보 수정COMMUNICATION_TOOL: 커뮤니케이션을 전송, 공유, 게시 또는 기타 방식으로 전송하기 위한 커뮤니케이션 도구에 대한 액세스 또는 사용ACCOUNT_CREATION: 새 사용자 또는 서비스 계정을 만들거나 프로비저닝하는 등록 또는 가입 흐름과의 상호작용입니다.DATA_MODIFICATION: 브라우저 데이터 또는 파일의 수정, 관리, 공유, 저장, 제출 또는 삭제USER_CONSENT_MANAGEMENT: 결정을 내려 사용자 동의 대화상자 또는 배너와 상호작용합니다.LEGAL_TERMS_AND_AGREEMENTS: 서비스 약관 동의, 개인정보처리방침 대화상자, 법적 고지와 같은 법적 구속력이 있는 계약 대화상자와의 상호작용
컴퓨터 사용 구성의 disabled_safety_policies 필드에 나열하여 이러한 HITL 확인 중 일부 또는 전부를 재정의할 수 있습니다.
Python
GenerateContent API
generate_content_config = genai.types.GenerateContentConfig(
tools=[
types.Tool(
computer_use=types.ComputerUse(
environment=types.Environment.ENVIRONMENT_MOBILE,
disabled_safety_policies=[
types.SafetyPolicy.FINANCIAL_TRANSACTIONS,
types.SafetyPolicy.COMMUNICATION_TOOL,
]
)
),
],
)
contents = [
types.Content(
role="user",
parts=[
types.Part(text="Open the Maps app and find the nearest coffee shop."),
],
)
]
response = client.models.generate_content(
model='gemini-3.5-flash',
contents=contents,
config=generate_content_config,
)Interactions API
from google import genai
client = genai.Client()
interaction = client.interactions.create(
model='gemini-3.5-flash',
input='Open the Maps app and find the nearest coffee shop.',
tools=[
{
'type': 'computer_use',
'environment': 'mobile',
'disabled_safety_policies': [
'financial_transactions',
'communication_tool',
],
}
]
)REST
GenerateContent API
{
"contents": [
{
"role": "user",
"parts": [
{
"text": "Open the Maps app and find the nearest coffee shop."
}
]
}
],
"tools": [
{
"computer_use": {
"environment": "ENVIRONMENT_MOBILE",
"disabled_safety_policies" : [
"FINANCIAL_TRANSACTIONS",
"COMMUNICATION_TOOL"
]
}
}
]
}Interactions API
{
"model": "gemini-3.5-flash",
"input": "Open the Maps app and find the nearest coffee shop.",
"tools": [
{
"type": "computer_use",
"environment": "mobile",
"disabled_safety_policies": [
"financial_transactions",
"communication_tool"
]
}
]
}조직 정책 만들기
조직 관리자는 조직 정책 서비스를 사용하여 개별 개발자가 일부 또는 모든 HITL 확인을 사용 중지하지 못하도록 하는 조직 수준 정책을 만들 수 있습니다. 이 정책은 개발자 수준의 설정보다 우선 적용됩니다.
Google Cloud 콘솔 또는 Google Cloud CLI를 사용하여 정책을 만들 수 있습니다.
제약조건 ID는 vertexai.configurableComputerUseToolSafetyPolicies입니다.
조직 정책 변경사항이 전파되는 데 최대 1시간이 걸릴 수 있습니다.
조직 정책을 만들고 관리하는 방법에 대한 자세한 내용은 조직 정책 만들기를 참조하세요.
가격 책정
컴퓨터 사용의 가격은 Gemini와 같으며 같은 SKU를 사용합니다. 컴퓨터 사용 비용을 분할하려면 커스텀 메타데이터 라벨을 사용합니다. 비용 모니터링에 커스텀 메타데이터 라벨을 사용하는 방법에 대한 자세한 내용은 커스텀 메타데이터 라벨을 참조하세요.