TypeScript SDK

Highflame TypeScript SDK overview with an ordered path for setup, Shield wrappers, low-level client usage, and advanced topics.

JavaScript and TypeScript SDK for the Highflame guardrails service. The TypeScript package gives you two main ways to integrate Shield:

  • Shield wrappers for the fastest path around prompts, tools, and model outputs

  • the Highflame client when you want full request and response control

Read This Section in Order

  1. Getting Started: install @highflame/sdk, authenticate, and wire up your first guarded function

  2. Shield Wrappers: choose the right wrapper and configure it correctly

  3. Low-Level Client: use client.guard.*, client.detect.*, client.detectors.*, and client.debug.*

  4. Advanced Topics: debugging, optimization, streaming, context objects, sessions, and runtime options

Choosing the Right API

I want to...
Use

Guard a prompt before my LLM runs

shield.prompt(fn)

Guard a tool call before it executes

shield.tool(fn)

Guard a tool's return value before it's used

shield.toolResponse(fn)

Guard the LLM's output before returning to the caller

shield.modelResponse(fn)

Guard a file read or write

shield.wrap({ contentType: "file", action: "write_file" })(fn)

Evaluate with full control and inspect the full response

client.guard.evaluate()

Evaluate a prompt with minimal code

client.guard.evaluatePrompt()

Evaluate a tool call with minimal code

client.guard.evaluateToolCall()

Run detectors without Cedar policy evaluation

client.detect.run()

Observe traffic without blocking

pass mode: "monitor"

Understand why a decision was made

pass explain: true

See per-detector breakdowns

pass debug: true

Only run detectors referenced by active policies

pass optimize: true

Framework Support

The TypeScript SDK ships first-class framework integrations for LangGraph, CrewAI, AWS Strands, and Azure AI Foundry — matching the Python SDK. Import them from their subpaths:

See the Framework Integrations reference for full usage. For custom integrations or call sites not covered by a framework adapter, integrate Shield at your model and tool boundaries with Shield wrappers or direct client.guard.* calls.

Last updated