Transactions from the wallet or RPC are sent to all inbound and outbound peers initially. Outbound connections are chosen by us, whereas inbound connections are cheap to initiate, so inbound peers are more likely to be spy nodes in an adversarial setting.
We can improve the privacy of our initial tx relay by not relaying to inbound peers until some timeout.
My current implementation is an untested draft looking for conceptual review.
The idea is to keep a node-specific relay map that is populated (just like the global mapRelay) via the trickle logic. This is required because there is currently no other way in Bitcoin Core to relay without revealing that we were the source of the transaction. In the future this relay mechanism could be replaced by Dandelion or a mechanism to send the transaction over tor.
The transaction is still added to the mempool, which means an active (tx-creating) attacker could find that we were the source of the transaction in some corner cases. (E.g. They can create descendant txs and trigger a mempool limit). However, it should not be possible to simply request the transaction, since it was only added to a peer specific relay map.
After some timeout the transaction is pushed to all peers as a fallback.