Polka Docs

On the edge

A version deployed to the edge doesn't run all the time. When someone speaks or types to it, the conversation's room loads its package by hash into an isolate of its own, hands it the conversation so far, and reads back what it does as it streams.

A turn

  1. The room sends the message and the conversation's log so far.
  2. Your harness runs the turn. If it uses a sandbox, a container is started for this task, in parallel with the model's first call, so the start-up is mostly hidden.
  3. What the agent writes, the tools it calls and their results stream back. On a voice call, what it wrote before calling a tool is said while the tool runs, or "One moment." if it wrote nothing, so the caller isn't left in silence.
  4. When the turn ends, the container is removed. The new log entries go back to the room, which keeps them for the next turn.

Nothing stays running between turns, and no state is kept in the isolate: the room's log is the state.

What your agent can reach

Your package holds no secrets. Every request it makes leaves through the platform, which adds the credentials on the way out and refuses the rest:

It asks for It gets
the model gateway models, with the version's own key added
its sandbox this task's container only; the container itself has no internet
kept files the folders named with --keep, for this conversation
any other host only if the version's params.outbound.allow lists it; otherwise 403

To let it call an API, list the host and, if it needs one, the credential to add. The value comes from one of the environment's variables, so the agent never sees it:

{
  "outbound": {
    "allow": ["api.example.com", "*.example.org"],
    "credentials": [
      { "host": "api.example.com", "header": "authorization", "variable": "EXAMPLE_KEY", "prefix": "Bearer " }
    ]
  }
}

allow takes up to 50 host names (*. for a host's subdomains, not the host itself) and credentials up to 20. Redirects are not followed.

Files kept between tasks

Each task starts with an empty container. Folders named with polka deploy --keep notes (up to 10) are copied out when a task ends and put back when the next task of the same conversation starts: up to 500 files, 10 MB each.

What it costs

A conversation's cost is metered as it goes and shown in the Console: the model tokens through the gateway, the seconds a task's container ran, and the minutes talked on a voice call.

What builds for the edge

The edge runs WebAssembly, so the crates your agent uses there must build for wasm32-unknown-unknown. The ADK's harness, skills, tools, runtime and edge do. Keep the terminal's front and anything that needs threads, local files or sockets behind [target.'cfg(not(target_arch = "wasm32"))'.dependencies], as examples/runner does.

Edit this page on GitHub