Superagent Exporter

Installation

$pip install respan-exporter-superagent

Classes

RespanSuperagentClient

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

1from 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

1from respan_exporter_superagent import create_client
2
3client = create_client(api_key="your-api-key")
4
5# Operations are automatically logged as tool spans
6result = await client.guard(
7 respan_params={"customer_identifier": "user-123"},
8 input="Check this content for safety",
9)

Wrapping an existing client

1from safety_agent import SafetyAgent
2from respan_exporter_superagent import RespanSuperagentClient
3
4existing_client = SafetyAgent(api_key="safety-agent-key")
5respan_client = RespanSuperagentClient(
6 client=existing_client,
7 api_key="your-respan-key",
8)
9
10result = await respan_client.scan(input="Check this content")