regress

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonNewUnapprovedTool     = "new_unapproved_tool"
	ReasonRevokedToolReappeared = "revoked_tool_reappeared"
	ReasonPermissionExpansion   = "unapproved_permission_expansion"
	ReasonCriticalAttackPath    = "critical_attack_path_drift"
)
View Source
const BaselineVersion = "v1"

Variables

This section is empty.

Functions

func SaveBaseline

func SaveBaseline(path string, baseline Baseline) error

Types

type AttackPathDriftSummary added in v1.0.5

type AttackPathDriftSummary struct {
	BaselineCriticalCount int                     `json:"baseline_critical_count"`
	CurrentCriticalCount  int                     `json:"current_critical_count"`
	Added                 []AttackPathState       `json:"added,omitempty"`
	Removed               []AttackPathState       `json:"removed,omitempty"`
	ScoreChanged          []AttackPathScoreChange `json:"score_changed,omitempty"`
	DriftCount            int                     `json:"drift_count"`
	DriftRatio            float64                 `json:"drift_ratio"`
	MinAbsolute           int                     `json:"min_absolute"`
	MinRelative           float64                 `json:"min_relative"`
}

type AttackPathScoreChange added in v1.0.5

type AttackPathScoreChange struct {
	PathID        string  `json:"path_id"`
	Org           string  `json:"org"`
	Repo          string  `json:"repo"`
	BaselineScore float64 `json:"baseline_score"`
	CurrentScore  float64 `json:"current_score"`
	ScoreDelta    float64 `json:"score_delta"`
}

type AttackPathState added in v1.0.5

type AttackPathState struct {
	PathID string  `json:"path_id"`
	Org    string  `json:"org"`
	Repo   string  `json:"repo"`
	Score  float64 `json:"score"`
}

type Baseline

type Baseline struct {
	Version     string            `json:"version"`
	GeneratedAt string            `json:"generated_at"`
	Tools       []ToolState       `json:"tools"`
	AttackPaths []AttackPathState `json:"attack_paths,omitempty"`
}

func BuildBaseline

func BuildBaseline(snapshot state.Snapshot, generatedAt time.Time) Baseline

func LoadBaseline

func LoadBaseline(path string) (Baseline, error)

type Reason

type Reason struct {
	Code             string                  `json:"code"`
	AgentID          string                  `json:"agent_id"`
	ToolID           string                  `json:"tool_id"`
	Org              string                  `json:"org"`
	Message          string                  `json:"message"`
	AddedPermissions []string                `json:"added_permissions,omitempty"`
	AttackPathDrift  *AttackPathDriftSummary `json:"attack_path_drift,omitempty"`
}

type Result

type Result struct {
	Status        string   `json:"status"`
	Drift         bool     `json:"drift_detected"`
	ReasonCount   int      `json:"reason_count"`
	Reasons       []Reason `json:"reasons"`
	BaselinePath  string   `json:"baseline_path,omitempty"`
	SummaryMDPath string   `json:"summary_md_path,omitempty"`
}

func Compare

func Compare(baseline Baseline, current state.Snapshot) Result

type ToolState

type ToolState struct {
	AgentID        string   `json:"agent_id"`
	ToolID         string   `json:"tool_id"`
	Org            string   `json:"org"`
	Status         string   `json:"status"`
	ApprovalStatus string   `json:"approval_status"`
	Present        bool     `json:"present"`
	Permissions    []string `json:"permissions"`
}

func SnapshotTools

func SnapshotTools(snapshot state.Snapshot) []ToolState

Jump to

Keyboard shortcuts

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