security

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package security implements multi-layer security checks before commits. Layers: binary detection → folder blacklist → name blacklist → regex → LLM (large models only).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseModelSize

func ParseModelSize(modelName string) domain.ModelSize

ParseModelSize determines the model size category from the model name. Uses the parameter count in the name (e.g. "qwen3.5:14b" → Large).

Types

type Service

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

Service implements ports.SecurityService.

func New

func New(cfg *config.Config, llm ports.LLM) *Service

New creates a new security Service.

func (*Service) CheckFiles

func (s *Service) CheckFiles(files []string, diff string) *ports.SecurityCheckResult

CheckFiles runs all security layers on the given files.

func (*Service) ShouldUseLLMScan

func (s *Service) ShouldUseLLMScan() bool

ShouldUseLLMScan returns true if the model should be used for security verification. With improved prompts, all models (even small ones) are supported.

Jump to

Keyboard shortcuts

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