A sandbox game gives the player tools, systems, and space to set their own goals and experiment, rather than a fixed sequence of objectives to complete. Many sandbox games have goals available, but pursuing them is optional.
The metaphor is a child sandbox: the value is in what you build and test, not in winning. Minecraft is the clearest example, with a procedurally generated world, gatherable materials, and building rules that let players construct anything from a hut to a working computer, in a survival mode with threats or a creative mode without them. Garry Mod took a physics engine and a set of props and let players invent their own games inside it.
Sandbox describes a relationship to goals, which separates it from open world. An open world game describes a map structure and can still push a strict story. A sandbox game describes player freedom and can exist in a small space, such as a single physics playground or city district. Many games are both: Grand Theft Auto games pair an open city with sandbox systems for causing and testing chaos between missions.
The design risk is aimlessness. Without authored goals, a sandbox must make its systems interesting enough that experiment itself is rewarding, through physics, simulation, building, or social play. When those systems are thin, freedom quickly feels like having nothing to do.
In play"There is no final level to beat, because it is a sandbox and the building itself is the point."