Disposes the scope and finalizes telemetry data collection.
ProtectedaddAdds an event to the current span.
The event name
Optionalattributes: AttributesOptional event attributes
Legacy dispose method for compatibility.
Gets the span context for this scope.
Records multiple attribute key/value pairs.
Records a cancellation event on the span.
Optionalreason: stringRecords the output content value for the guardrail evaluation (opt-in).
The output content after guardrail processing.
Records an updated decision on the guardrail span. Use this when the guardrail decision is determined after span creation.
The decision type made by the guardian.
Optionalreason: stringOptional human-readable explanation for the decision.
Records an error that occurred during the operation.
Records a security finding event on the current span. Multiple findings may be recorded per guardrail evaluation.
The security finding to record.
ProtectedrecordRecords the input messages for telemetry tracking.
ProtectedrecordRecords the output messages for telemetry tracking.
Sets a custom end time for the scope.
When set, dispose() will pass this value to span.end() instead of using wall-clock time.
ProtectedsetSets a tag on the span if the value is not null or undefined.
StaticstartCreates and starts a new scope for guardrail evaluation tracing.
Details of the guardrail evaluation (target, decision, guardian info, policy).
Information about the agent being guarded.
Optionalrequest: A365RequestOptional request details for conversation context.
OptionaluserDetails: UserDetailsOptional human user details.
OptionalspanDetails: A365SpanDetailsOptional span configuration (parent context, timing, kind, span links).
A new ApplyGuardrailScope instance.
Provides OpenTelemetry tracing scope for security guardrail evaluation operations.
Describes a security guardian evaluation. Multiple guardian spans MAY exist under a single operation span if multiple guardians are chained.
Guardian spans SHOULD be children of the operation span they are protecting (e.g., inference or execute_tool spans).