Skip to main content

Message processing

An observer reads approved message information without changing it. A transform changes an outgoing message or an assistant response. Reading content and changing it require separate user permissions.

Conversation Insights and Prompt Redactor are Preview examples. Their source and development tests are available, but integration with the app's normal conversation requests and permission changes has not been tested.

When the extension runs What it can do Permission needed
A message is saved Read approved metadata for analytics. Reading text or attachments requires message-content access.
Before a message is sent to the provider Change outgoing input. Outgoing-input transform permission.
The provider finishes Read approved result and usage fields. Reading response content requires content access.
Before the assistant response is displayed Change the response while keeping the original. Assistant-output transform permission.

Order and failures

Processing stages run in a defined order and have a timeout, cancellation support and a size limit. Optional analytics can fail without stopping a model request. If the user requires redaction and that transform fails, the message must not be sent.

Keep the original transcript. Record which extension changed a message, its version, the stage, the time and a readable explanation of the change. A transform cannot change the user's identity, system permissions, tools, credentials or approval decisions.

Changes must keep attachment references and tool calls paired with their results. A processing stage cannot repeatedly trigger itself or feed its own output back into an observer loop.

See the message-processing examples for observer and redactor code in all four languages.