AG2 before 1.1.1: agents limited to safe shell commands can run any command, update now
Python developers building AI agents with AG2 (AutoGen) who give them SandboxShellTool with an allowed list or readonly=True.
How to fix it
You haveUpdate to
>= 0.13.2, < 1.1.1→1.1.1
Check your version
Which version you havepip show ag2
Update
pippip install --upgrade "ag2>=1.1.1"
uv add "ag2>=1.1.1"
SandboxShellTool checked commands for ; and && but not for a newline, and the shell treats a newline the same way. An agent limited to cat could run anything after it, and text the agent reads can steer it there. The default LocalEnvironment runs them on your machine. The autogen package name, 0.13.2 to 0.14.1, has no fixed release listed.