I've had to implement such directory-escaping prevention measures on past projects. Soft symlinks make it hard. Hardlinks make it impossible, but maybe that's Good Enough.
Would be difficult to enforce at the language level. I mean you could conceivably spawn a thread with some hypothetical restrictions, and all child-threads would inherit (or further restrict) the restrictions. Such a mechanism would even be useful beyond filesystem access.
(1/2)