Skip to main content

Installation

pip install respan-exporter-superagent

Classes

RespanSuperagentClient

Wrapper around the Superagent (safety-agent) SDK that automatically exports operations to Respan as tool spans.
from respan_exporter_superagent import create_client

Factory function

FunctionDescription
create_client(**kwargs)Create a RespanSuperagentClient instance.
ParameterTypeDefaultDescription
api_keystr | NoneNoneRespan API key. Falls back to RESPAN_API_KEY env var.
base_urlstr | NoneNoneAPI base URL.

Methods

All methods accept an optional respan_params dict for attaching metadata.
MethodDescription
guard(respan_params, **kwargs)Run guardrail check.
redact(respan_params, **kwargs)Redact sensitive content.
scan(respan_params, **kwargs)Scan for security issues.
test(respan_params, **kwargs)Test guardrail configuration.

respan_params

KeyTypeDescription
customer_identifierstrUser/customer identifier.
metadataDictCustom key-value pairs.
disable_logboolSet True to skip logging this call.

Usage

from respan_exporter_superagent import create_client

client = create_client(api_key="your-api-key")

# Operations are automatically logged as tool spans
result = await client.guard(
    respan_params={"customer_identifier": "user-123"},
    input="Check this content for safety",
)

Wrapping an existing client

from safety_agent import SafetyAgent
from respan_exporter_superagent import RespanSuperagentClient

existing_client = SafetyAgent(api_key="safety-agent-key")
respan_client = RespanSuperagentClient(
    client=existing_client,
    api_key="your-respan-key",
)

result = await respan_client.scan(input="Check this content")