Extension lives in the same memory space as the shell, so it’s up to the developer to restrict themselves to not touch internal API. Also, GNOME give you plenty of warning in the changelog (and the changes are usually small).