policy

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package policy defines storage-independent MCP policy configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled           bool                  `yaml:"enabled"`
	AuditLog          string                `yaml:"audit_log,omitempty"`
	ApprovalThreshold string                `yaml:"approval_threshold,omitempty"` // "safe"|"moderate"|"dangerous"
	BlockedPatterns   []string              `yaml:"blocked_patterns,omitempty"`
	ProtectedPaths    []string              `yaml:"protected_paths,omitempty"`
	NodeOverrides     map[string]NodeConfig `yaml:"nodes,omitempty"`

	// NoElicitFallback controls behavior when the MCP client does not support
	// Elicitation (e.g. Gemini CLI).
	//   "deny"      — reject all operations that need approval (most secure)
	//   "allow"     — allow all, trust client-side tool approval + ToolAnnotations
	//   "downgrade" — allow moderate, still deny dangerous (recommended default)
	NoElicitFallback string `yaml:"no_elicit_fallback,omitempty"`
}

Config configures the MCP safety guardrail.

func Clone

func Clone(cfg Config) Config

Clone makes a defensive configuration value for one operation. AuditLog is legacy host configuration and is not interpreted by the policy evaluator.

type NodeConfig

type NodeConfig struct {
	ApprovalThreshold string `yaml:"approval_threshold"`
}

NodeConfig holds per-node (glob pattern) policy overrides.

Jump to

Keyboard shortcuts

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