Someone Is Spamming Your AI Feature: Abuse Prevention for Vibe Projects
Free, unlimited AI features invite abuse: one account can burn a month of model budget in a weekend. A five-layer funnel — identity, quotas, behavior, cost, review — plus circuit breakers. All example projects, people, and numbers in this guide are fictional.

It is the third week after your vibe project launched, and your AI feature suddenly got popular — not because you gained users, but because your bill exploded. On Monday morning you open your model provider's dashboard and find that two days over the weekend burned as many tokens as a normal month. The call logs show a single account generating over a thousand newsletters overnight. Nobody hacked you. No key leaked. A few people simply discovered that your AI feature is free and unlimited, and started treating it as their personal free typewriter. This is AI feature abuse: not an injection attack, not credential stuffing — real users with real accounts, drinking your model budget like water.
Two things first. Every project, person, and number in the worked example below — the app "Little Press," the developer "Lin Wan," and all call volumes and dollar amounts — is fictional, invented only to walk through the protection process clearly. And a word on scope: this site has already published Prompt Injection Defense, which is about attackers using crafted inputs to steer the model into saying things it should not; it has also published Agent Spend Hard Cap and Signup Anti-Bot Verification — the first is about stopping your own agent from burning money out of control, the second about bots at registration. This guide covers one thing only: what to do when users abuse the AI feature inside your product — how to spot it, how to block it in layers, and how to hold the bill down without hurting good users. It does not repeat injection defense or registration anti-bot work.

1. What abuse looks like: four people to recognize
The first step of protection is recognizing who you are dealing with. Four kinds of people usually abuse your AI feature, with different motives and different playbooks — and different countermeasures.
The first is the freebie farmer. He discovers the free tier allows twenty newsletter generations a day, so he shows up every day and uses exactly twenty, and teaches his friends to do the same. Every call looks like a normal request; there are just a lot of them, right on schedule. When fictional "Little Press" launched with a free allowance of twenty generations a day, Lin Wan saw three accounts using exactly twenty every day for seven days straight — never one more, never one less. That is the freebie farmer's fingerprint: using exactly up to the limit, never over it, because going over gets blocked.
The second is the developer using you as an API. He skips your interface, copies your request format, and hammers your AI endpoint with scripts, selling the generated content elsewhere. The signature is perfectly even call intervals, no time spent reading pages, and an identical User-Agent every time. In week three, Lin Wan found an account firing exactly sixty calls an hour, on the hour, with intervals precise to the second. Humans do not use products like that. Scripts do.
The third is the boundary tester. He is not after money; he wants to see whether your AI can be coaxed into producing disallowed content or talked past your content filters. The signature is inputs that get longer and stranger, tripping your content filters again and again. The volume is small, but a single miss can earn you a warning from the platform.
The fourth is the sneakiest: a hijacked normal account. The account is a real user's, but the password leaked somewhere else and someone else is using it for bulk calls. The signature is a sudden change in behavior: a user who normally generates two newsletters a week starts generating one a minute at 3 a.m. You spot this one not from what a single call looks like, but from "this person does not normally behave like this."
Once you recognize these four, protection gets direction: limit the first, authenticate against the second, filter the third, and apply risk controls to the fourth. Expecting one wall to stop all four is the most common misunderstanding in abuse prevention.
2. The five-layer defense funnel: each layer does one job
Do not try to solve everything with a single "anti-abuse system." The practical approach is a five-layer funnel, each layer doing exactly one job, passing what it cannot stop to the next layer. The funnel numbers below are fictional illustrative figures showing what each layer is for, not statistics from any real product.

Layer one is identity: who is calling. AI features require sign-in; anonymous calls get nothing. Every account and every API key must map to a real identity, and the call log must be able to answer "whose call was this?" Lin Wan's early mistake was letting visitors try the generation feature three times without signing in, to lower the signup barrier — those three free tries became the abuse entrance, since a fresh browser fingerprint earned three more. Requiring sign-in cut abuse by more than half overnight. This layer stops calls that do not even have an identity.
Layer two is quotas: how much each person gets per day. Twenty generations a day for free users, two hundred for paying users — written into the product rules and written into the code. Quotas are counted per account, per day; when the quota is gone, return a clear message with an upgrade path instead of quietly letting calls through. The critical point is that quotas must be enforced server-side: the "three left today" shown in the frontend is only a hint. The real counter lives on the server, and no number sent from the client can be trusted.
Layer three is behavior: does this call look human. Watch three things: speed, rhythm, and content. Speed is calls per unit of time — a normal person needs a while to read a result before generating the next one. Rhythm is whether call intervals are as even as a clock. Content is whether input length and repetition look abnormal. When a behavior rule fires, do not ban the account outright; start with soft measures: add a human-verification challenge, delay responses by a few seconds, temporarily halve the quota. Soft measures can be reversed instantly if you got it wrong; a hard ban that hits the wrong person becomes a support complaint.
Layer four is cost: is this transaction still worth it. Set a cost ceiling per account and per feature: a maximum token count per generation and a maximum daily model spend. Calls past the ceiling are refused outright and logged. Lin Wan's rule for "Little Press" was a maximum of 4,000 tokens per generation, and free accounts whose daily model cost passed two dollars lost their free allowance for the day. The numbers themselves do not matter; what matters is that "past the line means stop" happens automatically, without you waking up at midnight to switch things off by hand.
Layer five is human review: what about the ones that slip through. Even the best funnel leaks. Spend ten minutes a day looking at the calls that got blocked: were any normal users caught by mistake, and is any new abuse pattern emerging? Review produces two things: wrongly blocked accounts get released, and newly spotted abuse patterns become the next rule. A protection system with no review will, within three months, have both problems at once: good users locked out, bad users walking through.
3. Quota design: a bigger free allowance is not better
The free allowance is a growth tool — and an abuse entrance. Remember three rules when designing quotas. First, the free allowance should be enough to experience, not enough to make a living: a new user should be able to complete one full core flow and see one good result, but not mass-produce content to sell every day. After "Little Press" cut its free allowance from twenty generations a day to five, signup conversion fell by less than ten percent, while abuse calls fell by eighty percent — because freebie farmers want volume, not a demo.
Second, quotas should be tiered, not one-size-fits-all. A brand-new account, an email-verified account, and a paying account should get different allowances. New accounts start small, and the allowance grows slowly after a week of clean behavior. Call it "allowance growth": the older the account and the cleaner the behavior, the higher the limit. Handing a new account the full allowance on day one is like hanging your house key on the front door.
Third, the over-limit message must speak human. "429 Too Many Requests" tells the user nothing, and gives them no next step. A good message says three things: your free allowance for today is used up, it resets at this time tomorrow, and you can upgrade to the paid plan if you need it now. After Lin Wan rewrote the over-limit message this way, support tickets about "allowance used up" halved, and paid upgrades went up — because the message offered a way forward instead of a wall.
4. Cost circuit breakers: the emergency switch when the bill runs away
Quotas protect you against a single account; circuit breakers protect you against global runaway. A breaker has three stages, written down in advance and executed automatically. Do not wait until the bill arrives to think about them.
Stage one is the alert. When model spend reaches twice the same period yesterday, or hourly call volume passes three times the same hour over the past seven days, send yourself a notification. Set the threshold for your own traffic volume: too low and it rings every day until you stop reading it; too high and it may as well not exist. Lin Wan's alert lines were a notification when daily model spend passed fifty dollars, and another at a hundred. Fifty dollars is a number from a fictional example — copying it is pointless. What matters is that your alert line lives in configuration, not in your head.
Stage two is degradation. Once an alert fires, the system automatically does three things: free users join a slower queue, the maximum length of a single generation is halved, and non-core AI features (like "rewrite it in another style") go temporarily offline. Degradation is not a shutdown: good users only notice things getting slower, while an abuser's output per unit of time is cut in half. Write the degradation into your status page so users see "the system is busy, some features are slower" instead of staring at a spinner.
Stage three is the breaker. When daily spend hits your hard ceiling, stop all AI calls except a minimum allowance for paying users. Set the ceiling at what you can afford to burn in a month — that is the most you can lose. The breaker must be restorable by hand, and before restoring it you must check the logs: which account, which feature burned the money. A system with no breaker is like a car with no brakes.
Exercise the three stages regularly: once a month, trigger a degradation by hand and confirm the notification arrives, the queue really slows down, and the breaker really stops calls. A failure found during a drill is far cheaper than one found during real abuse.
5. Content filtering and privacy: do not let the model get you in trouble
Abuse prevention is not only about saving money; it is also about keeping the model's output from causing trouble. On the input side, do two things. First, limit length and format: refuse any single input over ten thousand words, and check file sizes before accepting requests with large attachments. Second, block sensitive words and jailbreak probes: accounts that trip the filter repeatedly get downgraded first, then reviewed by a human. On the output side, do one thing: run generated results through a filter before returning them to the user. Never hand the model's raw output straight to the frontend.
There is also a privacy red line: do not log users' raw prompts verbatim, and never use them for training. Logs should keep only a redacted summary: call time, account, token count, and which rule fired. Lin Wan's logging rule was to keep only the first twenty characters of a prompt and mask the rest; any call containing an email address, phone number, or street address had its entire prompt excluded from the logs. This is not about stopping abuse — it is about not having to write apology letters if the logs ever leak.
6. What to do when good users get caught: leave an appeal path
Every protection system catches the wrong people sometimes. The false positive itself is not the disaster; the disaster is a wrongly blocked user with nobody to talk to. Leave three things in place. First, tell blocked users why: "your call rate is above the normal range" is far more useful than "system busy." Second, provide an appeal entrance: a blocked account can send an appeal from inside the product, explaining what they were doing. Third, someone must read appeals within one business day: even a one-person team can check the appeal list once a day, release wrongly blocked accounts the same day, and write down what happened so the rule that caused it gets fixed.
"Little Press" learned this the hard way — "the hard way" here meaning inside our fictional example: a user racing a deadline generated forty newsletters in an hour, was flagged as a script by the behavior layer, and had the account suspended. In the appeal, the user attached a publishing calendar and draft timestamps. Lin Wan released the account the same day, raised the behavior threshold from thirty calls an hour to fifty, and added an exception: consecutive generations on the same topic do not count toward the script test. The day that false positive got fixed, the protection system genuinely got a little stronger.
7. Review: turn every abuse incident into one new rule
What a protection system fears most is not abuse — it is abuse that comes, goes, and leaves nothing behind. After handling any abuse incident, spend twenty minutes writing a three-line review. Line one: what happened — which account, which feature, how much money burned, how long it lasted. Line two: which layer should have stopped it — did the identity layer fail to require sign-in, did the quota layer fail to enforce server-side, or was the behavior threshold set too loose? Line three: which rule changed — and write that rule into the code and into the checklist, not just into your head.
Reviews have a second use: they tell you whether protection has gone too far. Once a month, look at what share of blocked calls were false positives. If false positives stay above ten percent for two months running, some rule is set too tight and needs loosening. If abuse slipping through keeps rising for two months, you need a new layer, not ever-tighter thresholds on the old ones. "Little Press" reviewed monthly: over three months Lin Wan changed the quota threshold twice and added one exception to the behavior layer — consecutive generations on the same topic do not count toward the script test — and the false-positive rate fell from twenty percent to under five percent. Those figures are fictional, from our example — but the direction is right: a review is not a report, it is how the next block and the next release both get a little more accurate.
8. The pre-launch checklist: copy it and use it
Before shipping an AI feature, check every item below. This is the list Lin Wan used before the second launch of the "Little Press" AI feature.
One, AI features require sign-in, anonymous calls are refused outright, and the call log can show which account made each call. Two, quotas are enforced server-side, free and paid allowances are written separately, and new accounts start with a small allowance. Three, a maximum token count per generation and a maximum daily model spend are both set, and calls past them stop automatically. Four, the three-stage breaker is written down — alert line, degradation actions, hard ceiling — all able to execute automatically, and exercised once a month. Five, input length is limited, output is filtered before it is returned, and logs never store complete user prompts. Six, blocked users can see why, can appeal, and the appeal list is read by a human every day. Seven, the over-limit message speaks human: the allowance is used up, when it resets, and how to upgrade.
One last word: AI abuse prevention is not a wall you build once. It is a ten-minute daily habit — glance at the logs, release one wrongly blocked account, add one new rule. "Little Press" has never reached zero abuse, and it never will. But the bill has never again burned a month's money in a single weekend. For a one-person team, that is enough: the goal is not to make bad actors disappear, but to make abuse unprofitable — and to make sure good users always have a way through.
Comments (0)
Related articles
You already call functions every day; this guide names what you have been doing. Following MDN's Functions, Arrow function expressions, and Rest parameters: declarations versus expressions, parameters and arguments, default values, rest parameters, spread syntax, return values, arrow function shorthand, the this trap, callbacks, and scope.
One page should stand up on a phone, a tablet, and a computer. This guide follows MDN's Responsive web design, Using media queries, and the viewport meta reference: fluid HTML, the viewport tag, fluid grids and max-width, images that never burst their container, media query syntax, breakpoints set by content, mobile first, responsive type, testing capability instead of width, and a pre-launch checklist.
Numbers in JavaScript are one type, Number, stored as 64-bit floats — which is why 0.1 + 0.2 is 0.30000000000000004. This guide follows MDN's Basic math in JavaScript, Math, and Number: one number type, float error, counting money in cents, converting strings, NaN and Infinity, safe integers, the four rounding methods, Math.random, the Math toolbox, and formatting for display.