Short answer
Write data ownership, full export rights in usable formats, and transition assistance into every contract, and keep a copy of your key data somewhere you control. The agencies that stay free to choose are the ones that test their exit before they need it.
Lock-in rarely happens on the day you sign, because it builds up quietly through proprietary formats, integrations only the vendor can maintain, and reports that live inside a product you cannot easily leave. The first key is the contract, so I want language that says the agency owns its data, including metadata and attachments, that you can export all of it at any time in a documented, usable format at no extra charge, and that the vendor will help you transition at the end of the term on terms agreed today.
The second key is architecture, which means using documented APIs for integrations, keeping a reporting copy of your important data in a warehouse or database you control, and avoiding heavy modifications that only one firm understands. With AI in the picture this matters even more, since you also want contract language that keeps your data out of anyone's model training and tells you which model a feature runs on.
Finally, actually test the export once a year, because a right you have never exercised is only a promise. The Start at Zero Navigator includes a data ownership checklist, and it is free to download.