SDKs

Two official language bindings implement the OGR contract. Both are zero-dependency, both speak protocol 0.4, and both have the same two halves:

  • an in-process Runtime — evaluate GuardEvents locally against a policy and detectors, no server involved;
  • a RuntimeClient — the HTTP client for a hosted Runtime API, with auth, request signing, batching, and error types.
PythonJavaScript / TypeScript
Packageopenguardrails@openguardrails/core
Installpip install openguardrailsnpm install @openguardrails/core
Modelssnake_case dataclasses (GuardEvent, Verdict)camelCase interfaces; client maps to/from the wire
SigningEd25519Signer (optional cryptography)createNodeSigner (lazy node:crypto)
BatchingBatchingIngestor background thread; ingest auto-chunksingest single batch (≤ 100); chunk yourself
ErrorsRuntimeAPIError, RateLimitedErrorRuntimeApiError, RateLimitedError
DocsPython SDKJavaScript SDK

Integrations normally don't install these directly — a plugin depends on its language's core and pulls it in automatically. Reach for the SDK when you are instrumenting your own agent or building a new integration.