> With gravity, mass plays the role of charge. It bends space-time around it, and it is always positive. There is no negative mass, so you can always infer the one real arrangement of stuff inside from the warping of space-time at the surface of your box.
This is a simplification to the point of just being wrong. Gauss’s law works for gravity; if you put a shell around Earth you have no way of knowing whether it’s a planet or an Earth-mass black hole inside. Assuming spherical symmetry of density, anyway.