security

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL