Last week I deleted the JavaScript implementation of agent-runner and rewrote it in Go. The agent loop ported cleanly. The interesting part was the tool layer, because that is where an agent stops being a demo.
In the JS version, run_command called exec() and let the shell sort it out. That is fine when the only thing running it is you, on your own machine, watching the output. It is not fine the moment the loop runs unattended against a repo you care about. A model that can reach a shell can do anything your user can do, and it will get there by accident long before it gets there on purpose.
So the Go port puts the whole safety story in three boring places.
1. There is no shell to reach
The command string is split into argv by hand. When the tokenizer meets a character a shell would interpret, it refuses instead of quoting it:
const shellChars = ";&|<>$`*?()[]{}~!\\"
// inside tokenize() case strings . ContainsRune ( shellChars , ch ) : return nil , fmt .…