Security concerns with walletpassphrase I have some security concerns with walletpassphrase:

If it stores the passphrase for some unit of time. ie. so you can send funds, surely if the server is compromised, within that timeframe, the attacker can obtain the passphrase in its raw format?
If I have somehow misunderstood, ie. perhaps the raw passphrase isn't easily accessible (how?), an attacker could still empty the wallet within that timeframe seeing as the wallet is in an decrypted state.

All roads are leading me to use bitcoin libraries that allow me to create transactions and sign them using encrypted private keys that are only decryptable at the time of signing. I feel way more comfortable using my node for transaction broadcasting / indexing capabilities. Rather than leveraging its in-built wallet.
Wallet encryption protects funds at rest, it does effectively nothing about protecting funds on a live machine that has loaded the wallet to make a transaction.
There's no expectation that the passphrase will do anything in particular to protect online wallets on machines that contain malicious software, as you've surmised.