llm

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeContext

type CodeContext struct {
	FilePath        string
	Language        string
	Function        string
	SurroundingCode string
	Imports         []string
	IsTest          bool
}

CodeContext provides context for LLM verification

type Finding

type Finding struct {
	FilePath    string
	LineNumber  int
	Line        string
	PatternType string
	Match       string
	Entropy     float64
	Context     string
	Confidence  string
}

Finding represents a secret finding

type LLMVerifier

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

LLMVerifier handles LLM-based verification

func NewLLMVerifier

func NewLLMVerifier(modelPath string, endpoint string, enabled bool) (*LLMVerifier, error)

NewLLMVerifier creates a new LLM verifier

func (*LLMVerifier) BatchVerify

func (v *LLMVerifier) BatchVerify(findings []*Finding, contexts []*CodeContext) ([]*VerificationResult, error)

BatchVerify verifies multiple findings in a batch

func (*LLMVerifier) Close

func (v *LLMVerifier) Close() error

Close releases resources

func (*LLMVerifier) Verify

func (v *LLMVerifier) Verify(finding *Finding, context *CodeContext) (*VerificationResult, error)

Verify verifies if a finding is a real secret

type VerificationResult

type VerificationResult struct {
	IsRealSecret   bool   `json:"is_real_secret"`
	Confidence     string `json:"confidence"`
	Reasoning      string `json:"reasoning"`
	Recommendation string `json:"recommendation"`
}

VerificationResult represents the LLM's verification result

Jump to

Keyboard shortcuts

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