1) Create code with subtle but privately known "bug" that allows profitable behavior far outside the bounds of what you advertise to the public as your code doing.
2) Wait for liquidity pools within the contract to build up.
3) Exploit the "bug"
Yes according to "Code-is-law" you're not doing anything "unlaw(code)ful." But it's a rug pull in everything but name. De-fi is basically never introduced as "there's contract 0x343cdc.... on the blockchain, go read the EVM code as nothing will be explained" so intent in the way something is introduced is instrumental here.