---
title: "Send personal messages only to the · Agent Wranglers"
url: https://agentwranglers.se/playbook/notifications/native-push/personal-push-to-devices
id: NTF-20
level: Required
applies: accounts
risk: data
updated: 2026-10-21
build: a2a6bdfed830
tokens: 828
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Send personal messages only to the person's devices

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Native push](https://agentwranglers.se/playbook/notifications/native-push.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: NTF-20
- Level: Required
- Chapter: [Native push](https://agentwranglers.se/playbook/notifications/native-push.md)
- Rule: Send a broadcast topic only what anyone may read. Every message about one person goes to that person's own device tokens.
- Check: A unit test runs every catalogue type through the send code. No personal type produces a topic or condition target. A grep finds no topic name built from a user, order or account ID.
- Risk: Data leaked or lost
- Applies when: The project has user accounts.
- How: In Firebase Cloud Messaging, client apps can subscribe to any existing topic. So anyone who guesses a topic named after a user or an order can read it. Firebase calls topics best suited for publicly available information, such as weather alerts. Mark each catalogue type `public` or `personal`, and let only public types use a topic send. Keep the payload itself small as [Send only what the message needs](https://agentwranglers.se/playbook/email/email-privacy/email-data-minimisation.md) asks.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
export function fcmTarget(type, recipient) {
  if (type.audience === 'public') return { topic: type.topic };
  if (!recipient?.token) throw new Error(`Personal type ${type.id} needs a device token`);
  return { token: recipient.token };
}
```

### Python example

```python
def fcm_target(kind, recipient=None) -> dict:
    if kind.audience == "public":
        return {"topic": kind.topic}
    if recipient is None or not recipient.token:
        raise ValueError(f"Personal type {kind.id} needs a device token")
    return {"token": recipient.token}
```

## Sources

- [Firebase, Topic messaging](https://firebase.google.com/docs/cloud-messaging/topic-messaging)
- [Firebase, Manage topic subscriptions](https://firebase.google.com/docs/cloud-messaging/manage-topic-subscriptions)

## Related rules

- EML-52 [Send only what the message needs](https://agentwranglers.se/playbook/email/email-privacy/email-data-minimisation.md) in Email

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/notifications/native-push/personal-push-to-devices">Agent Wranglers notifications playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Use the current APNs and FCM interfaces](https://agentwranglers.se/playbook/notifications/native-push/apns-fcm-current-apis.md)
- Next: [Match each type to the platform's alert level](https://agentwranglers.se/playbook/notifications/native-push/push-interruption-levels.md)
- [Native push](https://agentwranglers.se/playbook/notifications/native-push.md)
