Skip to content

feat: add opt-in automated reply sending#45

Open
Buooy wants to merge 1 commit into
cloudflare:mainfrom
0xBuooy:feature/automated-reply-sending-config
Open

feat: add opt-in automated reply sending#45
Buooy wants to merge 1 commit into
cloudflare:mainfrom
0xBuooy:feature/automated-reply-sending-config

Conversation

@Buooy
Copy link
Copy Markdown

@Buooy Buooy commented May 18, 2026

Summary

Adds an opt-in configuration flag that allows the new-email automation flow to send verified replies automatically instead of only saving draft replies.

By default, behavior remains unchanged: inbound emails are read by the agent, and a draft reply is created for operator review. When AUTOMATED_SENDING_ENABLED is set to true, the same inbound automation flow sends the verified reply automatically.

Changes

  • Added new config AUTOMATED_SENDING_ENABLED to wrangler.jsonc, defaulting to false.
  • Updated the new-email handler to pass the automated sending setting into the agent tool setup.
  • Changed the draft_reply tool behavior only for the automated new-email workflow:
    • When disabled, it saves a draft as before.
    • When enabled, it sends the verified reply via toolSendReply.
  • Added an automation-specific system prompt note so the model understands that draft_reply sends in this workflow when the flag is enabled.
  • Updated fallback behavior for inline model responses:
    • Saves a draft when automated sending is disabled.
    • Sends a verified reply when automated sending is enabled.
  • Updated agent chat/status messages:
    • Created draft reply to ...
    • Sent automated reply to ...
  • Updated README documentation to clarify that explicit confirmation is required by default, and automated sending must be enabled via config.

Behavioral Changes

No change with the default config, inbound emails continue to produce draft replies only.

"AUTOMATED_SENDING_ENABLED": false

When enabled, the new-email automation flow sends verified replies automatically after the agent generates them.

  "AUTOMATED_SENDING_ENABLED": true

Introduce an AUTOMATED_SENDING_ENABLED Worker config flag for the new-email automation flow. The default remains draft-only, but when enabled the inbound email handler sends verified replies automatically instead of saving drafts.

Thread the flag through the agent tool setup, adapt the draft_reply tool behavior for the automated workflow, update chat/status messages for sent replies, and document the opt-in behavior in the README and Wrangler config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant