Send Policy • AI Agent SDK

SendPolicy: A lightweight allow/deny send-policy with an optional default-deny posture.

SendPolicy

Defined in the protocols module.

AI Agent

A lightweight allow/deny send-policy with an optional default-deny posture.

This is the config-driven default referenced by `send_policy blocks in gateway.yaml and the Bot(..., send_policy=...) Python surface. It is intentionally minimal (no heavy dependencies) and lives in core so the built-in send_message` path is always interceptable.

Matching is exact against the symbolic target token (e.g. `"origin", "slack:#ops", or a friendly alias). With default="deny" only listed targets are permitted; with default="allow" all targets are permitted except those in deny`.

Example::

python
# default-deny: only the conversation origin and an ops alias allowed
SendPolicy(default="deny", allow=["origin", "ops-alerts"])
# default-allow: everything permitted except an exec channel
SendPolicy(default="allow", deny=["slack:#exec"])

Constructor

ParamField str

No description available.

ParamField Optional

No description available.

ParamField Optional

No description available.

Methods

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 4070