Connected-app event triggers

An optional triggers.toml lets an enabled agent react to supported events from an authorized Connection. The response always appears in a persistent Aleph conversation and can also be copied to Discord or Telegram.

[[deliveryTargets]]
id = "engineering-alerts"
description = "Issue triage reports"
required = true
allowedTypes = ["discord", "telegram"]

[[triggers]]
id = "github-new-issue"
connection = "github"
event = "GITHUB_ISSUE_ADDED_EVENT"
config = { owner = "{{vars.GITHUB_OWNER}}", repo = "{{vars.GITHUB_REPO}}" }
promptFile = "prompts/triage-github-issue.md"
deliverTo = { target = "engineering-alerts" }

Declare the Connection in connections.toml. Use exactly one of promptFile or inline markdown. Prompt files must be safe relative bundle paths. Configuration strings can use whole-value Vault secret or environment-variable references.

After cloning, authorize Connections, connect a Discord or Telegram bot, and open Triggers. Map each required logical target to an active binding and explicit destination, then enable the agent. Bundle files never contain credentials, binding IDs, provider account IDs, or channel IDs.

Use Test synthetic event to exercise the conversation and delivery path without creating a provider event. Reconcile retries subscription setup after you repair a Connection, configuration value, or mapping.

Events are signed, persisted, deduplicated, and treated as untrusted structured data. An event cannot approve a consequential external action. Agent history remains available when delivery fails, and delivery retries do not rerun a completed agent response.

Event turns currently receive the event payload, memory, files, sandbox, and research tools, but do not receive Connection action tools. This keeps automated runs read/draft-safe until durable per-action approval is available; continue in a user-authored chat turn to approve and execute a proposed external change.

Each accepted unique provider event consumes one trigger-event allowance and then incurs the normal usage of the resulting agent run. Duplicate webhook deliveries and channel-delivery retries are deduplicated and do not consume another event or turn. Synthetic tests use a normal agent turn but do not count as provider trigger events. Your plan also limits how many trigger subscriptions can remain active at once.