Agent shell commands run inside the sandbox. Agents can run your installed tools outside the sandbox with flatpak-spawn --host. To prevent that, run:
flatpak override --user --no-talk-name=org.freedesktop.Flatpak ai.opencode.opencodeOr remove org.freedesktop.Flatpak from Session Bus in Flatseal or KDE System Settings.