If I’m understanding your question right, this is actually one of the problems that we were trying to solve when we thought of ILP in the first place.
If implemented properly by the gateway, ILP provides better, but not foolproof, security for payments into RCL (“deposits”) and payments from RCL out to other systems (“withdrawals”). With ILP, a deposit into RCL could look like this:
1. Request a payment into RCL and define a crypto-condition that will prove you’ve received your issuances in RCL.
2. You put your non-RCL funds into escrow, such that they’ll be paid to the gateway when your crypto-condition is met*.
3. The gateway sends you the money in RCL, fulfilling your crypto-condition. That releases the funds in escrow so the gateway gets your money.
*One problem here is that traditional digital payments allow chargebacks or cancellation of the payment later, even after the irrevocable RCL payment has occurred. Whatever system you use to handle the escrow has to be pretty trustworthy.
The withdrawal from RCL looks like this:
1. Request a payment out of RCL. The gateway defines a crypto-condition that will prove you’ve gotten your money outside of RCL.
2. You put a Ripple payment in escrow, such that the funds will be released when the crypto-condition is met**.
3. The gateway transfers the money to you outside of RCL, fulfilling the crypto-condition. That releases the escrowed Ripple payment, so the gateway gets their money.
** T8493 is spot-on in one regard, though, which is that you need escrow on RCL for this to work. That’s why we’re working on Suspended Payments for RCL. You can try out SusPays for XRP in the Test Net already; SusPays for issuances are not a solved problem yet, so stay tuned for more info there.
One of the limitations here is that you still have to trust the gateway — if the gateway shuts down and stops honoring its RCL issuances, the people holding those issuances are out of luck. Even though you get to keep your in-RCL balance unless the gateway pays you outside RCL, that’s little comfort if the in-RCL balance is worthless. The good news is this still improvement over the current system: if the gateway is still honoring some issuances, but fails to pay you outside RCL, you can trade away the issuances in the ledger instead of having them just disappear. It also means that it’ll be more obvious when a gateway decides to cut and run, because suddenly RCL will have a big percentage of SusPays that expire instead of having their condition met.
Honestly, though, the system works better for XRP than for issued currencies.