Documentation
¶
Overview ¶
Package security provides semantic conventions and helpers for AI security observability telemetry.
Index ¶
Constants ¶
View Source
const ( Tier = "ai.security.tier" Validator = "ai.security.validator" Action = "ai.security.action" ShadowMode = "ai.security.shadow_mode" Score = "ai.security.score" Reason = "ai.security.reason" Code = "ai.security.code" Severity = "ai.security.severity" )
Security semantic convention attribute keys for traces and events.
View Source
const ( ActionPass = "pass" ActionBlock = "block" ActionRedact = "redact" )
Standard values for Action.
Variables ¶
View Source
var ( TierKey = attribute.Key(Tier) ValidatorKey = attribute.Key(Validator) ActionKey = attribute.Key(Action) ShadowModeKey = attribute.Key(ShadowMode) ScoreKey = attribute.Key(Score) ReasonKey = attribute.Key(Reason) CodeKey = attribute.Key(Code) SeverityKey = attribute.Key(Severity) )
Attribute keys as attribute.Key for type-safe span/event recording.
Functions ¶
func RecordSecurityEvent ¶
func RecordSecurityEvent(ctx context.Context, action, validator, reason, code, severity string, isShadow bool)
RecordSecurityEvent adds a "Security Intervention" event to the span from ctx with action, validator, reason and shadow mode attributes. The code and severity attributes are added only when the corresponding argument is not an empty string. Use for compliance and audit logging. If ctx has no span, the call is a no-op.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.