DEV Community

Cover image for I thought my bot needed a better prompt, but TikTok’s 20 RPM limit and WhatsApp’s service window were the real problem
Lars Winstand
Lars Winstand

Posted on • Originally published at standardcompute.com

I thought my bot needed a better prompt, but TikTok’s 20 RPM limit and WhatsApp’s service window were the real problem

I kept seeing the same failure mode in social reply bots:

  • someone wires up GPT-5 or Claude
  • the first few demos look great
  • then production gets weird
  • and everybody blames the prompt

I thought that too.

Then I read a thread on r/openclaw asking the exact question a lot of teams want answered:

Can you build one OpenClaw-based bot that safely auto-replies across TikTok, Instagram, Facebook, and WhatsApp without getting banned?

The most honest reply in that thread was also the most useful:

"It's impossible to build this fully ban proof. Social media sites are getting stricter every day around bots and automated tools."

That’s the real starting point.

The bottleneck usually isn’t text generation anymore. It’s orchestration.

If you’re building multi-agent systems for comments, DMs, and support flows, the hard part is not getting a model to write a decent reply. The hard part is deciding:

  • should this message be sent automatically?
  • should it become a draft?
  • should a human review it?
  • are we even allowed to send it on this channel right now?

That’s not prompt engineering. That’s control-plane engineering.

The model is rarely the thing breaking first

For social auto-replies, text generation is mostly solved.

GPT-5 can write a refund response.
Claude can draft a cautious moderation reply.
Smaller models can classify FAQ vs escalation pretty well.

If your only problem were wording, this category would already be boring.

But Instagram, WhatsApp, Facebook, and TikTok do not behave like one unified inbox. They behave like four different policy environments with different APIs, different rate limits, different review requirements, and different definitions of acceptable automation.

That means your architecture matters more than your prompt.

What actually breaks first

Usually:

  1. unofficial integrations
  2. polling-heavy designs
  3. missing review gates
  4. channel-specific policy mismatches
  5. rate limits nobody modeled up front

Another comment in that same r/openclaw thread said it even more bluntly:

"If the site does have an official API and you have proper access to it (not resold by third party) then you are generally okay. But for sites that don't (which is most social media sites) you are risking a ban"

That lines up with the docs.

Channel What you actually get
Instagram Platform Official comment reply/moderation endpoints, webhook support, Meta app permissions and access requirements
WhatsApp Business Platform Service-window rules, template-message requirements outside allowed windows, business policy enforcement
TikTok Content Posting API Strong publishing workflow docs, explicit rate limits like 20 requests/minute on creator info query, but a much narrower official surface than most teams assume

That table is the whole story.

A lot of teams say they want “one bot for every channel.”

What they actually want is one abstraction over four incompatible rule systems.

OpenClaw helps, but it does not make the channel risk disappear

I like OpenClaw for this kind of stack because it gives you orchestration primitives instead of pretending the internet is uniform.

OpenClaw gives you:

  • hooks
  • background tasks
  • scheduled jobs
  • standing orders
  • multi-agent routing
  • gateway support for channels like WhatsApp via Baileys

That is useful.

But useful is not the same as safe.

If you run:

openclaw onboard
Enter fullscreen mode Exit fullscreen mode

you are not getting a ban-proof social automation layer.

You are getting the pieces to build your own supervisor.

That distinction matters.

The default local gateway dashboard and canvas ports in the docs make that clear too. This is orchestration software, not magic social middleware.

Gateway dashboard: http://127.0.0.1:18789/
Canvas host:       http://127.0.0.1:18793/
Enter fullscreen mode Exit fullscreen mode

If your architecture needs routing, state, retries, review queues, and compliance rules, OpenClaw is useful.
If your architecture depends on a platform tolerating unofficial automation forever, OpenClaw cannot save that.

Why Instagram is the easiest place to start

Instagram is one of the few channels where the official path is clear enough to build something real.

Example comment fetch:

curl -X GET "https://<HOST_URL>/v25.0/<IG_MEDIA_ID>/comments"
Enter fullscreen mode Exit fullscreen mode

Example reply:

curl -X POST "https://<HOST_URL>/v25.0/<IG_COMMENT_ID>/replies"
Enter fullscreen mode Exit fullscreen mode

That matters a lot.

Meta also recommends webhooks over polling to reduce rate-limit pressure.

That tells you what a production architecture should look like:

  • event-driven intake
  • low polling footprint
  • explicit permissions
  • narrow automation scope

A practical Instagram routing pattern

For Instagram comments, this is the split I’d actually ship:

  • Auto-send: basic FAQ, store hours, shipping ETA, product availability
  • Draft for review: refunds, damaged orders, account issues, edge-case complaints
  • Human-only: harassment, legal threats, medical claims, regulated products, PR-risk situations

That’s the useful role for an LLM here.

The model writes the draft.
The supervisor decides whether the draft is allowed to exist.

WhatsApp is where timing beats prompting

WhatsApp Business is where teams finally realize the model is not in charge.

The same user intent may require different outbound behavior depending on whether you are inside or outside the customer service window.

Inside the window, you may be able to send a free-form message.
Outside it, you typically need an approved template.

So before the model output matters, your system needs to answer:

  1. Are we inside the service window?
  2. If not, do we have an approved template for this intent?
  3. If not, should we wait for a human?

That is routing logic.

Not prompt logic.

You can have the best prompt in the world and still be blocked by policy.

TikTok is where the “one bot for everything” idea usually falls apart

TikTok is the channel people tend to over-assume.

Because TikTok is huge, teams assume there must be a broad official API for full comment and DM automation.

But the public docs are much narrower than that fantasy.

The Content Posting API is real and useful. It documents:

  • publishing workflows
  • creator capability checks
  • media transfer rules
  • rate limits

For example, the /v2/post/publish/creator_info/query/ endpoint is limited to 20 requests per minute per user access token.

That is a real production constraint.

If you’re polling capability or eligibility too aggressively across many accounts, you’ll hit it.

A simple guard might look like this:

class TokenBucket {
  private tokens: number;
  private lastRefill: number;

  constructor(
    private capacity: number,
    private refillPerMinute: number
  ) {
    this.tokens = capacity;
    this.lastRefill = Date.now();
  }

  take(count = 1): boolean {
    const now = Date.now();
    const elapsedMinutes = (now - this.lastRefill) / 60000;
    const refill = elapsedMinutes * this.refillPerMinute;

    this.tokens = Math.min(this.capacity, this.tokens + refill);
    this.lastRefill = now;

    if (this.tokens >= count) {
      this.tokens -= count;
      return true;
    }

    return false;
  }
}

const creatorInfoLimiter = new TokenBucket(20, 20);

if (!creatorInfoLimiter.take()) {
  throw new Error("TikTok creator_info/query rate limit reached");
}
Enter fullscreen mode Exit fullscreen mode

That handles one narrow API behavior.

It does not magically give you broad, safe, official automation for every TikTok interaction surface.

That’s the gap teams keep underestimating.

What to build instead: a supervisor, not a universal auto-replier

This is the architecture I trust most.

1. Channel-specific event intake

Use the official event surface where it exists.

  • Instagram: webhooks
  • WhatsApp Business API events
  • TikTok: only the approved official endpoints and event flows you actually have access to

2. Policy checks before generation

Before asking any model to write, check:

  • permissions
  • message window rules
  • endpoint availability
  • quotas
  • account state
  • category risk

3. Supervisor classification

Every inbound message should land in one of three buckets:

  • auto_send
  • draft_review
  • human_only

Example:

type Decision = "auto_send" | "draft_review" | "human_only";

function classify(message: {
  channel: "instagram" | "whatsapp" | "tiktok" | "facebook";
  intent: string;
  riskScore: number;
  insideServiceWindow?: boolean;
  hasApprovedTemplate?: boolean;
}): Decision {
  if (message.riskScore > 0.8) return "human_only";

  if (message.channel === "whatsapp") {
    if (!message.insideServiceWindow && !message.hasApprovedTemplate) {
      return "human_only";
    }
  }

  if (["refund", "legal", "medical", "account_access"].includes(message.intent)) {
    return "draft_review";
  }

  return "auto_send";
}
Enter fullscreen mode Exit fullscreen mode

4. Background enrichment

Run the expensive stuff asynchronously:

  • CRM lookup
  • prior conversation summary
  • abuse detection
  • urgency classification
  • draft generation with GPT-5, Claude, Qwen, or another model
  • dedupe against recent replies

5. Compliance rules before outbound send

Before the final send, enforce:

  • prohibited-claim checks
  • burst throttling
  • retry limits
  • escalation on repeated failures
  • channel-specific formatting and policy rules

That’s where orchestration frameworks earn their keep.

Why this gets expensive fast under per-token pricing

A lot of teams estimate cost based on the visible reply.

That’s the wrong unit.

The expensive part in agentic automation is all the invisible work around the reply:

  • classification
  • moderation
  • summarization
  • retries
  • fallback generation
  • audit logging
  • routing decisions
  • review queue handling

A single customer message can trigger multiple model calls before anything gets sent.

That’s why flat monthly compute is a much better fit for orchestration-heavy systems than per-token billing.

If you’re building agents that run all day inside n8n, Make, Zapier, OpenClaw, or custom workers, per-token pricing punishes exactly the safety layers you should be adding.

That’s the pitch for Standard Compute:

  • unlimited AI compute
  • flat monthly pricing
  • OpenAI-compatible API
  • works with existing SDKs and HTTP clients
  • useful for agent workflows that make lots of small routing and safety calls

If your stack is doing classification, moderation, drafting, retries, and escalation all day, predictable cost is a real architecture advantage, not just a pricing preference.

A minimal implementation sketch

If I were building this today, I would start with something like this:

async function handleInboundEvent(event: any) {
  const normalized = await normalizeEvent(event);

  const policy = await runPolicyChecks(normalized);
  if (!policy.allowed) {
    return queueForHuman(normalized, policy.reason);
  }

  const decision = classify({
    channel: normalized.channel,
    intent: normalized.intent,
    riskScore: normalized.riskScore,
    insideServiceWindow: normalized.insideServiceWindow,
    hasApprovedTemplate: normalized.hasApprovedTemplate,
  });

  if (decision === "human_only") {
    return queueForHuman(normalized, "policy_or_risk");
  }

  const draft = await generateDraft(normalized);

  if (decision === "draft_review") {
    return queueDraft(normalized, draft);
  }

  await finalComplianceCheck(normalized, draft);
  return sendReply(normalized, draft);
}
Enter fullscreen mode Exit fullscreen mode

That flow is boring.

Good.

Boring is what you want when real accounts, rate limits, and platform policy are involved.

When you do not need the full multi-agent circus

To be fair, not every team needs a giant supervisor stack.

If most of your volume lives inside Meta, and your use case is narrow, a simpler rules-based system may be enough.

Example:

  • Instagram comments only
  • WhatsApp support only
  • clear escalation categories
  • small review queue
  • no promise of “reply to everything automatically”

That can work.

But the moment the requirements become:

  • TikTok too
  • full DM automation
  • auto-reply everywhere
  • ban-proof behavior
  • no human review

you are not building a bot anymore.

You are building a governor.

And you should scope it like one.

Practical checklist before you touch the prompt again

If your social reply bot is unstable, answer these first:

  • Which channels have official reply APIs for my exact use case?
  • Which channels expect webhooks instead of polling?
  • Where do messaging windows change what I’m allowed to send?
  • What are the hard rate limits per endpoint and token?
  • Which messages should never be auto-sent?
  • What is my fallback when the official API surface is narrower than the product requirement?
  • What gets human review by default?

If you cannot answer those, you do not have a prompt problem.

You have an orchestration problem pretending to be a model problem.

And honestly, that’s good news.

Because orchestration is fixable.

Usually the answer is not “find a smarter model.”
Usually the answer is “build a stricter supervisor.”

Top comments (0)