Skip to main content
Version: 2.4.5 (Latest)

Security Capabilities

This page is the honest scorecard of what the framework actually implements vs. what it documents as best practice vs. what ships as example code. Use it for vendor-evaluation checklists and threat-model reviews.

For how to report a vulnerability, see SECURITY.md in the repo.

Legend

MarkerMeaning
🟢 ImplementedBattle-tested code in the public API. Has tests. Used in production by maintainers. Follows the SEMVER policy.
🟡 RecommendedThe framework provides primitives and documentation, but the user is responsible for the wiring. We don't ship a "turn it on" switch.
🟠 ExampleCode exists in the repo (often in examples/ or as a default plugin) but is intended as a starting point. Audit and harden before relying on it in production.
🔴 Not in scopeOutside the framework's responsibility — handled by surrounding infrastructure.

Pre-retrieval guardrails

CapabilityStatusWhere it livesNotes
Prompt-injection detection🟢 ImplementedGuardrailsPipeline preRetrieval.enableInjectionDetectionPattern-matching heuristics with allowlist support. Tunable thresholds. Not a substitute for downstream output checks.
Topic / off-topic filtering🟢 ImplementedpreRetrieval.topicAllowlistCosine-similarity gate against a configurable topic embedding set.
Query length limits🟢 ImplementedpreRetrieval.maxQueryLengthHard limit before any embedding spend.
Rate limiting per principal🟡 RecommendedWire your own middleware (Fastify, Express, Lambda authorizer)The framework does not own the request lifecycle.
Authentication / authorization🔴 Not in scopeYour edge / API gatewayThe framework receives an authenticated principal; it does not authenticate.

Retrieval-time guardrails

CapabilityStatusWhere it livesNotes
Minimum relevance threshold🟢 Implementedretrieval.minRelevanceScoreDrops chunks below the configured cosine score. Prevents fishing.
ACL / multi-tenant filtering🟡 RecommendedPass tenantId / aclTags in retrieval options; default plugins honor themWe provide the hooks; your retriever implementation must enforce them. The default MemoryRetriever honors tenantId; cloud retrievers (Pinecone, Weaviate, etc.) require user-supplied filter expressions.
Maximum context size🟢 Implementedretrieval.maxContextTokensHard cap to prevent prompt bloat and runaway cost.
Embedding cache poisoning protection🟡 RecommendedUse signed cache keys + TTLThe framework's optional cache uses content-addressed keys; if you implement your own, sign them.

Post-generation guardrails

CapabilityStatusWhere it livesNotes
PII detection🟢 ImplementedpostGeneration.enablePIIDetectionRegex + named-entity heuristics for emails, phones, SSNs, credit cards. Configurable patterns. Tested against synthetic corpora.
Groundedness scoring🟢 ImplementedCitationTracker + evaluator.computeGroundedness()Per-sentence attribution to source chunks. Returns a confidence score; you choose the threshold.
Hallucination detection🟢 Implementedevaluator.faithfulnessLLM-judged faithfulness score; pluggable judge model.
Output redaction🟠 Exampleexamples/guardrails/redact-pii.jsReference implementation that masks detected PII. Adopt and extend per your compliance requirements.
Toxicity / safety classification🟡 RecommendedPlug a toxicity classifier as a postGeneration.classifierThe framework provides the hook; we don't ship a classifier (model choice is policy-laden).

Supply-chain security

CapabilityStatusWhere it livesNotes
Pinned GitHub Actions by SHA🟢 Implemented.github/workflows/*.ymlEvery Action is pinned to a commit SHA, not a tag.
Dependabot enabled🟢 Implemented.github/dependabot.ymlDaily scan, auto-PR for patch-level bumps.
Runtime npm audit gate🟢 Implemented.github/workflows/supply-chain.ymlFails the build on any high+ severity advisory in runtime deps.
License allowlist enforcement🟢 Implementedsupply-chain.yml license-checker stepProduction deps must be MIT / Apache / BSD / ISC / 0BSD / Unlicense / CC0 / CC-PDDC.
SBOM generation🟢 Implementednpm run sbomCycloneDX format. Generated per release.
Provenance attestation (npm publish --provenance)🟡 RecommendedSet up via OIDC publish workflowCurrently published from local with token; OIDC migration is on the v3 roadmap.
Signed git tags🟡 RecommendedUse git tag -sNot enforced by the project; depends on maintainer key setup.

Authentication primitives

CapabilityStatusWhere it livesNotes
JWT validation helper🟢 ImplementedJWTValidatorVerifies signature, expiry, audience, issuer. Replay protection via jti cache.
API key validation🟠 Exampleexamples/auth/api-key.jsReference; production should use a managed secrets store (AWS Secrets Manager, HashiCorp Vault).
OAuth2 / OIDC client🔴 Not in scopeUse a library like openid-clientOut of scope for a RAG framework.

Logging and audit

CapabilityStatusWhere it livesNotes
Structured logging🟢 ImplementedcreateLogger, pino-basedJSON output by default, console for dev. Correlation IDs propagated through pipelines.
Secret redaction in logs🟢 Implementedsecure-logger, secure-logging modulesAuto-redacts password, apiKey, token, authorization, cookie fields by default. Configurable allowlist.
Audit log (immutable, append-only)🟢 ImplementedAuditLoggerAppend-only writer with checksum chain. Persists to file or your configured sink.
Tamper detection🟢 ImplementedAuditLogger.verify()Walks the checksum chain to detect tampering.
Centralized log shipping🔴 Not in scopeWire your own (Datadog, Splunk, Loki, OTEL)The framework writes structured logs; shipping is platform concern.

Input validation

CapabilityStatusWhere it livesNotes
Path traversal protection🟢 ImplementedsanitizePath utilityResolves and validates paths against an allowed base.
Input sanitization🟢 ImplementedInputSanitizerConfigurable allowlist/denylist for fields. Rejects payloads exceeding size limits.
JSON schema validation for plugin contracts🟢 Implementedcontracts/*.json + validate-plugin-contractPlugins fail to register if they don't match the contract.
ReDoS protection on user-supplied regex🟡 Recommendedsafe-expression-evaluator for evaluator scriptsIf you accept regex from users elsewhere, run it through a safe runtime (e.g. RE2 binding).

Data governance

CapabilityStatusWhere it livesNotes
Multi-tenancy primitives🟢 ImplementedDataGovernance.tenantContextIsolates retrieval, caches, and audit logs per tenantId.
Data retention policies🟡 RecommendedImplement on your storage backendThe framework reads/writes; lifecycle is the storage layer's job.
Encryption at rest🔴 Not in scopeStorage backend (Postgres TDE, S3 SSE, etc.)We don't manage your storage.
Encryption in transit🟡 RecommendedAll HTTP-based plugins use HTTPS by defaultVerify your custom plugins do too.

Security testing

CapabilityStatusWhere it livesNotes
Unit tests for security utilities🟢 Implemented__tests__/unit/security/**200+ tests for sanitizers, validators, audit logger.
Integration tests for guardrails🟢 Implemented__tests__/integration/guardrails.test.jsEnd-to-end pipeline with all three guardrail layers.
Fuzz tests for input sanitizers🟠 Example__tests__/fuzz/Reference fuzz harnesses; not in CI by default. Run locally before security-sensitive releases.
Static analysis (CodeQL)🟢 Implemented.github/workflows/security.ymlCodeQL on every PR + scheduled weekly.
Penetration testing🔴 Not in scopeCustomer responsibilityWe will publish disclosure-coordinated CVE fixes.

What this framework does not protect against

Calling this out so it's not assumed:

  • Compromised LLM provider — if your LLM API is hijacked, no framework guardrail will save you. Use trusted providers and treat outputs accordingly.
  • Embedding model bias — embedding models reflect their training data. We don't debias them. Use evaluation to detect regressions.
  • Side-channel timing attacks — guardrail evaluation takes measurable time; if you expose a public endpoint, a sufficiently motivated attacker can infer guardrail decisions from timing. Mitigate with constant-time response patterns at the HTTP layer.
  • Model exfiltration via inversion attacks — if your corpus contains secrets, an attacker with sufficient query budget can reconstruct fragments of it. The framework helps you set rate limits and ACLs but cannot eliminate this class of attack entirely.
  • Bring-your-own-plugin maliciousness — plugins run in your Node process with your privileges. Audit any third-party plugins you load.

See also