New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@evalguard/wrapper-core

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evalguard/wrapper-core

Shared core for EvalGuard provider SDK wrappers — GuardrailClient, cost table, BYOK, retry + circuit-breaker, idempotency, eval-on-response.

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
51
-35.44%
Maintainers
1
Weekly downloads
 
Created
Source

@evalguard/wrapper-core

Shared core for EvalGuard provider SDK wrappers. Not typically used directly — install one of the provider wrappers instead:

What's here

ModuleExports
guardrail-clientGuardrailClient — HTTP client for firewall-check / trace-log / score-output, all fail-open
costestimateCost(model, inputTokens, outputTokens) — pricing table for 30+ models across OpenAI / Anthropic / Gemini
trace-idnewTraceId(), injectTraceHeader(), isValidTraceId() — per-request UUID for log correlation
byokresolveApiKey() — supports string | () => string | Promise<string>
idempotencyresolveIdempotencyKey() — auto-generated, literal, or function-supplied
retrywithRetry() — exponential backoff + per-base-URL circuit breaker
eval-on-responserunPostResponseEval() — post-completion output scoring
typesEvalGuardConfig, EvalGuardViolationError, EvalGuardOutputViolationError, etc.

Why a separate package

The v1.0 wrappers (evalguardai-openai, evalguardai-anthropic) each shipped inline copies of GuardrailClient and cost.ts. That worked for two providers but didn't scale — adding Gemini meant a third copy, and adding features (BYOK, idempotency, retry+circuit-breaker, eval-on-response) meant 3× the surface area to keep in sync.

This package consolidates the shared foundation. Wrappers import from it via workspace dep during development and npm dep once published.

License

MIT

Keywords

evalguard

FAQs

Package last updated on 08 Jun 2026

Related posts