Defend the wallet, not just the data
Cost is a security property. Map the surfaces that spend money, then cap every one of them — and prove the cap actually caps.
We are trained to protect confidentiality, integrity, and availability. On a free or low-tier stack, there is a fourth thing an attacker can take from you: money. A bot that cannot read your data can still run up your bill until availability collapses on its own.
Map the spend surfaces
Make a list of every request that costs real money: CDN egress, model tokens, vector embeddings, transactional email. Put a limit in front of each one, per user, per IP, and globally per day.
Prove the limiter limits
Here is the part I almost shipped broken. A “daily” limiter silently reset every hour, because its counter lived in a table an hourly prune job wiped. It was roughly twenty-four times more permissive than the number in its own name.
A limit you did not test is a comment, not a control.
Write the test that hammers the endpoint past the cap and watches it say no. Until that test is green, the number in the config is a wish.