The @know-your-ai SDK is a TypeScript toolkit for monitoring, tracing, evaluating, and securing AI model interactions. It follows a modular architecture with five packages that work together or independently.Documentation Index
Fetch the complete documentation index at: https://hydroxai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Packages
| Package | Description |
|---|---|
@know-your-ai/node | Primary entry point — monitoring & tracing for Node.js applications |
@know-your-ai/core | Core library (used internally by node and firewall) |
@know-your-ai/firewall | Content safety validation via hooks |
@know-your-ai/evaluate | Programmatic evaluation SDK — datasets, evaluations, test runs |
@know-your-ai/cli | Command-line interface for running evaluations from the terminal |
Requirements
- Node.js >= 18
- TypeScript (optional but recommended) — all packages ship with
.d.tstype definitions - ESM and CommonJS are both supported
Installation
- Monitoring + Tracing
- Firewall
- Evaluation SDK
- CLI
Quick start
1. Get your DSN
Go to Settings → API Keys in the Know Your AI dashboard and copy your DSN. It looks like:2. Initialize the SDK
3. Instrument your AI client
Configuration reference
All configuration is passed toKnowYourAI.init():
| Option | Type | Default | Description |
|---|---|---|---|
dsn | string | required | DSN from the dashboard |
environment | string | 'production' | Environment identifier (e.g. 'staging', 'development') |
debug | boolean | false | Enable debug logging |
sampleRate | number | 1.0 | Sampling rate (0.0 – 1.0) |
batchSize | number | 10 | Events to batch before sending |
flushInterval | number | 5000 | Max milliseconds before flushing events |
traceMode | boolean | true | Send complete trace trees (vs individual events) |
recordInputs | boolean | true | Capture user input messages |
recordOutputs | boolean | true | Capture AI responses |
recordRequestParams | boolean | true | Capture temperature, maxTokens, etc. |
enableDeduplication | boolean | true | Deduplicate payload content for traces |
enableCostEstimation | boolean | true | Estimate cost per request |
release | string | — | Your application version string |
integrations | Integration[] | [] | SDK integrations (e.g. Google GenAI, Firewall) |
onCapture | function | — | Callback invoked for every captured event |
beforeRequest | BeforeRequestHook[] | — | Pre-request hooks |
afterResponse | AfterResponseHook[] | — | Post-response hooks |
What’s next
Monitoring
Track requests, tokens, cost, and latency in production.
Tracing
Visualize multi-step AI agent interactions as span trees.
Firewall
Block dangerous inputs and flag risky outputs in real time.
Evaluate
Run security evaluations programmatically.