Harden CLI runtime config and connection handling
