Skip to content

Graphorin API reference v0.8.0


Graphorin API reference / @graphorin/tools / outbound

outbound

@graphorin/tools/outbound - single-source outbound commentary pattern catalogue + envelope helpers shared by the server delivery layer, the session-output boundary and the channel gateway.

Interfaces

InterfaceDescription
OutboundCommentaryPatternSingle pattern entry in the OUTBOUND_COMMENTARY_PATTERNS catalogue.

Type Aliases

Type AliasDescription
OutboundCommentaryPolicyOperator-facing policy shared by all outbound commentary sanitizers.
OutboundCommentaryReasonStable label for each detection pattern. Surfaced in audit rows; the counter label cardinality is bounded.

Variables

VariableDescription
COMMENTARY_WRAP_CLOSEDefault wrap-envelope close delimiter. See COMMENTARY_WRAP_OPEN.
COMMENTARY_WRAP_OPENDefault wrap-envelope open delimiter shared by all outbound sanitizers, so a fragment wrapped at one boundary is recognized (and never re-wrapped) at every other boundary.
OUTBOUND_COMMENTARY_PATTERNSThe framework-shipped catalogue: the seven event-shape signatures the agent runtime can emit which, if leaked into user-visible text, disclose internal tool execution detail. Bytes-equal across every boundary that consumes it; idempotent on a single payload (the wrap envelope itself is not matched by any pattern, so a second pass over previously-sanitized output is a no-op).

Functions

FunctionDescription
freshRegexClone a regex before every scan. RegExp instances with the g flag carry a mutable lastIndex; cloning keeps sanitizers built over the shared catalogue stateless.
sha256HexHex-encoded SHA-256 of a UTF-8 string. Used for the before/after digests on sanitization audit rows (raw payloads never reach the audit log).
splitByWrapEnvelopeSplit a body into already-wrapped + plain segments so a sanitizer never re-scans inside an existing wrap envelope. This is the idempotency primitive that makes layered outbound sanitization (storage-write, wire-emission, channel delivery) composable: a second pass over previously-sanitized output is bytes-equal.