A coding agent reads files, runs shell commands and calls tools in a loop. Its instructions come partly from outside: a ticket, a web page, a README in a dependency. Any of those can contain text that tells the agent to do something harmful. This attack is called prompt injection, and no model is fully immune to it.
A sandbox reduces what a successful attack can reach. The operator sets what an agent can reach before it starts. If a malicious instruction succeeds, the agent still finds no credentials to steal, no neighbouring project to read and no open route to send data away.
The rule to apply: treat the code an agent runs the way you treat code from an unknown contributor.