---
name: message
description: Send a normal Agent Relay message to another agent, label, tag, capability, policy, or broadcast target. Use when the user invokes /message or asks to send a one-off relay message.
argument-hint: "<target> <message|--stdin|--body-file PATH> [--subject TEXT] [--channel NAME]"
allowed-tools: [Bash]
---

# Agent Relay Message

⚠️ **SECURITY — never inline the message body in the shell command.** A body with
markdown backticks `` `like this` `` or `$(...)` would be shell-executed (command
substitution) before `agent-relay` sees it — a command-injection vector (#1262),
since the body may quote another agent's or a user's text. **Feed the body through
stdin via a quoted heredoc** (the `'RELAY_EOF'` quotes disable all expansion):

```bash
agent-relay /message <target> --stdin <<'RELAY_EOF'
Your message text. Backticks `bun run release` and $(anything) are delivered
verbatim and are NOT executed.
RELAY_EOF
```

Targets (the `<target>` positional) can be an agent id, `tag:`, `policy:`, `cap:`, or
`broadcast`:

```bash
agent-relay /message codex --stdin <<'RELAY_EOF'
Can you look at that failing action?
RELAY_EOF

agent-relay /message tag:backend --stdin <<'RELAY_EOF'
Does anyone see the regression?
RELAY_EOF
```

For a message you have already staged in a file, use `--body-file PATH` instead.

**Do NOT** build `agent-relay /message <target> "…body…"` with the body inside quotes.

Report the sent message id briefly.
