Skip to content

kode-gopher

Let your AI agent write real Go against Google Cloud, and run it safely in a sandbox.

Ask an agent to “find the buckets nobody has touched in a year” and it usually makes one tool call per API request, reading every intermediate result along the way. That’s slow, it costs tokens, and it only works for the actions someone wrapped as a tool.

kode-gopher gives the agent a single tool that takes code. The agent writes an ordinary Go program using Google’s own Cloud libraries, and kode-gopher builds and runs it in an isolated pod. The program makes as many API calls as it needs, and only its final answer goes back to the agent.

func run(ctx context.Context) (any, error) {
c, err := storage.NewClient(ctx)
if err != nil {
return nil, err
}
defer c.Close()
// List buckets, check each one's last update, keep the stale ones...
return staleBuckets, nil
}

This is Cloudflare’s Code Mode idea, built for Go and Google Cloud. In Go there’s nothing to generate: the “SDK” is the real cloud.google.com/go packages, and models have seen plenty of real code that uses them.

Real Google Cloud libraries

Storage, Compute, GKE, BigQuery, Secret Manager and client-go come precompiled in the sandbox, so a typical snippet builds and runs in about four seconds.

A sandbox per session

Each MCP session gets its own pod: gVisor on GKE, no Kubernetes credentials, and network access only to public endpoints.

Your identity, not a shared one

Snippets run as you. On a shared server, users sign in with Google and each runs as themselves, with short-lived tokens only.

Answers the model can use

Results come back as JSON, with build errors, runtime errors and panics clearly told apart, so the agent knows what to fix.

kode-gopher is pre-alpha and hasn’t had a release yet. It’s built on agent-sandbox and the MCP Go SDK.