# CodeMode again blocks shell access on IPython 9.17

> CodeMode(allow_shell=False) blocks shell execution again on IPython 9.17, which had let shell magics like %%bash keep running.

- Published: 2026-08-30
- Author: Ashpreet Bedi
- Categories: Changelog
- Canonical: https://www.agno.com/articles/codemode-again-blocks-shell-access-on-ipython-9-17
- Markdown: https://www.agno.com/articles/codemode-again-blocks-shell-access-on-ipython-9-17.md

We fixed `CodeMode(allow_shell=False)` on IPython 9.17. It once again blocks shell execution, so shell magics like `%%bash` cannot run in a kernel you have told to forbid them.

IPython 9.17 recreates script magics whenever something looks them up, which let `%%bash` keep running even with `allow_shell=False`. We now strip those magics after the kernel recreates them, so your setting holds.
