Skip to content

Exposures

Exposures declare where an agent's response is delivered (Slack, Jira, Confluence, a local file, a GitHub PR comment, or a custom dispatcher). They live under exposures/*.yaml (see paths.exposures in abt.yaml).

Interactive abt run -s <agent> prints to the terminal and does not fetch sources or fire exposures. Use abt dispatch -s <workflow> to run a workflow from workflows/ (its full steps:/edges: node graph) and actually fire sources and exposures.

Exposures are workflow sink nodes

An exposure dispatches as a node in a workflow's edges:, wired directly after the agent whose result it delivers — agents have no exposures: frontmatter field. An exposure node is a sink: it may only route into another exposure (chaining multiple deliveries off one result) or END, never back into an agent's turn. Each run delivers one predecessor's result to an exposure. If two predecessors both finish for the same invocation, the run fails with E_WORKFLOW_EXPOSURE_FAN_IN. Mutually exclusive branches (for example a when: route) may share one exposure sink.

A workflow like this, where daily-digest is an agent and slack_digest_post an exposure under exposures/:

# workflows/daily_digest.yaml
edges:
  - [START, daily-digest]
  - [daily-digest, slack_digest_post]
  - [slack_digest_post, END]

An exposure's own exposures/*.yaml file holds name/type/credentials/config:

# exposures/slack_digest_post.yaml
name: slack_digest_post
type: slack
credentials: slack
config:
  channel_id: C0EXAMPLE02

Save this as agents/daily-digest.md:

---
description: Writes the daily digest
---
Write a short, upbeat digest of what you are given.

abt compile and abt graph daily_digest run without Slack credentials. Delivery needs a slack entry in profiles.yaml. A source and a prompt can sit ahead of the agent, as in Sources — workflow nodes.

Compile checks reachability: every catalog exposure (unless adhoc_only: true) must appear as an exposure-kind node in at least one workflow's edges: (or be CLI-only by design, via adhoc_only: true or --expose type:value). An exposure file that is neither wired nor adhoc_only fails compile:

ERROR: Exposure 'run_log' is unreachable: wire it into a workflow's edges as an exposure sink node ([<agent>, <exposure>], [<exposure>, END]), or set adhoc_only: true for CLI-only dispatch.

The exposure files further down this page show only the file's own fields. To compile one on its own, add adhoc_only: true and give each {{ var('x') }} in its config: a value or a default (see Directory and schema); otherwise wire it into a workflow as above.

⚠️ Exposure timing — fires on node completion, not final success

Exposures fire per executed node, against that node's own result, the moment that node finishes successfully — not retrospectively when the whole run finishes. If close-ticket's branch refund runs and fires refund_api, but close-ticket itself then crashes, refund_api has already fired and cannot be un-fired — only close-ticket's own exposure (e.g. ticket_writeback) is skipped. There is no rollback and no transaction: position in the graph is the only guarantee you get.

Expose only on full-story success? Put the exposure on the terminal reconvergence node — the entrypoint that every branch feeds into — never on a mid-chain branch. A branch leaf's exposure (e.g. refund's refund_api) is correct when that branch's own side effect should happen regardless of what runs after it; an all-or-nothing side effect (e.g. close-ticket's ticket_writeback) belongs on the node nothing else depends on.

Worked example, a ticket workflow where triage routes to a refund or escalation branch. It shows the edges only: every node is an ordinary source, agent or exposure file, and triage with its agents is defined in Workflows.

# workflows/support_ticket.yaml
edges:
  - [START, ticket]                 # source
  - [ticket, triage]
  - from: triage
    when: "{{ output.route }}"
    cases: { refund: refund, escalate: escalate }
    default: escalate
  - [refund, refund_api]            # branch-leaf exposure: fires as soon as refund succeeds
  - [refund_api, END]
  - [refund, close-ticket]
  - [escalate, close-ticket]
  - [close-ticket, ticket_writeback] # terminal exposure: fires only after close-ticket succeeds
  - [ticket_writeback, END]

If refund succeeds, refund_api fires right away, before close-ticket starts. If close-ticket then fails, ticket_writeback never fires, but refund_api has already run and cannot be undone.

YAML quoting for {{ var(...) }}

In exposure YAML (and Sources catalog YAML — on-disk sources/, whose own config: block is templated with {{ var('name') }}), values that contain Jinja {{ ... }} should be written as double-quoted strings.

Reason: in YAML, { starts a flow mapping. Unquoted {{ var('channel_id') }} can be parsed incorrectly or fail. Prefer:

config:
  channel_id: "{{ var('channel_id') }}"
  thread_ts: "{{ var('thread_ts', '') }}"

Single-quoted YAML works but requires doubling inner quotes ('{{ var(''channel_id'') }}'), so double quotes are usually simpler.

Directory and schema

# exposures/slack_reply.yaml
name: slack_reply
description: Post agent reply back to a Slack thread
type: slack
credentials: slack
tags:
  - slack
config:
  channel_id: "{{ var('channel_id') }}"
  thread_ts: "{{ var('thread_ts', '') }}"
freshness:
  on_missing_vars: error
  on_missing_credentials: error
Field Required Meaning
name Yes Exposure id
type Yes Dispatcher type — see Built-in dispatchers below
credentials No Credentials namespace in profiles.yaml (often defaults to type); omit for local
config No Dispatcher-specific config; use {{ var('x') }} for runtime vars
description No Human-readable summary
tags No Tags for docs / filtering
freshness No on_missing_vars, on_missing_credentials (skip / warn / error)
adhoc_only No If true, compile does not require it to appear as an exposure node in any workflow's edges: (CLI / ad-hoc only).

A {{ var('x') }} in config: with no default needs a value at compile time, not only at dispatch: abt compile, abt list, and abt run -s <agent> or abt dispatch -s <workflow> fail with Missing required template variable(s) 'x' — define them in vars.yaml, under vars: in abt.yaml, or pass --vars (YAML/JSON dict) until it is defined (see Sources). Use {{ var('x', 'default') }} for values that may be absent.

Compile does not check the config: keys of a dispatcher: a missing channel_id, path or to, or an unknown type, still compiles. Check them against the tables below.

Dispatch

Dispatchers are registered under abt.exposure_dispatchers in pyproject.toml. At runtime, abt dispatch (or the SDK equivalent) resolves each exposure-kind workflow node reached during that run and calls its dispatcher with the rendered config and its predecessor's result.

To run a workflow without delivering anything, add --skip-exposures:

abt dispatch -s daily_digest --skip-exposures

The agents still run for real, so this calls your model. Sources still fetch live unless you stub them with --mock-sources or skip them with --skip-sources. Each exposure node passes its predecessor's result along and sends nothing, and an ad-hoc --expose route is skipped. Lifecycle handlers do not fire either, and the result prints to the terminal.

--exposure-plan also runs the agents for real. It prints one [exposure-plan] <agent> -> <exposure> line per exposure instead of delivering it. Lifecycle handlers still fire.

To check the wiring without calling a model, run abt graph <workflow>. It lists every exposure node in the flow.


Built-in dispatchers

Type Extra required Credentials ns Ad-hoc shorthand
slack abt-core[slack] slack --expose slack:CHANNEL_ID
jira abt-core[jira] atlassian --expose jira:ISSUE_KEY
confluence abt-core[confluence] atlassian --expose confluence:PAGE_ID
github_pr_comment (stdlib only) github --expose github_pr_comment:OWNER/REPO#PR
local (stdlib only) (none) --expose local:/path/to/file
email (stdlib only) email --expose email:someone@example.com

Ad-hoc shortcuts (--expose type:value) bypass the catalog and are useful for quick one-off routing without creating a YAML file. webhook is also accepted by the shorthand parser (see below), but abt ships no dispatcher for it — you have to register your own.


slack

Post the agent output to a Slack channel or thread.

name: slack_reply
type: slack
credentials: slack
config:
  channel_id: "{{ var('channel_id') }}"
  thread_ts: "{{ var('thread_ts', '') }}"   # omit or leave blank for a new top-level message
Config key Required Meaning
channel_id Yes Slack channel ID (e.g. C01234567)
thread_ts No Thread timestamp. When set, replies in-thread; otherwise posts as a new message.
require_thread_ts No Default false. Set true for a reply-only workflow whose thread_ts is meant to come from the triggering event (e.g. {{ event.thread_id }}): if it resolves blank, the dispatcher raises instead of silently posting an orphaned, unthreaded message. Leave off for workflows that intentionally start a fresh top-level post (e.g. a digest).
attach_path No Local file path (image, PDF, ...) to upload alongside the reply instead of posting plain text. If templated (e.g. from an agent that only sometimes writes a report) and the file doesn't exist, falls back to a plain text post instead of failing. Needs the files:write bot scope.

Credentials (profiles.yaml key slack): bot_token.


jira

Append the agent output as a comment on an existing Jira issue.

name: jira_comment
type: jira
credentials: atlassian
config:
  issue_key: "{{ var('issue_key') }}"
Config key Required Meaning
issue_key Yes Jira issue key, e.g. DATA-123

Credentials (profiles.yaml key atlassian): url, username/email, api_token.


github_pr_comment

Post the agent output as a comment on a GitHub pull request. No optional extra required (uses stdlib urllib).

name: github_pr_comment
type: github_pr_comment
credentials: github
config:
  repo: "{{ var('repo') }}"
  pr_number: "{{ var('pr_number') }}"
Config key Required Meaning
repo Yes Repository as owner/name, e.g. octocat/Hello-World
pr_number Yes Pull request number (integer)

Credentials (profiles.yaml key github): token (a GitHub personal access token or fine-grained token with issues:write scope — needed because PR comments use the Issues API).

Ad-hoc github_pr_comment dispatch

# Post a comment on PR #42 without a catalog YAML file
abt dispatch -s my_workflow --expose github_pr_comment:owner/repo#42

confluence

Write the agent output to a Confluence page (Confluence Cloud only). Supports two operating modes.

Install the extra first:

uv pip install 'abt-core[confluence]'

Credentials (profiles.yaml key atlassian): url, username/email, api_token — shared with the jira dispatcher and the confluence_search retriever.

Mode A — update by page ID

Fetch an existing page by its numeric ID and overwrite its body. The page must already exist.

name: publish_report
type: confluence
credentials: atlassian
config:
  page_id: "123456789"
  # title: "Override title"   # optional; keeps current title when omitted
  representation: storage      # storage (default, XHTML) or wiki
  minor_edit: true             # suppress watcher notifications
Config key Required Meaning
page_id Yes Numeric Confluence page ID
title No Override the page title; keeps the existing title when omitted
representation No storage (default) or wiki. See below.
minor_edit No true/false (default false). When true, no history entry is created and watchers are not notified.
write_mode No overwrite (default) replaces the body. append fetches the existing body and adds the new content after a <hr/> separator — requires representation: storage.

Mode B — upsert by title

Look up a page by title within a space. Creates the page if it does not exist; updates it if it does. Optionally places it under a parent page (or creates the whole ancestor chain).

name: publish_report_upsert
type: confluence
credentials: atlassian
config:
  space_key: "MOCK"
  title: "{{ var('report_title', 'Weekly Agent Report') }}"
  parent_path: "Data Platform/Analytics"   # slash-separated ancestor chain
  create_parents: false                    # set true to auto-create missing parents
  representation: storage
  minor_edit: false
freshness:
  on_missing_vars: error
  on_missing_credentials: error
Config key Required Meaning
space_key Yes Confluence space key, e.g. DA
title Yes Page title used for lookup and creation
parent_path No Slash-separated ancestor chain from the space root, e.g. "Data Platform" or "Data Platform/Analytics". Each segment is resolved left-to-right.
create_parents No true/false (default false). When true, missing pages in parent_path are auto-created as empty placeholders.
representation No storage (default) or wiki. See below.
minor_edit No true/false (default false).
write_mode No overwrite (default) or append (requires representation: storage). Same as Mode A.
on_existing No overwrite (default) updates a page that already exists at title. fail raises instead, so an automated run never silently overwrites a page it didn't create.

Representation formats

Value When to use
storage (default) Plain-text / Markdown output from the agent. abt HTML-escapes the content and wraps it in <pre> so whitespace and newlines are preserved exactly. Best choice for most LLM outputs.
wiki Confluence Wiki Markup. Use when your agent intentionally generates Confluence markup syntax. No escaping is applied.

Ad-hoc confluence dispatch

# Update page 123456789 without a catalog YAML file
abt dispatch -s my_workflow --expose confluence:123456789

This uses Mode A. For Mode B (upsert by title), define a catalog YAML file and wire it into a workflow as an exposure sink node.


local

Write the agent output to a local file. No credentials required.

name: local_output
type: local
config:
  path: "{{ var('output_path', 'target/output/report.md') }}"
  mode: overwrite    # overwrite (default) or append
  makedirs: true     # auto-create parent directories (default true)
freshness:
  on_missing_vars: error
Config key Required Meaning
path Yes Destination file path — absolute, or relative to the current working directory. Supports Jinja {{ var('…') }} templating.
mode No overwrite (default) — replaces the file on every run. append — adds a --- separator between runs, then appends the new output. No separator is added if the file is empty or does not yet exist.
makedirs No true (default) — create missing parent directories automatically. false — raise an error if the parent directory does not exist.

Relative paths resolve from the working directory when abt dispatch is invoked.

Run abt dispatch from the project root (where abt.yaml lives), or use an absolute path / var-controlled path, to ensure consistent output locations.

Ad-hoc local dispatch

# Write the output to /tmp/debug.md without a catalog YAML file
abt dispatch -s my_workflow --expose local:/tmp/debug.md

Append mode example

append is useful when you want to accumulate outputs across runs — for example, a daily log:

name: run_log
type: local
config:
  path: "target/run_log.md"
  mode: append

Each successful run appends:

<previous content>
---
<new agent output>

email

Send the agent output as an email via SMTP (stdlib smtplib, no extra required).

name: email_report
type: email
credentials: email
config:
  to: "{{ var('recipient_email') }}"
  cc: ""                                  # optional, comma/semicolon-separated
  bcc: ""                                 # optional, comma/semicolon-separated
  subject: "Weekly data platform report"  # optional — see default below
  content_type: plain                     # optional: plain (default) or html
Config key Required Meaning
to Yes Recipient address(es) — comma/semicolon-separated string. Supports {{ var(...) }}. A literal YAML list of static addresses also works, but list items are not Jinja-rendered.
cc / bcc No Same format as to. bcc recipients receive the message but are never added to a header.
subject No Defaults to [abt] Agent run succeeded / [abt] Agent run failed based on the run result.
content_type No plain (default) or html. Content is sent as-is — abt does not render Markdown to HTML.

Credentials (profiles.yaml key email):

Field Required Meaning
host Yes SMTP server hostname.
from_address Yes Envelope/From address.
port No Default 587 (or 465 when use_ssl: true).
username / password No Omit both for an unauthenticated relay; set both or neither. Login requires use_tls or use_ssl, otherwise abt refuses to send.
use_tls No Default true — STARTTLS.
use_ssl No Default false — implicit TLS (SMTPS). Mutually exclusive with use_tls.
timeout_seconds No Default 30.

Both TLS modes verify the server certificate and that it matches host, against the system trust store. A relay with a self-signed or internal-CA certificate must have that CA installed in the system store (or SSL_CERT_FILE set); there is no switch to skip verification. With use_tls: false and use_ssl: false the message is sent in clear text, so abt refuses to send when username/password are set; only an unauthenticated relay (no username/password) may run unencrypted.

# profiles.yaml
default:
  target: dev
  outputs:
    dev:
      credentials:
        email:
          host: smtp.example.com
          from_address: reports@your-domain.com
          username: "{{ env_var('SMTP_USERNAME', '') }}"
          password: "{{ env_var('SMTP_PASSWORD', '') }}"

Ad-hoc email dispatch

abt dispatch -s my_workflow --expose email:someone@example.com

There is no inline subject syntax for ad-hoc dispatch — use a catalog YAML file if you need a custom subject.

Other backends (SES, SendGrid, …)

abt ships SMTP only. For a provider-API-based sender (for example AWS SES through boto3), register your own dispatcher for a distinct type, e.g. type: email_ses — see Custom dispatchers below.


webhook

Not a built-in dispatcher: abt does not ship a webhook sender. --expose webhook:https://… and type: webhook in catalog YAML are recognized by the CLI parser and schema, but abt dispatch raises No exposure dispatcher registered for type 'webhook' unless your project registers one.

To make it work, register a dispatcher for type webhook — see Custom dispatchers below — that reads config["url"] and POSTs the agent output there. Once registered, both the catalog YAML and the ad-hoc shorthand shown below resolve to it:

name: notify_webhook
type: webhook
config:
  url: "{{ var('webhook_url') }}"
Config key Required Meaning
url Yes HTTP(S) URL to POST the payload to (only meaningful once you supply a webhook dispatcher)

Custom dispatchers

Register a project-local dispatcher via a Python entry point or the providers/ directory. abt calls it with three keyword arguments each time an exposure node with that type: fires:

Argument Type Contents
result RunResult The predecessor's result. Use result.text (the answer), result.ok, result.error, result.warning, result.footnote, result.structured (parsed output_schema value, or None), and result.agent_name.
config dict The exposure's config: after {{ var() }} rendering.
credentials dict[str, str] The profiles.yaml namespace named by credentials:, for example credentials.my_api for credentials: my_api. Empty for type: local.
# providers/my_output.py
from abt.exposures.dispatcher import exposure_dispatcher

@exposure_dispatcher("my_custom_exposure")
def my_dispatcher(*, result, config, credentials):
    print(config.get("label", ""), result.text, credentials.get("token", ""))
# exposures/my_output.yaml
name: my_output
type: my_custom_exposure
credentials: my_api
config:
  label: "{{ var('label', 'digest') }}"

A class with a send(*, result, config, credentials) method works too. Decorate the instance, not the class itself: a bare class also passes the hasattr(cls, "send") check but crashes at call time, because it is called without self:

class MyDispatcher:
    def send(self, *, result, config, credentials):
        ...

my_dispatcher = exposure_dispatcher("my_custom_exposure")(MyDispatcher())

Then reference it in any exposure YAML with type: my_custom_exposure. See Using the SDK for the full provider pattern.