> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Bot Intentional Silence

> Let agents stay silent in group chats by returning NO_REPLY

<Note>
  Bot platform adapters now ship in the `praisonai-bot` package. `praisonai bot serve` still works exactly as documented here; for a standalone install see [praisonai-bot Migration](/docs/guides/praisonai-bot-migration).
</Note>

With `allow_silence: true`, an agent can return `NO_REPLY` (or a custom token) to send nothing — no message, no typing indicator, no error.

<Note>
  Both `NO_REPLY` (this page) and `BotLoopGuard` live in `praisonaiagents/bots/silence.py`. Where `NO_REPLY` lets an *agent* opt out of a single reply, [`BotLoopGuard`](/docs/features/bot-loop-protection) lets the *gateway* opt out of an entire runaway bot-to-bot exchange.
</Note>

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import Agent

agent = Agent(name="group-bot", instructions="Reply in group chats only when helpful.")
agent.start("Should I respond to this off-topic message?")
```

The user posts in a group chat; with `allow_silence: true`, the agent can return `NO_REPLY` so nothing is sent.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Msg[📨 Group message] --> Policy[group_policy gate]
    Policy --> Agent[🤖 Agent]
    Agent -->|NO_REPLY| Silent[🔇 No outbound message]
    Agent -->|Normal text| Reply[💬 Reply sent]

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Msg,Reply agent
    class Policy,Agent,Silent tool

```

## Quick Start

<Steps>
  <Step title="YAML">
    ```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    channels:
      telegram:
        token: ${TELEGRAM_BOT_TOKEN}
        group_policy: respond_all
        allow_silence: true
    ```
  </Step>

  <Step title="Python">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    from praisonai.bots import Bot
    from praisonaiagents import Agent

    agent = Agent(
        name="Group Helper",
        instructions="Reply only when asked a direct question. Otherwise return exactly NO_REPLY.",
    )
    bot = Bot("telegram", agent=agent, allow_silence=True)
    bot.run()
    ```
  </Step>
</Steps>

***

## How It Works

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Bot
    participant Agent

    User->>Bot: ambient group message
    Bot->>Agent: forward (after group_policy)
    Agent-->>Bot: NO_REPLY
    Note over Bot: allow_silence=true → send nothing
```

| Marker                       | Honoured when `allow_silence=true` |
| ---------------------------- | ---------------------------------- |
| `NO_REPLY`                   | ✅ default token                    |
| `[SILENT]`                   | ✅                                  |
| `SILENT`                     | ✅                                  |
| Custom `silence_token`       | ✅ exact match only                 |
| Prose containing "NO\_REPLY" | ❌ not treated as silence           |

***

## Configuration

| Field           | Type   | Default | Description                                                        |
| --------------- | ------ | ------- | ------------------------------------------------------------------ |
| `allow_silence` | `bool` | `false` | Honour silence markers (opt-in)                                    |
| `silence_token` | `str`  | `None`  | Override marker; when set, only this exact string triggers silence |

Combine with `group_policy: respond_all` so the agent *may* respond, then chooses silence via `NO_REPLY`.

***

## Best Practices

<AccordionGroup>
  <Accordion title="Opt in explicitly">
    `allow_silence` defaults to `false` — existing bots behave unchanged.
  </Accordion>

  <Accordion title="Teach the agent the contract">
    Instructions should say when to return exactly `NO_REPLY` vs a normal reply.
  </Accordion>

  <Accordion title="Use for ambient group channels">
    Reduces noise when the bot listens to everything but should rarely speak.
  </Accordion>
</AccordionGroup>

***

## Related

<CardGroup cols={2}>
  <Card title="Bot Loop Protection" icon="rotate" href="/docs/features/bot-loop-protection">
    Break runaway bot-to-bot reply loops
  </Card>

  <Card title="Gateway" icon="server" href="/docs/features/gateway">
    Channel configuration reference
  </Card>

  <Card title="Messaging Bots" icon="comments" href="/docs/features/messaging-bots">
    Multi-platform bot setup
  </Card>

  <Card title="Bot Loop Protection" icon="shield-halved" href="/docs/features/bot-loop-protection">
    Break runaway bot-to-bot reply loops with a sliding-window pair budget
  </Card>
</CardGroup>
