What this example demonstrates
- Verify each incoming support message in your service, then send it to the one Session you keep for that ticket conversation. Your service owns the ticket-to-Session map.
- Project the Session event log into the support UI instead of maintaining a second transcript.
- Expose ticket functions as Custom tools declared on the Agent. ActionPolicy chooses
allow,require_approval, ordenyfor each call, and a required ActionApproval records the exact human decision on the frozen call. - Run the handler in the support application. Approval is not execution: an approved call still waits until the application checks its own tenant, account, and ticket access, runs the handler, and returns the correlated result. A call for a ticket the caller cannot reach is refused there, by the application.
- Keep connected tools on their own path. A tool that acts through a Connection (for example, sending email through a provider account) is checked against governed account access, policy, and any required approval, and executes inside Checkfu’s trusted provider boundary rather than in the support application.
- Deliver accepted Session output downstream from your service. Provider acknowledgement is not Checkfu custody, and provider redelivery is not a new Agent turn unless the message key is new.
Retention, erasure, and support boundaries
Standard retention may preserve permitted support messages, tool content, and Session events under policy. Under ZDR, admitted execution can stream only through eligible live custody and is not durably retained, so later transcript replay and content recovery are unavailable. A production erasure claim is valid only when every governed sink and in-flight export is fenced before completion. Permitted non-content Audit and Usage facts may remain identifiable or pseudonymous; see retention and ZDR for their separate retention boundaries. Usage, not UI analytics or traces, drives Budgets. A provider adapter, deterministic fixture, or successful local demo does not establish production support. The exact provider and deployment must qualify restart recovery, revocation, and erasure. Consult capability status for those gates and for the custom-tool, approval, Connection, and execution prerequisites.Pinned source boundary
The optional source builds tool declarations from the same application functions as the human routes. ItsneedsActionApproval field is the SDK declaration that tools.sync reconciles into a governed ActionPolicy requiring approval; the field is not itself approval authority. The handler’s ticket_scope_mismatch result is the application-side access check: it runs after any approval, so an approved call for the wrong ticket still does nothing.
path=examples/support-desk/server/src/agent-tools.ts