Circular reference protection
LLM-generated objects can accidentally contain circular references. The SDK automatically detects these and replaces them with"[Circular]" during serialization.
Prototype pollution protection
The SDK strips dangerous JavaScript keys during serialization to prevent prototype pollution attacks:__proto__constructorprototype
Size guarding
Payloads exceedingmaxPayloadSize (default: 1 MB) are rejected after serialization. This prevents accidental submission of oversized events that could degrade server performance.
The size check happens after JSON serialization, so the actual byte size of the serialized payload is what’s measured — not the in-memory object size.
Queue management
The local auto-batch queue has a configurable maximum depth (maxQueueSize, default: 1000). If the queue is full, enqueue() throws an error rather than silently dropping events.
Telemetry
The SDK includes opt-in, fire-and-forget telemetry to monitor performance and LLM token usage.| What’s collected | What’s NOT collected |
|---|---|
| Latency metrics | Request bodies |
| HTTP status codes | Raw event content |
| Estimated token counts | User data |
| Error messages | Metadata values |
