Impraint

Installation

Install the Impraint Guard SDK and verify your setup.

Requirements

  • Python 3.10 or newer
  • An Impraint Guard API key. During beta, your Impraint contact gives you one when your organisation is set up. Keys start with ig_live_ (production) or ig_test_ (testing). A key is shown only once, so store it somewhere safe.
  • The provider or framework packages you want to track. The extras below install the supported ones for you.

Install the SDK

For the beta, install the beta extra. It adds everything the beta supports: Gemini, LangChain and LangGraph.

pip install "impraint-guard[beta]"

The base install (pip install impraint-guard) contains only the core SDK. Add extras for what you use:

ExtraAdds
langchainLangChain callback handler
langgraphLangGraph callback handler (graph-node steps)
geminiRaw google-genai tracking and langchain-google-genai
betaAll of the above

Use a virtual environment so Guard's dependencies stay isolated from your system Python.

Configure your API key

Keep the key out of source code. One simple way is an environment variable that you pass in yourself:

export IMPRAINT_API_KEY="your-api-key"
import os
from impraint_guard import Guard

guard = Guard(api_key=os.environ["IMPRAINT_API_KEY"], agent_id="my-agent")

The SDK does not read environment variables on its own, so you always pass the key to Guard(...).

Verify the install

import impraint_guard

print(impraint_guard.__version__)

If this prints a version number (for example 0.1.0), you're ready for the Quickstart.

Troubleshooting

On this page