safety

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMValidator

type LLMValidator struct {
	// contains filtered or unexported fields
}

LLMValidator uses a separate LLM call to review agent output before posting.

func NewLLMValidator

func NewLLMValidator(provider llm.Provider) *LLMValidator

NewLLMValidator creates a validator that uses the given LLM provider for review.

func (*LLMValidator) ValidateWithContext

func (v *LLMValidator) ValidateWithContext(ctx context.Context, agentOutput string, issueContext string) ValidationResult

ValidateWithContext reviews agent output against the original issue context. On any error, it returns a fail-safe result (Passed=false).

type StructuralConfig

type StructuralConfig struct {
	MaxCommentLength int
	AllowedMentions  []string
	AllowedURLHosts  []string
}

StructuralConfig controls which deterministic checks the validator applies.

type StructuralValidator

type StructuralValidator struct {
	// contains filtered or unexported fields
}

StructuralValidator enforces deterministic safety rules on content.

func NewStructuralValidator

func NewStructuralValidator(config StructuralConfig) *StructuralValidator

NewStructuralValidator creates a validator from the given config.

func (*StructuralValidator) Validate

func (v *StructuralValidator) Validate(content string) ValidationResult

Validate checks content against all configured structural rules. It returns on the first failure.

type ValidationResult

type ValidationResult struct {
	Passed     bool
	Reason     string
	Confidence float32
}

ValidationResult holds the outcome of a content validation check.

type Validator

type Validator interface {
	Validate(content string) ValidationResult
}

Validator checks content against safety rules.

Jump to

Keyboard shortcuts

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