# AI assistant

> Connect a model to the experimental AI tab, control what it may do with Allow, Ask, and Off policies, and look up every Studio function.

Source: https://docs.earthengine.studio/ai-assistant/
Language: en
Studio version: 6abe1670914d (2026-11-21)

The **AI** tab is an experimental, dockable conversation panel. A model you
connect can read and change the workspace through typed **Studio functions**:
it edits the active script, runs it with the normal **Run** action, reads the
Console, inspects the map, and, if you allow it, works with assets, tasks,
Git, and App publishing. Every function has an **Allow**, **Ask**, or **Off**
policy that you control.

For a layout built around the assistant, choose the **AI first** workspace
layout in **Settings**: a wide side pane with the AI conversation selected,
beside the editor, output, and map. You can also drag the AI tab anywhere. See
[Workspace](/workspace/).

<div class="notice" markdown="1">
**What the assistant can reach**

The assistant acts with your signed-in Google session, your selected Cloud
project, and the repository linked to the conversation. Read-only functions
run without asking. Functions that change files, run code, or spend quota ask
first. Destructive, public, and permission-changing functions are **Off** until
you switch them on.
</div>

## Choose a provider and model

Pick the connection in the **AI provider** row at the top of the tab, then a
model from the provider's own list. Studio remembers your last provider and
each provider's last model in this browser. Changing provider or model keeps
the visible conversation.

| Provider | Billing | Where it works | Credentials |
| --- | --- | --- | --- |
| **ChatGPT** (Sign in with ChatGPT) | Your ChatGPT plan's usage; no API key | Directly on a Studio served at `http://127.0.0.1:<port>`; on the hosted site through the Loom.js Companion's ChatGPT sign-in helper | Tokens in the tab's memory; optionally remembered in your own Secret Manager |
| **Claude API** | Pay per use on the Claude Console account that owns the key; a Claude.ai subscription cannot be used | Local and hosted Studio | API key in the tab's memory; optionally remembered in your own Secret Manager |
| **Loom.js Companion** | Your Codex/ChatGPT subscription, through the extension | Chrome with the [Loom.js Companion extension](https://chrome.google.com/webstore/detail/gdcebopdllcifgleoefgbobdopiaholg) | Kept by the extension |

### Loom.js Companion

1. Install the Loom.js Companion Chrome extension and sign in there.
2. Open the AI tab. Studio asks the extension to approve the exact Studio
   origin; accept it. A **Retry** action appears if you dismiss the request.
3. Once connected, the setup notice collapses to a status symbol in the tab
   header.

Production origins must use HTTPS. `localhost` and `127.0.0.1` work for local
development.

### ChatGPT

Choose **Continue with ChatGPT**, finish the sign-in popup, and allow plan
usage. OpenAI accepts the sign-in redirect only at
`http://127.0.0.1:<port>/auth/callback`. On the hosted site, Studio therefore
uses the Companion's opt-in **Website ChatGPT sign-in helper**: Studio still
performs the sign-in and keeps the tokens in the page, and the extension only
opens the ChatGPT window and relays the requests a page cannot read.

When a setup step is missing, the ChatGPT area names it: extension not
installed or unreachable, site not approved, helper switched off, or extension
too old. The provider list shows **ChatGPT (via Companion)** when the helper is
ready and **ChatGPT (set up Companion)** while a step is missing. Sign out from
the tab header.

### Claude API

Paste a key from the Claude Console. Studio verifies it by listing models and
keeps it only in the tab's memory: never in browser storage, logs,
diagnostics, or saved conversations. **Forget Claude API key** drops it
immediately; a reload also forgets it. Organizations with zero data retention
cannot call the Claude API from a browser, and Studio says so.

### Remember a credential in Secret Manager

By default a reload signs ChatGPT out and forgets the Claude key. Under each
provider, **Remember in my Google Cloud Secret Manager** (off by default)
stores the credential as a secret in **your own** Cloud project, written and
read by the page with your own Google session. Nothing secret goes to browser
storage or the Studio backend.

Requirements, once per project:

1. Use **Online** mode and sign in with Google. Local-folder sign-in is
   read-only and cannot use Secret Manager.
2. Enable the Secret Manager API in the selected project, from Studio's
   project-services check or with
   `gcloud services enable secretmanager.googleapis.com --project=PROJECT_ID`.
3. Your account needs to create, read, version, and delete secrets in that
   project (`roles/secretmanager.admin` or Owner). Anyone who can read secrets
   in the project can read the credential, so prefer a project only you
   administer.

Forgetting the key, signing out, or switching the option off deletes the
secret. ChatGPT refresh tokens rotate, so use one browser tab for a remembered
ChatGPT session.

## Work in a conversation

Conversations, their titles, and their text are stored only in this browser;
clearing site data removes them. Credentials are never stored with them.

- **Link a repository.** Each conversation can be linked to one Git repository
  and branch from those visible in **Scripts**. Project and Git functions use
  that link and cannot reach other repositories.
- **Agent or Plan mode.** **Agent** mode can use every enabled function.
  **Plan** mode exposes only read-only functions and asks the model for a
  concrete plan without editing, running, or committing.
- **Verification.** The assistant is instructed to run changed code, read the
  Console, and capture the map when the result is visual before it reports
  success. Analytical answers come from code in the visible editor, not from
  hidden computations.
- **Stop and edit.** **Stop response** cancels the active answer. You can then
  edit the last prompt; this rewinds the conversation text but does not undo
  file, map, or run side effects that already happened.
- **Budgets.** Each request has an agent-turn budget (default 24; 8–48 under
  **Studio functions → Agent turns per request**) and a deadline (default 500
  seconds; 30–1,800). Reaching either pauses the task with a **Continue**
  action instead of failing. While Studio waits for a run, the Console, a
  scene, or a screenshot, **Skip … wait and assume success** lets you move on;
  the model is told the result was not verified.
- **Recoverable errors.** Authentication, rate-limit, billing, and connection
  failures pause the task with **Retry task**, which resumes from the current
  Studio state without repeating completed work.

Long conversations are compacted automatically. The visible transcript stays
complete.

## Control what the assistant may do

Open **Studio functions** below the composer. Functions are grouped by family
(Editor, Run/Console/scene, Map, Assets, Git, and so on), each with its
description and a policy:

- **Allow** — the model may call it without asking.
- **Ask** — each call pauses for **Deny**, **Allow once**, **Allow for this
  conversation**, or **Always allow**.
- **Off** — the model is not offered the function at all.

Defaults: read-only functions are **Allow**; edits, code execution, runtime
reset, branch changes, and screenshots are **Ask**. Destructive, public, or
permission-changing functions (deleting assets, changing asset access,
deleting branches) are **Off** and listed under **Off by default**; their
approval dialog has no **Always allow**. Only choices that differ from the
default are stored, and **Reset all to defaults** clears them.

**Allow for this conversation** is kept in memory only. It ends when you
revoke it under **Studio functions → This conversation**, delete the
conversation, or reload the page, and it never re-enables an **Off** function.

Some functions have a per-conversation limit because they spend quota or start
long-running work. Studio counts successful calls, refuses further calls once
the limit is reached, and shows `used/limit` with a **Reset count** action.

## Studio function reference

This table is generated from the application source
(6abe1670914d, 2026-11-21).
Descriptions are the exact text the model receives. Permission is what the
function can do; Default is its initial policy; Limit is the maximum number of
successful calls per conversation.


### Editor

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.get_editor_language` | read | Allow | – | Read the active editor language, including javascript, python, or a non-executable document language. |
| `studio.read_active_file` | read | Allow | – | Read the complete file currently active in the code editor. |
| `studio.replace_active_file` | write | Ask | – | Replace the active editor file, preserving an undo step. This does not commit the remote file. |
| `studio.set_editor_language` | write | Ask | – | Select javascript or python for the active scratch editor using its language controls. Does not translate or run code. Path-bound local, repository, and module files cannot change language here. |


### Project files

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.list_project_files` | read | Allow | – | List files and folders at one path in a connected Git project. |
| `studio.open_project_file` | read | Allow | – | Read a Git project file and open it in the Studio editor. |


### Run, Console and scene

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.capture_screenshot` | capture | Ask | – | Capture the visible map canvas. By default, wait only for the active render and continue immediately when every tracked layer is loaded. |
| `studio.get_console_output` | read | Allow | – | Read bounded Console messages and resolved print values, optionally from one visible script run. Use this after studio.run_code to verify results and errors. |
| `studio.get_info_probe` | execute | Ask | – | Run one small read-only Earth Engine expression through getInfo only to improve visible code or select an asset. Never use this hidden exploratory result as the answer to an analytical question. |
| `studio.get_scene_status` | read | Allow | – | Report script execution and per-layer map tile loading progress. |
| `studio.reset_runtime` | execute | Ask | – | Press the active editor's real Reset action, clearing its execution context, Console, map layers, pending exports, and runtime state. |
| `studio.run_code` | execute | Ask | – | Press the active editor file's real Run action. By default wait for that visible script run to finish and return its run ID for Console inspection. |
| `studio.wait_for_scene` | read | Allow | – | Wait only while the current render is active, then return immediately when code execution ends and every tracked map layer finishes loading. |


### Map view and layers

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.get_map_view` | read | Allow | – | Read a map's centre [longitude, latitude], zoom, bearing, pitch, visible bounds [west, south, east, north], scene mode, current basemap, the selectable basemaps, and the ids of the other open maps. |
| `studio.list_map_layers` | read | Allow | – | List a map's script layers bottom first with id, name, type, visibility, opacity, stacking order, tile progress, and a compact visualization summary (bands, min/max, palette, styling). Geometry layers are listed by studio.list_geometries. |
| `studio.set_map_layer` | write | Allow | – | Change one existing map layer's visibility, opacity (0 to 1), and/or stacking position (order 0 is the bottom). Does not create, delete, or restyle layers; the next script run rebuilds them from code. |
| `studio.set_map_view` | write | Allow | – | Move a map: set centre and/or zoom, or fit bounds [west, south, east, north] (optionally with a fixed zoom), and/or change the basemap. Returns the resulting view. This changes only the Studio view, not the script. |


### Inspector

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.inspect_map_point` | read | Allow | – | Read values at a longitude/latitude from a map's visible layers with Studio's Inspector: Earth Engine image band values (sampled at the map zoom's scale unless zoom is given) and properties of local vector features. Results are bounded; unsupported layers say why. |


### Charts

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.get_chart_data` | read | Allow | – | Read one chart's title, axis titles, series (name, type, and up to maxPoints x/y/labels/values per series), and its source data table when available. truncated reports any cut data. Static image charts return no data. |
| `studio.list_charts` | read | Allow | – | List charts (ui.Chart, Plotly, Matplotlib) most recent first with id, name, status, where they are shown (console, app, or tab), title, chart types, and series count. Set consoleOnly to list only charts printed to the Console. |


### Geometries

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.create_geometry` | write | Ask | – | Create or replace a validated GeoJSON geometry layer attached to the active editor document and refresh it on the map. |
| `studio.delete_geometry` | write | Ask | – | Delete one named geometry layer from the active editor document. |
| `studio.list_geometries` | read | Allow | – | List geometry layers attached to the active editor document, including type, visibility, feature count, color, and bounds. |


### Tasks

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.cancel_task` | execute | Ask | – | Cancel one queued or running Earth Engine task by its operation ID (projects/{project}/operations/{ID} or the bare task ID in the current project). |
| `studio.get_task` | read | Allow | – | Read one Earth Engine task by id or full operation name (projects/<project>/operations/<id>) among the 500 most recent tasks. |
| `studio.list_tasks` | read | Allow | – | List the signed-in project's Earth Engine tasks, most recent first, with id, description, type, state, timing, compute usage, destinations, and error message. Optionally filter by states or a description substring. Read-only: it does not start or cancel tasks. |
| `studio.start_export_task` | execute | Ask | 5 | Start one unsubmitted export from the Tasks panel, exactly as its Run button does. The export must already exist: write an Export.image/table/video.toDrive, toCloudStorage, or toAsset call in the visible script and run it with studio.run_code first. Identify it by draftId or by its exact description. At most 5 starts per conversation. |


### Assets

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.copy_asset` | write | Ask | – | Copy one Earth Engine image or table asset to a new asset ID. Existing destinations are kept unless overwrite is true. |
| `studio.create_asset_folder` | write | Ask | – | Create one empty Earth Engine folder or image collection. The parent folder must already exist. |
| `studio.delete_asset` | write | Off | – | Permanently delete one Earth Engine asset. A non-empty folder or image collection is refused unless recursive is exactly true, and even then only when it holds at most 25 descendants. |
| `studio.get_asset_access` | read | Allow | – | Read who can view or edit one Earth Engine asset: readers, writers, and whether it is public. |
| `studio.get_asset_roots` | read | Allow | – | Report the current project's Earth Engine asset root and, when Earth Engine exposes it for that root, its asset count and storage quota. |
| `studio.list_assets` | read | Allow | – | List one page of the direct children of an Earth Engine asset folder or image collection (at most 100 per call). Omit parent for the current project's asset root. |
| `studio.move_asset` | write | Ask | – | Move or rename one Earth Engine asset. The destination must not exist and its parent folder must exist. |
| `studio.search_assets` | read | Allow | – | Search assets by their own name (case-insensitive substring, not the parent path) below one root folder, descending folders up to maxDepth levels. Bounded by request count and time; reports truncated when the walk stopped early. Image collections are not searched inside unless includeCollectionImages is true. |
| `studio.update_asset_access` | write | Off | – | Change who can read or write one Earth Engine asset (not its children). addReaders and addWriters set that principal's role (replacing a previous one). Principals must be typed: user:EMAIL, group:EMAIL, serviceAccount:EMAIL, or domain:DOMAIN. Public access changes only when "public" is given explicitly. At most 20 principal changes per call. Returns the policy before and after. |


### Downloads

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.start_local_download` | execute | Ask | 5 | Start one unsubmitted browser-local download created by Export.image.toFolder or Export.table.toFolder in the visible script, as a ZIP file saved by the browser (folder output needs the user's folder picker in the Tasks panel). Identify it by downloadId or exact description. Raster downloads with explicit dimensions are limited to 100000000 pixels. At most 5 per conversation. |


### Git

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.ensure_project_branch` | write | Ask | – | Select an existing Git project branch, or create it from the current branch when requested. |
| `studio.git_branches` | read | Allow | – | Show the linked branch, the default branch, and the branches of the linked repository. |
| `studio.git_commit` | write | Ask | – | Commit unsaved editor changes on the linked branch in one atomic commit: either the listed paths or all changes. Refused on the default branch unless confirmDefaultBranch is true. Returns the commit ID and files. |
| `studio.git_delete_branch` | write | Off | – | Delete a branch of the linked repository. Never the default branch or the linked branch. confirmBranch must repeat the branch name exactly. |
| `studio.git_diff` | read | Allow | – | Show a bounded unified diff of unsaved editor changes on the linked branch (scope 'working', whole or one path), or the files that differ between the linked branch and the default branch (scope 'branch'). |
| `studio.git_log` | read | Allow | – | List the most recent commits on the linked repository branch, newest first. |
| `studio.git_status` | read | Allow | – | Show the linked repository branch: open editor files with unsaved changes on it, and how far the branch is ahead of or behind the default branch. |


### Apps

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.open_app_publish_dialog` | write | Ask | 3 | Open the open App preview's 'Export public App' dialog with a deployment method preselected ('managed' or 'portable'). Publishes nothing: the user reviews and completes every step in the dialog. |
| `studio.preview_app` | capture | Ask | – | Run the active script with its real Run action so its ui.root / ui.App opens as an App preview, then return a bounded outline of the App's widgets and, unless captureMaps is false, downscaled images (at most 1024 px) of up to two App maps once their layers load. Widgets outside maps are described, not photographed. |


### Catalog and documentation

| Function | Permission | Default | Limit | Description |
| --- | --- | --- | --- | --- |
| `studio.get_asset_info` | read | Allow | – | Inspect exactly one catalog dataset or accessible Earth Engine asset. Return only requested sections, with paginated bands/properties capped at 50; never returns a complete catalog or raw asset payload. |
| `studio.get_documentation_entry` | read | Allow | – | Get one exact Earth Engine or Studio API documentation entry with signature, arguments, defaults, return type, deprecation state, and reference link. |
| `studio.get_guide` | read | Allow | – | Get one concise Earth Engine Studio capability guide without loading unrelated documentation. |
| `studio.search_catalog` | read | Allow | – | Search the official and community Earth Engine dataset catalog with compact results, up to 50 per call, and optional temporal, spatial, resolution, source, type, provider, category, keyword, band, and status filters. |
| `studio.search_documentation` | read | Allow | – | Search Earth Engine and Studio API documentation, returning compact signatures and descriptions instead of the complete documentation bundle. |



### Boundaries

- Exports are never computed in the browser. The model writes the `Export.*`
  call in the visible script, runs it, and starts the resulting task.
- Uploads, map-tile, BigQuery, and FeatureView exports, and folder-output
  downloads stay manual in the Tasks and Assets panels.
- Git functions act only on the linked repository and branch. Commits are
  written directly to the remote branch; there is no push and no force-push.
- `studio.open_app_publish_dialog` only opens the publish dialog. Reviewing,
  Google consent, service accounts, and confirmation remain with you. See
  [Public Apps](/public-apps/).
- Errors returned to the model are bounded, and credentials are redacted.

## Troubleshooting

- **Companion not detected:** check that the extension is installed in this
  Chrome profile, approve the exact Studio origin in its options, then choose
  **Check Loom.js Companion again**.
- **ChatGPT on the hosted site stays in setup:** the helper needs a Companion
  build that includes it; tick **Website ChatGPT sign-in helper** in the
  extension options and approve the site.
- **Claude key rejected:** create a new key in the Claude Console; Studio
  removes a remembered key that returns `401`.
- **A function never runs:** check its policy under **Studio functions**, and
  whether its per-conversation limit has been reached.
- For browser-side diagnostics, search the Chrome DevTools Console for
  `[Earth Engine Studio][Codex]`. Entries never include prompts, files, or
  credentials.

See also [Troubleshooting](/troubleshooting/).
