base_url and
default_headers, you can point them at the firewall with no extra
dependency at all. The snippets below cover both.
Official SDK
TypeScript / Node.js
@blindsight/security, available now on npm.Python
blindsight-security, coming soon.TypeScript / Node.js
fetch), zero runtime
dependencies. Scan the prompt before the model, and the response
before the user:
scanInput, scanOutput, scanFile,
scanToolCall, and scanBatch. Every result carries uuid,
verdict, injection, pii, redactedText, blockedReason,
latencyMs, and textLength, plus the boolean flags allowed /
flagged / redacted / blocked and the convenience accessors
safeText, injectionScore, piiCategories, and raw (the full
JSON response). assertNotBlocked(result) throws ContentBlockedError
on a block verdict.
Files and agent tool‑calls use the same client:
rs.proxy.gemini(), rs.proxy.vertex(), rs.proxy.bedrock(), and
rs.proxy.openaiCompatible({ provider: "groq" }) cover the rest. Each
returns { baseURL, defaultHeaders }, ready to spread. All exceptions
derive from BlindsightError: BlindsightApiError (with .statusCode
and .code, specialised as BlindsightAuthError on 401/403 and
BlindsightQuotaError on 402/429), BlindsightConnectionError, and
ContentBlockedError.
Python
The Python SDK (
blindsight-security) is coming soon. Its
surface mirrors the TypeScript client with snake‑case names
(rs.scan_input(...), verdict.blocked, verdict.safe_text). Until
it ships, use the dependency‑free httpx pattern below, which is
functionally identical.Python: explicit scan calls (no SDK)
The portable pattern: scan input, call your model, scan output.Node: reverse proxy (no SDK)
The shortest integration possible: swap one URL.curl: agent tool‑call gate
The minimal one‑liner before a tool dispatch.LangChain
LangChain’sChatOpenAI is a thin wrapper over the OpenAI Python SDK
and forwards base_url and default_headers. Point those at the
Blindsight reverse proxy and every LangChain call, chains, retrievers,
agent LLM steps, flows through Runtime Security.
init_chat_model("openai:gpt-4o", base_url=..., default_headers=...)
works the same way for projects that use the model‑string indirection.
For Anthropic, swap to ChatAnthropic from langchain-anthropic,
point base_url at /api/runtime-security/proxy/anthropic, and pass
the Blindsight key on X-Blindsight-Key (Anthropic reserves x-api-key
for the upstream provider).
LlamaIndex
LlamaIndex’sOpenAI LLM accepts api_base and default_headers:
from llama_index.llms.anthropic import Anthropic
with api_base="/api/runtime-security/proxy/anthropic" and the
Blindsight key on X-Blindsight-Key.
Picking a pattern
I just want it on, fast
I just want it on, fast
Reverse proxy (Python or Node). One config change, full coverage.
I have custom middleware
I have custom middleware
Scan API. Two HTTP calls per request, full control over what you
do with each verdict.
I have an agent that runs tools
I have an agent that runs tools
Reverse proxy for the LLM, plus tool‑call scan wrapping every
tool dispatch. The two combine to cover the whole loop.
I scan documents that aren't going to a model
I scan documents that aren't going to a model
Scan API
/scan/batch. Up to 32 items per call, one license unit
per item, much cheaper HTTP overhead.
