Documentation
¶
Index ¶
- Constants
- func NoExclusionsConfigFingerprint() string
- func NormalizeName(value string) string
- func RuleHash(configFingerprint string, matchedLists []string) string
- type Audit
- type BlocklistGuard
- type Candidate
- type CandidateStore
- type Config
- type Entry
- type IngestDecision
- type List
- type Match
- type RuntimeSnapshot
- type Target
Constants ¶
const ( ListNoAI = "no_ai" ListNotificationRequired = "notification_required" // NoExclusionsConfigSHA256 is the stable fingerprint for the explicit // operator contract that declares no customer governance exclusions. NoExclusionsConfigSHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" )
Variables ¶
This section is empty.
Functions ¶
func NoExclusionsConfigFingerprint ¶ added in v0.5.4
func NoExclusionsConfigFingerprint() string
NoExclusionsConfigFingerprint returns the stable config fingerprint for the explicit no-exclusions operator contract.
func NormalizeName ¶
Types ¶
type Audit ¶
type Audit struct {
ConfigEntries int `json:"config_entries"`
ConfigAliases int `json:"config_aliases"`
CandidateValues int `json:"candidate_values"`
MatchedEntries []Match `json:"matched_entries"`
UnmatchedEntries []Target `json:"unmatched_entries"`
SuppressedCallIDs []string `json:"suppressed_call_ids,omitempty"`
SuppressedCallCount int `json:"suppressed_call_count"`
}
func AuditCandidates ¶
func BuildAudit ¶
type BlocklistGuard ¶ added in v0.4.0
type BlocklistGuard struct {
// contains filtered or unexported fields
}
BlocklistGuard is a normalized, read-only view over the blocklist/restricted names that defend MCP serialization paths from emitting customer-identifying values when source-to-serving redaction or scoped-reader grants miss a row.
The guard is intentionally simple: it normalizes input the same way AuditCandidates does (NormalizeName), then reports whether a value contains any blocklisted target as a whole-word substring. It is not a primary authorization layer — it backs up the source-to-serving redaction and the MCP account-query gate.
func NewBlocklistGuard ¶ added in v0.4.0
func NewBlocklistGuard(rawTerms []string) *BlocklistGuard
NewBlocklistGuard builds a guard from raw restricted-name strings. Empty or blank entries are dropped. The guard preserves only the normalized form so callers can audit it without leaking original casing back through logs.
func NewBlocklistGuardFromConfig ¶ added in v0.4.0
func NewBlocklistGuardFromConfig(cfg *Config) *BlocklistGuard
NewBlocklistGuardFromConfig is a convenience that wraps NewBlocklistGuard over every list+alias target in the supplied governance Config.
func (*BlocklistGuard) Empty ¶ added in v0.4.0
func (g *BlocklistGuard) Empty() bool
Empty reports whether the guard has no blocklist terms loaded. A nil guard is treated as empty.
func (*BlocklistGuard) MatchAny ¶ added in v0.4.0
func (g *BlocklistGuard) MatchAny(values []string) bool
MatchAny reports whether any of the supplied values matches a blocklisted target.
func (*BlocklistGuard) MatchValue ¶ added in v0.4.0
func (g *BlocklistGuard) MatchValue(value string) bool
MatchValue reports whether the given value contains any blocklisted target as a whole-word substring after NormalizeName. Empty/blank input is never a match.
func (*BlocklistGuard) TermCount ¶ added in v0.4.0
func (g *BlocklistGuard) TermCount() int
TermCount returns the number of distinct normalized terms loaded into the guard. The terms themselves are not exposed so callers cannot accidentally log them.
type CandidateStore ¶
type Config ¶
type Config struct {
Version int `json:"version" yaml:"version"`
Lists map[string]List `json:"lists" yaml:"lists"`
}
func NoExclusionsConfig ¶ added in v0.5.4
func NoExclusionsConfig() *Config
NoExclusionsConfig returns the in-memory governance config used when an operator explicitly declares that no customer exclusions exist.
func (*Config) Fingerprint ¶ added in v0.3.4
type IngestDecision ¶ added in v0.4.0
func EvaluateCallPayload ¶ added in v0.4.0
func EvaluateCallPayload(raw json.RawMessage, cfg *Config) (IngestDecision, error)
type RuntimeSnapshot ¶
func Snapshot ¶
func Snapshot(ctx context.Context, path string, store CandidateStore) (RuntimeSnapshot, error)