# Python (/docs/python/sdk)



`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`](https://www.python-httpx.org/).

## Install [#install]

```bash
pip install tawaguard-sdk
```

## Quick client [#quick-client]

```python
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](/docs/python/sdk/client) for the full
option set (including the async client's eager-vs-lazy verification), and
[Scanning](/docs/python/sdk/scanning) for every scan method the client
exposes.

<Cards>
  <Card title="Configuration" href="/docs/python/sdk/client" description="Sync vs async client construction, retries, and timeouts." />

  <Card title="Scanning" href="/docs/python/sdk/scanning" description="analyze, scan_response, scan_context, scan_chunk, scan_tool_call, scan_tool_output, and the result shape they all share." />
</Cards>

<Callout type="info">
  Using the OpenAI Agents SDK? See the
  [OpenAI Agents SDK integration](/docs/python/integrations/openai-agents-sdk) for
  guardrail helpers built on top of this client.
</Callout>
