A Reddit user working on a tool-calling sandbox is considering a dataflow analyzer for shell commands. It would distinguish commands that only read data from those that change state, so that read-only commands could be allowed automatically.
The post gives a read-only pipeline using sed, od and head as an example. Redirecting output to a file or piping it to visudo, by contrast, would count as writing. The author asks whether a library with this design goal already exists.
Source: Reddit r/LocalLLaMA