Skip to content

Add the @submilli/zendesk curated Package (SUB-2439) - #452

Merged
somdoron merged 4 commits into
mainfrom
shmuellamm/zendesk-package
Nov 23, 2026
Merged

somdoron merged 4 commits into
mainfrom
shmuellamm/zendesk-package

Conversation

@snlamm

@snlamm snlamm commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

Support agents need to work in Zendesk under fine-grained permission rules: triage and update tickets, add internal notes, reply to customers, assign and merge tickets, apply macros, look up people, and read the Help Center. A blueprint should be able to grant each of these by operation and by group, assignee, requester or status, without granting raw HTTP to the account. It should also be able to keep public replies, which email the customer, behind a person's approval.

Solution

A curated Package, @submilli/zendesk, with 31 capabilities (zendesk.com/<area>.<op>):

  • Tickets: get, find, count, create, update, assign, merge, metrics.
  • Conversation: list comments, add a note, reply, upload attachments.
  • People and organizations.
  • Views and macros: preview and apply.
  • Metadata.
  • Help Center: read and search.
  • Reporting.

How the checks are built:

  • Facts are looked up. A check's group, organization, brand, assignee, requester and status are read from Zendesk, never taken from the caller.
  • A public comment is always a reply. It is checked as comments.reply wherever it comes from: reply, a public first comment on a new ticket, a macro's comment, or a public merge.
  • Moving a ticket has its own capability. updateTicket can't change the group or assignee. Only assignTicket can, and its check sees both where the ticket is and where it goes.
  • Ticket writes are conditional. They use safe_update with the updated_at read for the check, so a ticket changed in between is refused with 409 UpdateConflict. Merges are the exception, because Zendesk's merge has no condition; the readme says so.
  • The account is a build setting. Its URL is the required --config accountUrl=…, so the package's HTTP grants name the exact host.
  • Credentials: the only credential is an OAuth bearer token, ZENDESK_ACCESS_TOKEN. API tokens are not accepted: they can act as any user, never expire and have no scopes.

The design and the decisions behind it are in plans/zendesk-package.md, including what the live tests and the review found.

Outside the package:

  • package_policy.rs: the Salesforce fake-host test's package copy is shared, and a fake-Zendesk test is added.
  • The package is registered in submilli.toml, packages/README.md, the curated-packages reference, the doc-example test, and the CI and Render workflows. The workflows install it with an example account URL.

Verification

  • Offline and contract tests.
    • Offline tests pass (12).
    • scripts/contract.test.mjs asserts the exact requests and check contexts (24).
    • The Rust package-policy tests pass (7), including the fake-Zendesk test. It shows that facts read from Zendesk reach the checks and that denied writes never reach the fake.
  • Live tests against a real Zendesk account cover reads and writes, including a Help Center article. Every run cleans up after itself, apart from a seed ticket kept for the read tests. They found four Zendesk behaviors, now handled:
    • The active-views endpoint can't page with a cursor.
    • A single-ticket update ignores additional_tags and remove_tags.
    • A macro preview gives public as text, not a boolean.
    • Bulk ticket deletion runs as a background job.
  • Through a local Submilli Agents node built from main:
    • The token came from OAuth: authorization code with PKCE.
    • Turn 1 read, created, noted and updated tickets. The policy denied a public reply, and nothing reached Zendesk.
    • Turn 2 ran after the 30-minute token expired. The node refreshed the token and the turn's writes succeeded.

🤖 Generated with Claude Code

https://claude.ai/code/session_014d2Juedc7zHFDRspcgcBcQ

snlamm and others added 4 commits November 22, 2026 18:09
A typed Zendesk Support client: tickets, public replies and internal notes,
attachments, users, organizations, groups, views, macros, Help Center
articles, satisfaction ratings and ticket metrics. The account URL is a
required build setting, so grants name its host. Every operation is
checked with facts read from Zendesk (a ticket's group, organization,
brand, assignee, requester and status); public replies are their own
capability; ticket writes send safe_update so a ticket changed since the
check is refused.

Offline, policy, fake-host and contract tests; live tests written but not
yet run (no account yet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d2Juedc7zHFDRspcgcBcQ
listViews pages through views.json?active=true, since views/active.json
pages by number only. updateTicket writes addTags/removeTags as the
whole tag list under safe_update, since Zendesk ignores additional_tags
and remove_tags on a single ticket. Macro previews give a comment's
visibility as text. The write tests also cover a Help Center article,
and clean up tickets one at a time; the read tests use a seed ticket.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d2Juedc7zHFDRspcgcBcQ
- A public merge is also checked as comments.reply for the target and
  each source, since it emails every requester.
- findTickets and countTickets take one tag: Zendesk's search matches
  repeated tag terms as any of them (checked live).
- assignTicket with an agent alone sends the ticket's current group, so
  Zendesk refuses an agent outside it instead of moving the ticket.
- applyMacro refuses a macro that changes what it cannot write (CCs,
  followers, the form) rather than applying it in part.
- The reply check of a new ticket with an assignee sees "open"; a macro
  that leaves the status sees the ticket's own.
- The live people search uses the seed customer, not whoever a wildcard
  search lists first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014d2Juedc7zHFDRspcgcBcQ
@snlamm
snlamm requested a review from somdoron November 23, 2026 12:04
@somdoron
somdoron added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 70e4a07 Nov 23, 2026
7 checks passed
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.

2 participants