Superagent (tracing)
Superagent (tracing)
Superagent (safety-agent) is an SDK for AI application safety. It provides guard, redact, scan, and related safety operations for prompt-injection detection, PII redaction, and repository analysis. Respan captures those operations through respan-instrumentation-superagent, so safety checks appear in the same traces as the workflows that call them.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Use Respan Gateway
See Superagent gateway setup to route this integration through the Respan gateway.
Example projects
Setup
Configuration
Attributes
In Respan()
Set defaults at initialization. These apply to all spans emitted by the Superagent instrumentor.
With propagate_attributes
Override per request with a context scope.
Decorators (optional)
Decorators are not required. Use @workflow and @task when you want Superagent guardrails to appear under higher-level application steps.
Examples
Guard
guard() is captured as a guardrail span. The span includes the operation input, result, classification, guardrail name, and triggered state.
Redact
redact() is captured as a tool span with redaction findings in metadata and the redacted text in output.
Scan
scan() is captured as a tool span. The Superagent SDK requires Daytona credentials for repository scans.