Skip to content

docs(agents): record the Slack output convention in the playbook - #8331

Merged
bokelley merged 1 commit into
mainfrom
docs/slack-output-convention
Oct 19, 2026
Merged

bokelley merged 1 commit into
mainfrom
docs/slack-output-convention

Conversation

@bokelley

@bokelley bokelley commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Split out of #8330 so a documentation review does not block a security fix. .agents/** is under a hard approval gate, and that PR closes #8320.

Why

#8320 was agent-controlled error text reaching a Slack DM title. The rule it violated — titles are fixed templates plus sanitized fields, untrusted free text goes in the body — existed only as a comment in compliance-heartbeat.ts, directly above the one branch that didn't follow it. When #8330 swept the rest of the repo it found the same shape in the registry and member-event builders, where member-supplied edit summaries, post titles and excerpts reached a moderator-trusted channel raw.

A convention that lives in one file's comment is how that happens. This writes it into .agents/playbook.md under Critical Rules, alongside the existing design-system and UI-casing entries.

What it says

  • Titles are fixed templates plus short sanitized identifiers; free text we did not author goes in the body.
  • A link target is not text — <url|label> can't be escaped, so check the target and drop the link when it fails.
  • Use the shared helpers in server/src/utils/slack-escape.ts rather than writing another local escaper, with a one-line description of each and when it applies.

Documents helpers introduced in #8330, so merge this after that one. No code changes.

🤖 Generated with Claude Code


Open workspace in Conductor

#8320 fixed agent-controlled text reaching a Slack DM title, and swept the
same pattern out of the registry and member-event builders. The rule it
enforces lived only as a comment in one file, which is how the sweep
became necessary. Write it down.

Documents the helpers added in #8330; merge after it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
bokelley added a commit that referenced this pull request Oct 19, 2026
`.agents/**` is under a hard approval gate, so keeping the playbook entry
here would block a security fix on a documentation review. The rule ships
separately in #8331; the behaviour it describes is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Escalate to human review

Escalate — gated path requires human/CODEOWNERS review.

This is a documentation-only change: one new section (41 net added lines) in .agents/playbook.md recording the Slack/notification output convention. The reviewer verified every load-bearing claim against #8330 (helper names/signatures and both behavioral claims match), and found no Medium-or-worse findings — the diff itself is clean.

However, gated_paths is true (.agents/playbook.md matches .agents/**) and review_decision is REVIEW_REQUIRED, not APPROVED. Per decision table row 2, this is a hard, non-overridable approval gate that cannot be satisfied by a clean diff alone.

Escalation reasons

  • Touches gated path .agents/playbook.md (matches .agents/**); requires explicit human/CODEOWNERS approval. review_decision is currently REVIEW_REQUIRED.

No blocking findings. Once a human/CODEOWNERS approval lands (review_decision: APPROVED), this clean diff would fall through to approve. Note the merge-ordering dependency: these helpers only exist after #8330 merges — already stated in the PR body.

Why human review

  • Touches gated path .agents/playbook.md (matches .agents/**) and review_decision is REVIEW_REQUIRED (not APPROVED) — requires explicit human/CODEOWNERS approval before merge.
  • This PR touches a path under a hard, non-overridable approval gate (.agents/playbook.md (modified) matches .agents/**) and the current GitHub review decision is 'REVIEW_REQUIRED', not APPROVED. This is a hard gate enforced in code — Ladon cannot auto-approve until a human/CODEOWNERS approval is recorded, regardless of how clean the diff is.

@aao-secretariat aao-secretariat Bot added the ladon/needs-human-review Ladon has escalated this PR for human review. label Oct 19, 2026
bokelley added a commit that referenced this pull request Oct 19, 2026
…ion titles (#8330)

* fix(notifications): keep agent-controlled text out of Slack notification titles

`notifyComplianceChange` built its Slack DM title by interpolating the
stored compliance `headline`. For an unreachable agent that headline is
`Unreachable: ${errorMessage}` — untruncated text derived from the agent's
own error response. Slack parses a DM's text as mrkdwn, so a hostile or
misbehaving agent could put `<!channel>`, a `<@U…>` mention, a forged
`<url|label>` link, a newline that fakes a line of platform copy, or ten
kilobytes of prose into the headline of a message the owner reads as ours.

Notification titles are now fixed templates plus short sanitized
identifiers, and text we did not author moves to a new `body` that is
flattened to one line, capped, and escaped per surface. The same pattern
was swept out of the registry and member-event builders, where member-
supplied edit summaries, post titles, excerpts and organization names were
reaching a moderator-trusted channel raw.

Closes #8320.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

* chore: move the Slack-output convention to its own PR

`.agents/**` is under a hard approval gate, so keeping the playbook entry
here would block a security fix on a documentation review. The rule ships
separately in #8331; the behaviour it describes is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

Copy link
Copy Markdown
Contributor Author

#8330 is merged (80a221684), so the helpers this documents are on main. All 30 checks pass here and the branch merges cleanly.

The only thing outstanding is the .agents/** hard approval gate — Ladon cannot auto-approve a gated path, so this needs a human/CODEOWNERS approval. Nothing to change on my side.

Copy link
Copy Markdown
Contributor Author

#8337 (the #8326 follow-up) adds a fifth helper to server/src/utils/slack-escape.ts, so the list in this PR wants one more bullet. Putting it here rather than in a PR against a section that isn't on main yet — and .agents/** is behind the CODEOWNERS gate, which is the reason this PR exists.

Suggested, after the sanitizeSlackLine bullet:

  - `sanitizeSlackLiteral(raw, max)` — `sanitizeSlackLine` plus a
    zero-width space through the inline formatting tokens and through a
    bare URL's `//`. Slack auto-links a bare `https://…` even with no
    mrkdwn syntax around it, so an org renamed to
    `Acme https://evil.example Co` is still a clickable attacker
    destination. Use it where the value is a name or label that has no
    business carrying formatting or a link at all.

Context: addie/jobs/announcement-trigger.ts was the only one of the five pre-existing local escapers that defused bare-URL auto-linking, and sanitizeSlackLine deliberately doesn't. Rather than let that regress during the sweep, the stricter form moved into the shared module.

@bokelley
bokelley merged commit ab9587c into main Oct 19, 2026
33 checks passed
@bokelley
bokelley deleted the docs/slack-output-convention branch October 19, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ladon/needs-human-review Ladon has escalated this PR for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slack DM titles interpolate unsanitized agent-controlled error text

1 participant