Documentation
¶
Index ¶
- Constants
- type Option
- type PerToolRateLimiterData
- type Plugin
- func (p *Plugin) Execute(ctx context.Context, in appplugins.ExecInput) (*appplugins.Result, error)
- func (p *Plugin) MandatoryStages() []policy.Stage
- func (p *Plugin) MutatesMetadata() bool
- func (p *Plugin) MutatesRequestBody() bool
- func (p *Plugin) MutatesResponseBody() bool
- func (p *Plugin) Name() string
- func (p *Plugin) SupportedModes() []policy.Mode
- func (p *Plugin) SupportedProtocols() []appplugins.Protocol
- func (p *Plugin) SupportedStages() []policy.Stage
- func (p *Plugin) ValidateConfig(settings map[string]any) error
- func (p *Plugin) ValidateConfigForProtocol(protocol appplugins.Protocol, settings map[string]any) error
Constants ¶
View Source
const PluginName = "per_tool_rate_limiter"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PerToolRateLimiterData ¶
type PerToolRateLimiterData struct {
Stage string `json:"stage"`
CounterKey string `json:"counter_key"`
Tool string `json:"tool"`
ToolCallID string `json:"tool_call_id,omitempty"`
Dimension string `json:"dimension"`
Subject string `json:"subject"`
WindowMax int `json:"window_max"`
WindowSeconds int `json:"window_seconds"`
CurrentCount int `json:"current_count"`
Behavior string `json:"behavior"`
LimitExceeded bool `json:"limit_exceeded"`
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) Execute ¶
func (p *Plugin) Execute(ctx context.Context, in appplugins.ExecInput) (*appplugins.Result, error)
func (*Plugin) MandatoryStages ¶
func (*Plugin) MutatesMetadata ¶ added in v0.2.3
func (*Plugin) MutatesRequestBody ¶ added in v0.2.3
func (*Plugin) MutatesResponseBody ¶ added in v0.2.3
func (*Plugin) SupportedModes ¶
func (*Plugin) SupportedProtocols ¶ added in v0.4.0
func (p *Plugin) SupportedProtocols() []appplugins.Protocol
func (*Plugin) SupportedStages ¶
func (*Plugin) ValidateConfigForProtocol ¶ added in v0.34.1
func (p *Plugin) ValidateConfigForProtocol(protocol appplugins.Protocol, settings map[string]any) error
ValidateConfigForProtocol refuses, on MCP, the behaviors that only the LLM path can carry out. There the plugin watches a model's conversation and can edit it — withdraw the tool before the model sees it, or answer its call with an explanation. On MCP the client asked for one tool by name and the gateway is the caller, so there is nothing to edit and every behavior collapses into the same refusal. Accepting the setting and quietly enforcing something else is the failure worth avoiding: the policy would read as one thing on the consumer it is attached to and behave as another.
Click to show internal directories.
Click to hide internal directories.