I believe that is the purpose of the xdg portals specification.
https://flatpak.github.io/xdg-desktop-portal/portal-docs.htm...
https://flatpak.github.io/xdg-desktop-portal/portal-docs.htm...
>The FileChooser portal allows sandboxed applications to ask the user for access to files outside the sandbox. The portal backend will present the user with a file chooser dialog.
In addition it being a dbus api for communicating outside a sandbox