Bridges

Overview

Four ways to give the engine capabilities it does not have on its own: a file system, a shell, terminals, and tools of your own.

files · shell · terminals · customToolsplain objectsno server route
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

The engine runs in your process, so anything your process can reach, it can reach — through an object you pass. A phone's browser storage, a container, a desktop application's own API: none of it needs anything on our side.

OptionGivesPage
filesA workspace that is not a diskfiles
shellbash somewhere other than this machineshell
terminalsShells that outlive an answerterminals
customToolsTools of your own, beside the 35customTools

An agent on a phone

const phone = await api.storage.device({ deviceId });

const agent = api.agents.create({
  runtime: "local",
  machine: phone,
  model: "gemini-3.5-flash",
  files: phoneBridge(),          // its browser storage, reached from your page
  shell: phoneShell(),           // a sandboxed shell in the page
});
phone = api.storage.device(device_id=device_id)

agent = api.agents.create(
    runtime="local",
    machine=phone,
    model="gemini-3.5-flash",
    files=PhoneBridge(),          # its browser storage, reached from your page
    # The Python engine has no shell bridge: leave "bash" out of a phone's tools
    tools=["read", "list", "glob", "grep", "write", "edit", "move", "delete"],
)

When a bridge is required

machinefilesOtherwise
A computer (filesystem)optionalThe machine's own workspace is used
A phonerequiredfiles_required at creation
A cloud workspacerequiredfiles_required at creation

The refusal names the six operations and which of them are missing, so a half-written bridge fails at creation rather than in the middle of a run.

The tool list follows the bridges

  • No shell on a phone or a cloud workspace → no bash. Nothing would run it.
  • A phone → no terminal, ever.
  • A cloud workspace → terminal only when you supply terminals.
  • A computer → both, from the machine itself.
A tool that cannot run is not declared

Rather than offering bash and failing, the engine leaves it out — and the system prompt loses its instructions with it. The model never plans around something that is not there.