Ghost SDK: Why AI Agent Monitoring Shouldn't Cost You Latency
Ghost SDK is Tenet AI's fire-and-forget integration layer for AI agent decision monitoring. It uses an in-process background queue to capture full Reasoning Ledger records — context snapshot, reasoning chain, SHA-256 + Ed25519 signature — while adding less than 5ms to the agent's decision path. Your agent never waits. If the Tenet backend is unreachable, the agent runs unaffected.
The Observability Tax Problem
Standard observability SDKs use synchronous writes on the critical path, adding 50–200ms per event under normal conditions. Teams either accept the latency penalty, sample decisions (creating audit gaps), or disable monitoring entirely. Ghost SDK resolves this with a fire-and-forget architecture: the SDK call serializes the decision snapshot, queues it in memory, and returns in under 0.1ms. All I/O happens on a background thread.
What Ghost SDK Captures
Full context snapshot (agent in-memory state at decision time), reasoning chain (LLM response structure including chain-of-thought), input/output and tool calls, and SHA-256 + Ed25519 cryptographic signature. All components are CPU-bound memory operations. The cryptographic signing — which makes the Reasoning Ledger tamper-evident — takes 1–3ms on modern hardware and is the largest single component of the sub-5ms budget.
Sampling vs. Full Capture
Ghost SDK eliminates the performance reason to sample. With synchronous SDKs, sampling is a latency optimization. With Ghost SDK at sub-5ms blocking overhead, teams can capture every decision by default. Full capture is required for regulatory compliance audit trails and for reliable semantic drift detection — a 5% sample creates signal gaps that mask early drift patterns.
How Ghost SDK Handles Backend Failures
When the Tenet backend is unreachable, Ghost SDK queues events in memory up to a configurable limit (default: 10,000 events). The agent's critical path is never blocked by backend unavailability. When connectivity is restored, the queue drains automatically. If the queue limit is exceeded, oldest events are dropped with a configurable alert threshold. This design means monitoring failures never affect agent availability — the observability tail never wags the production dog.
Compliance Implications of Sub-5ms Overhead
Many regulated-industry teams avoided adding observability SDKs to production AI agents because the latency cost was unacceptable in time-sensitive workflows: prior authorization decisions, real-time fraud detection, live trading recommendations. Ghost SDK's sub-5ms overhead removes the latency barrier. These teams can now capture complete decision audit trails for compliance without acceptable performance degradation — satisfying HIPAA, EU AI Act, and SOC 2 logging requirements without sacrificing SLA.