Conversation analytics
The conversation-categories example: protected input, duplicate-ID validation, permitted counts, recipient verification and publication policy.
Example · Conversation analytics
An Analytics agent requests category counts from an approved batch of 1,000 private conversations. The approved function, conversation-categories version 1, processes batch-042 inside Standard’s protected runtime. The Analytics integration verifies the permitted result before making the counts available to the agent. The reporting workflow applies its own publication policy.
These figures are examples, not a retained execution. The classifier and any model it uses must execute inside the protected runtime. An external model API would be a separate recipient outside that boundary.
Function and source
Download the JavaScript reference function. It contains the classifier and duplicate-ID check used by the example tests. It is executable reference logic, not a deployed or Wasm-packaged workload. Adapt and build it for the supported Wasm interface, test the resulting artifact, and approve its exact revision and output contract before protected execution.
The reference uses simple keyword rules with this priority: Coding, Writing, Research, then Other. Coding matches code, coding, debug or programming; Writing matches write, writing, edit or draft; Research matches research, study, analyze or sources. Matching ignores case and uses word boundaries. These rules explain the reference, not classification accuracy. Your team defines suitable categories, logic and any compatible model.
The function has no remote model calls or other I/O. The protected Wasm function receives declared inputs and outputs under enforced execution limits; it has no general shell, filesystem, subprocess or network interface.
Protected input
The owner approves the connected source, selected resource, version and required data bindings. Confidential ingress retrieves the authorized batch and applies the required digest and size checks before passing it to the classifier. The Analytics agent passes the approved source reference; raw conversations and source credentials are not supplied to its environment.
The following two synthetic records show the input format only. They are not the 1,000-conversation batch behind the example counts.
{
"conversations": [
{ "id": "conversation-001", "text": "Help debug this code." },
{ "id": "conversation-002", "text": "Help draft a letter." }
]
}The reference accepts at most 1,000 records. IDs must be nonempty strings of at most 128 characters, and text must be a string of at most 8,192 characters. IDs must be unique by exact string equality. These are example workload checks; runtime byte and resource limits are configured separately.
Validate before classifying
The function validates the complete batch before counting any category. A repeated conversation ID produces this permitted failure report, without partial counts or conversation contents: