respan-instrumentation-guardrails
Respan instrumentation plugin for Guardrails AI. It wraps Guardrails Guard execution methods and emits guardrail spans into the Respan tracing pipeline.
Configuration
1. Install
pip install respan-ai respan-instrumentation-guardrails guardrails-ai
guardrails-ai is the Guardrails runtime package. It must be available in your package index for runnable Guardrails applications.
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates both proxy and tracing. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai/api. |
Quickstart
3. Run Script
import os
from dotenv import load_dotenv
load_dotenv()
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")
os.environ["OPENAI_API_KEY"] = respan_api_key
os.environ["OPENAI_BASE_URL"] = respan_base_url
from guardrails import Guard
from pydantic import BaseModel
from respan import Respan
from respan_instrumentation_guardrails import GuardrailsInstrumentor
class SupportReply(BaseModel):
answer: str
priority: str
respan = Respan(
api_key=respan_api_key,
base_url=respan_base_url,
instrumentations=[GuardrailsInstrumentor()],
)
guard = Guard.for_pydantic(output_class=SupportReply)
result = guard(
model="gpt-4o-mini",
messages=[
{
"role": "user",
"content": "Return JSON with answer and priority for a late shipment.",
}
],
)
print(result.validated_output)
respan.flush()
4. View Dashboard
After running the script, traces appear on your Respan dashboard.
Further Reading
See the Respan example projects for runnable scripts.
Metadata
Release files for respan-instrumentation-guardrails 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| respan_instrumentation_guardrails-0.1.0.tar.gz | 5.4 kB | Without provenance | Details for respan_instrumentation_guardrails-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| respan_instrumentation_guardrails-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for respan_instrumentation_guardrails-0.1.0-py3-none-any.whl |
Total release size: 12.0 kB
Release files / respan_instrumentation_guardrails-0.1.0.tar.gz
| Download URL | respan_instrumentation_guardrails-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59a2844a676eee4f62a862301dbd5d67212fdaacaefbe2e37093886bc5df419a
|
|
BLAKE2b-256 checksum How to use checksums |
6c4c745ab656b0290bc02768f9d9ae96578f770b8e278e59408a3ea154d96c9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
|
Release files / respan_instrumentation_guardrails-0.1.0-py3-none-any.whl
| Download URL | respan_instrumentation_guardrails-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88398e78883f0921a6a45e2c45e3443c294be2e1a94cb3daa6a3958066ca157a
|
|
BLAKE2b-256 checksum How to use checksums |
9c052096cb8d13e160ad800313e06df7325c7aa0656c2217ed06982147f9cf7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
|
Security for respan-instrumentation-guardrails 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.