Skip to main content
OSS reference implementation of the agent activity-log taxonomy from the Glide OSS plan §M4. Every event type that the MCP layer appends to activity_log lives here as a Zod schema in a discriminated union. The closed vocabulary is intentional: audit log consumers — compliance exporters, explainer narrators, anomaly detectors — switch on eventType; adding a new event type requires a deliberate schema update and a corresponding render path. The package ships the v1 surface of the AgentActivityEvent JSON Schema published at glide.co/schemas/agent-banking/v1/.

Install

npmjs.com/package/@glideco/agent-events

Why a closed vocab?

An open event taxonomy is a footgun for every downstream consumer. If any string is a valid eventType, the compliance exporter can’t tell the difference between a known event and a fabricated one, and the anomaly detector’s switch statement silently falls through to a no-op default. The discriminated union here enforces that every eventType literal has a known schema. Unrecognized event types fail AgentEventSchema.parse() at the boundary where the event enters the system — typically inside the MCP tool handler — not later when a reviewer tries to render it. Adding a new event type is a two-line change (literal + schema + union entry) that produces a TypeScript compile error everywhere the switch is exhaustive. That friction is the point.

Event types (v1)

Key payload shapes

The ToolCallEvent is the most data-rich shape. It carries the SHA-256 digests of input and output (never the raw values), the risk verdict, policy version, grant ID, and optional on-chain tx hash + amount:
Step-up events carry a sigil — a short opaque string that links the requested, completed, and declined triple into a single audit thread:
Policy change events record the direction of the change alongside version numbers:

Safe parsing

parseAgentEvent throws on invalid input. For a non-throwing path use AgentEventSchema.safeParse:

Adding a new event type

  1. Add the literal to AGENT_EVENT_TYPES.
  2. Write a Zod schema for the payload.
  3. Add a union member to AgentEventSchema.
  4. Update the activity_log writer and any switch-exhaustive consumers.
New event types must go into unused positions — the literal strings are stable v1 once published in the JSON Schema at glide.co/schemas/agent-banking/v1/.

Reading list