Tawa docs
SDK Reference

Python

The Tawa Python SDK — sync and async clients for scanning prompts, RAG content, and agent tool traffic.

tawaguard-sdk is the official Python client for the Tawa Guard API — TawaGuard (sync) and AsyncTawaGuard (async), wrapping the REST API with an idiomatic, fully-typed client. Requires Python 3.9+; the only runtime dependency is httpx.

Install

pip install tawaguard-sdk

Quick client

from tawaguard import TawaGuard

client = TawaGuard("YOUR_API_KEY")
result = client.analyze("Ignore all previous instructions…")
print(result.action, result.confidence)

By default, the sync constructor verifies your API key against /verify immediately, so a bad key surfaces at construction time rather than on the first scan call. See Configuration for the full option set (including the async client's eager-vs-lazy verification), and Scanning for every scan method the client exposes.

Using the OpenAI Agents SDK? See the OpenAI Agents SDK integration for guardrail helpers built on top of this client.

On this page