security

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package security provides semantic convention constants and helpers for AI security observability (tiers, validators, actions, shadow mode).

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"
)

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)
)

Attribute keys as attribute.Key for type-safe span/event recording.

Functions

func RecordSecurityEvent

func RecordSecurityEvent(ctx context.Context, action, validator, reason string, isShadow bool)

RecordSecurityEvent adds a "Security Intervention" event to the span from ctx with action, validator, reason and shadow-mode attributes. 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