We could restrict it to relative paths having a suffix, define the set of suffixes allowed to be read as a compiler runtime argument (regex), and default to “(txt|yang|json)” (and never allow .env or resolve ‘~’)
Or go further and instead of:
read_file("anything on disk")
We define explicit compile-time inputs, and only those are readable:
File extensions are a lie, so that doesn’t help that much, and sensitive stuff gets stored in json all the time. I think only doing relative paths opens up path confusion pretty easily, and standard setups like github workspaces have well known relative paths to sensitive information.
The build config is the kind of sandboxing we need to do, but there’s still some discussions on where to put that information and when that information should be included. Bazel also complicates things.