babashka

2026-06-09T04:41:22.557419Z

i was thinking of using tree-sitter to at least block the imports or functions from those imported modules, yeah basically parsing the AST

whilo 2026-06-09T04:42:30.487879Z

I think it is a fairly hard problem unless you are very restrictive (i.e. know which finite subset of Python is reachable). But a fun problem to think about. Do you have specific problem you are aiming at?

2026-06-09T04:45:08.698069Z

yeah i am trying to handle heredocs in python3 that llms like to use, but would like to ban/allow the usage of certain libraries i guess the sandbox/evaluation approach would be more comprehensive since you can exactly track what os apis are being used etc

whilo 2026-06-09T05:07:10.504569Z

@maxweber just pointed me to https://github.com/vercel-labs/just-bash, which runs Python in a wasm sandbox it seems. Might be of interest.

🙏 1