MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / validThresholds

Function validThresholds

internal/identity/scanconfig.go:79–90  ·  view source on GitHub ↗
(dir string, review, block float64)

Source from the content-addressed store, hash-verified

77}
78
79func validThresholds(dir string, review, block float64) error {
80 if review < 0 || review > 1 || block < 0 || block > 1 {
81 return fmt.Errorf("%s scan thresholds must be between 0 and 1", dir)
82 }
83 // Strict <: equal thresholds collapse the review band so a score at the cutoff
84 // jumps straight to block — e.g. (0,0) blocks every clean message. Require a real
85 // allow < review < block ladder.
86 if review >= block {
87 return fmt.Errorf("%s_scan_review_threshold must be < %s_scan_block_threshold", dir, dir)
88 }
89 return nil
90}
91
92// UpdateAgentScanConfig writes the full screening config for an agent owned by
93// userID, validating the effective posture first. Returns an error if the agent

Callers 1

ValidateScanConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected