# WhatsApp opt-out and consent: rules for AI agents in 2026

> How to handle STOP, consent and AI disclosure for a WhatsApp AI agent: GDPR, the EU AI Act, Brazil's LGPD, WhatsApp's policies and the CNIL's 2026 note.

Source: https://whasp.ai/blog/whatsapp-opt-out-consent-ai-agents · 2026-10-20

## Key takeaways

- Consent is only one legal basis (one of six in the GDPR, one of ten in Brazil's LGPD), but the right to stop is not optional: under the GDPR a person can object to direct marketing at any time, and withdrawing consent must be as easy as giving it.
- The EU AI Act has required chatbots to tell people they are talking to an AI since 2 August 2026, at the latest at the first interaction.
- On whasp, an exact uppercase STOP, UNSUBSCRIBE, OPTOUT, CANCEL, END or QUIT, or any spelling of "opt out", blocks the chat automatically; lowercase "stop" and "please stop" are yours to catch.
- whasp lifts its block when the person writes again, so keep your own record of who agreed to what and when.
- whasp's servers keep no messages, so history, retention and deletion are your job; the CNIL's July 2026 note on agentic AI suggests memory that expires and is easy to delete.

An AI agent on WhatsApp needs four things: an opt-out that always works, a legal basis for the chat data it keeps, a clear statement that the user is talking to an AI, and records that prove all three. The rules come from the GDPR, the EU AI Act (Article 50, since 2 August 2026), Brazil's LGPD and WhatsApp's own policies.

## Why does opt-out matter twice for a WhatsApp agent?

Opt-out matters for two separate reasons: the law and the health of your number.

The law sets heavy caps. A GDPR breach of the consent conditions or of a person's rights can cost up to EUR 20 million or 4% of worldwide annual turnover ([Article 83(5)](https://eur-lex.europa.eu/eli/reg/2016/679/oj)). Brazil's LGPD allows fines of 2% of revenue in Brazil, capped at R$50 million per infraction, enforceable since 1 August 2021 ([Articles 52 and 65](https://www.planalto.gov.br/ccivil_03/_ato2015-2018/2018/lei/l13709.htm)). The AI Act allows EUR 15 million or 3% for a transparency breach ([Article 99(4)](https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-99)).

The number has its own risk. Personal accounts follow WhatsApp's general [Terms of Service](https://www.whatsapp.com/legal/terms-of-service), and numbers that behave like bots, above all ones that message strangers, get banned. On the Business Platform, WhatsApp's [Business Messaging Policy](https://whatsappbusiness.com/policy/), updated on 23 September 2026, says businesses may contact only people who opted in, must respect requests to opt out, and that significant negative feedback from users can lead to limits or removal. Treat a block on a personal number the same way: it is the cheapest signal a user can send, and a working STOP gives them a better option. whasp's own rule that users always write first exists for the same reason, because cold messages are what get personal numbers banned. [Why WhatsApp bans numbers](https://whasp.ai/blog/why-whatsapp-bans-numbers) covers the other signals.

## What do the GDPR and Brazil's LGPD expect?

Both laws treat the phone number, the name and the messages as personal data, and both give people control over them. If you offer the agent to people in the EU, the GDPR applies. The LGPD covers processing in Brazil, services aimed at people in Brazil, and data collected there (Article 3). The two line up closely:

| Topic | GDPR (EU) | LGPD (Brazil) |
| --- | --- | --- |
| Is consent required? | One of six legal bases (Article 6(1)); contract and legitimate interests can cover a chat the user started | One of ten legal bases (Article 7) |
| Special data (health, sex life) | Needs an exception such as explicit consent (Article 9(2)(a)) | Specific and emphatic consent, or another listed ground (Article 11) |
| Proving consent | The controller must be able to demonstrate it (Article 7(1)) | The controller bears the burden of proof (Article 8, paragraph 2) |
| Withdrawing consent | As easy as giving it (Article 7(3)) | At any time, by a free and facilitated procedure (Article 8, paragraph 5) |
| What you must tell users | Controller, purposes, legal basis, retention, rights (Article 13) | Purpose, duration, controller, contact, rights (Article 9) |
| Deletion | Erasure when no longer needed or consent is withdrawn (Article 17) | Erasure of data processed with consent (Article 18, item VI) |
| Maximum fine | EUR 20 million or 4% of worldwide turnover | 2% of Brazilian revenue, up to R$50 million per infraction |

Three points matter most for a chat agent.

**Choose a basis for each purpose.** Answering a person who signed up for your service can rest on contract. Consent fits the extras: health details, reusing chats for something the person did not expect, anything they can refuse without losing the service. Consent must also be specific, and the GDPR says to take utmost account of whether the service is made conditional on consent to data it does not need (Article 7(4)).

**The right to stop is separate from consent.** Under the GDPR, a person can [object at any time to direct marketing](https://eur-lex.europa.eu/eli/reg/2016/679/oj), and after that the data must no longer be processed for it (Article 21(2) and (3)). That is the legal core of STOP.

**Answer deletion requests on time.** The GDPR sets one month, extendable by two (Article 12(3)).

## Does the EU AI Act require an AI disclosure?

Yes, since 2 August 2026, with a narrow exception. Article 50(1) of the [AI Act](https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-50) requires providers to design AI systems that talk to people so that those people are informed they are dealing with an AI. The exception applies only when it is obvious to a reasonably well-informed, observant and circumspect person. Article 50(5) says the information must be clear and given at the latest at the first interaction. A chat that starts in WhatsApp, from a contact with a name and a photo, should disclose in the profile and in the first message.

The grace period until 2 December 2026 covers only the machine-readable marking of generated content in Article 50(2), for systems already on the market. It does not cover Article 50(1). [AI companion safety rules](https://whasp.ai/blog/ai-companion-safety-rules-2026) has the details, plus the California and New York duties.

## What does the CNIL's July 2026 note add for agents with memory?

On 20 July 2026, the CNIL and the Conseil de l'IA et du Numérique published an [exploratory note on agentic AI and personal data](https://www.cnil.fr/fr/ia-agentique-cnil-cianum-note). It sets no new obligations. It says the GDPR applies in full to agentic systems, meaning programs built on generative models that decide, orchestrate actions and call third-party services.

It does not make consent the answer. Its worry is memory. Persistent memory builds detailed profiles, strains purpose limitation, data minimization and storage limitation, and makes rights hard to exercise when data sits in several places and the person cannot tell what was kept or where it went. Its ideas for builders: separate memory per agent and per purpose, memory that is size-limited or expires, a trace of which data and services each task used, user control over what an agent can reach, human validation for critical actions, and a kill switch. If your WhatsApp agent keeps notes about people, those ideas are a good design brief.

## How should an agent handle STOP and other opt-outs?

On whasp, STOP works at the number level, and you add the rest. An inbound message that is exactly `STOP`, `UNSUBSCRIBE`, `OPTOUT`, `CANCEL`, `END` or `QUIT` (uppercase), or any spelling of "opt out", opts the chat out automatically. Sends to that chat return 403 `chat_opted_out`, and messages still in the queue fail with `message.failed` and the same error. One send with `"override_optout": true` goes through anyway, which is how you confirm the opt-out. The block lifts as soon as the person writes again.

Two gaps are yours. Lowercase "stop" and polite requests ("please stop", "leave me alone") are not matched. And because the block lifts when the person writes, whasp cannot know whether they want follow-ups again. Keep your own flag.

```ts
declare function recordOptOut(chat: string, messageId: string, text: string): Promise<void>;
declare function hasFollowUpConsent(chat: string): Promise<boolean>;

// whasp blocks exact uppercase STOP, UNSUBSCRIBE, OPTOUT, CANCEL, END, QUIT and "opt out".
// Everything else is yours.
const WHOLE_MESSAGE = /^\s*(please\s+)?(stop|unsubscribe|opt[ -]?out)( now| please)?\s*[.!]*\s*$/i;
const PHRASES = /\b(stop (texting|messaging|writing to|contacting) me|leave me alone|no more (messages|texts)|don'?t (text|message|contact) me)\b/i;

export async function onInbound(message: { id: string; chat: string; text: string | null }) {
  const text = message.text ?? "";
  if (!WHOLE_MESSAGE.test(text) && !PHRASES.test(text)) return false;

  await recordOptOut(message.chat, message.id, text); // who, when, which message, what words
  await fetch("https://api.whasp.ai/v1/messages", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.WHASP_API_KEY}`,
      "Content-Type": "application/json",
      "Idempotency-Key": `optout-${message.id}`,
    },
    body: JSON.stringify({
      to: message.chat,
      text: "You are unsubscribed. I will not send anything on my own. Write any time.",
      override_optout: true, // lets this one confirmation through
    }),
  });
  return true; // handled: do not pass it to the model
}

// whasp lifts its block when the person writes again. Your flag lifts only on an explicit yes.
export const mayStartFollowUp = (chat: string) => hasFollowUpConsent(chat);
```

The first pattern matches only when the whole message is the request, so "stop it lol" or "stop by at five" go to your model. The second catches common phrases anywhere. For fewer misses, ask your model to classify short messages too and keep the patterns as a floor. Test with the languages your users write in.

## What should you record, and for how long?

Keep a small consent and opt-out log, because both the GDPR and the LGPD put the burden of proof on you. For each person, store:

- the phone number and your internal user id
- what they agreed to, the exact wording they saw, the version of your notice and the time
- when you told them they were talking to an AI
- each opt-out: the message id, the words and the time
- each deletion request and the date you completed it

whasp's servers keep no messages. WhatsApp keeps the chats on the number's phone, like any phone, and the phone and its data are wiped when the number ends. An inbound message reaches you once, in the `message.received` event, and files people send stay downloadable for 24 hours. History, retention and deletion are your system's job. Write a retention rule per kind of data, tell users in your notice, and run the deletion on schedule. [Conversation memory](https://whasp.ai/blog/whatsapp-ai-agent-memory) covers a schema with expiry, and [webhook handling](https://whasp.ai/blog/whatsapp-webhook-handling) covers receiving the events safely.

## What to do next

1. Add the opt-out handler above and test lowercase "stop", "please stop" and your users' languages.
2. Write your notice: who you are, what the agent does, that it is an AI, what you keep and for how long, and how to stop or delete.
3. Show the notice before the chat starts and say "AI" in the profile and the first message.
4. Log consent and opt-outs with times, and set a retention rule.

This article describes the texts of the laws and policies as of 19 October 2026. It is not legal advice; have a lawyer review your notice and your legal basis.

## Questions

### Do I need consent to run an AI chatbot on WhatsApp?

Not always. Under the GDPR consent is one of six legal bases, and answering a person who wrote to you for a service can rest on contract. You need explicit consent for special-category data such as health (Article 9(2)(a)), and a person can always object to direct marketing (Article 21(2)).

### What counts as an opt-out for a WhatsApp AI agent on whasp?

A message that is exactly STOP, UNSUBSCRIBE, OPTOUT, CANCEL, END or QUIT (uppercase), or any spelling of "opt out". Sends to that chat then return 403 chat_opted_out. Polite requests such as "please stop" are yours to catch.

### Does a WhatsApp AI agent have to say it is an AI?

In the EU, yes, unless it is obvious to a reasonably well-informed person: Article 50(1) of the AI Act applies since 2 August 2026. California and New York add duties for companion chatbots. Saying it in the profile and the first message is the simple habit.

### How long can I keep WhatsApp chat history?

No fixed period. The GDPR says to keep personal data no longer than necessary for the purpose (Article 5(1)(e)), and you must tell users the period or the criteria (Article 13(2)(a)). Set a retention rule, write it down and delete on schedule.

### Does whasp store my users' messages?

No. whasp passes messages through to your webhook or to WhatsApp. An inbound message reaches you once, in the message.received event, and files people send stay downloadable for 24 hours. Your system holds the history.
