Documentation
¶
Index ¶
- func ApplyTrustPolicy(policy gate.MCPTrustPolicy, call ToolCall, outcome gate.EvalOutcome, ...) gate.EvalOutcome
- func EvaluateServerTrust(policy gate.MCPTrustPolicy, server *ServerInfo, riskClass string, ...) *schemagate.MCPTrustDecision
- func ExportLogEvent(path string, event ExportEvent) error
- func ExportOTelEvent(path string, event ExportEvent) error
- func ToIntentRequest(call ToolCall) (schemagate.IntentRequest, error)
- func ToIntentRequestWithOptions(call ToolCall, opts IntentOptions) (schemagate.IntentRequest, error)
- type Adapter
- type ArgProvenance
- type CallContext
- type Delegation
- type DelegationLink
- type EvalResult
- type ExportEvent
- type IntentOptions
- type OAuthEvidence
- type ScriptCall
- type ScriptStep
- type ServerInfo
- type Target
- type ToolCall
- type ToolResult
- type TrustSnapshot
- type TrustSnapshotEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTrustPolicy ¶ added in v1.3.3
func ApplyTrustPolicy(policy gate.MCPTrustPolicy, call ToolCall, outcome gate.EvalOutcome, now time.Time) gate.EvalOutcome
func EvaluateServerTrust ¶ added in v1.3.3
func EvaluateServerTrust(policy gate.MCPTrustPolicy, server *ServerInfo, riskClass string, now time.Time) *schemagate.MCPTrustDecision
func ExportLogEvent ¶
func ExportLogEvent(path string, event ExportEvent) error
func ExportOTelEvent ¶
func ExportOTelEvent(path string, event ExportEvent) error
func ToIntentRequest ¶
func ToIntentRequest(call ToolCall) (schemagate.IntentRequest, error)
func ToIntentRequestWithOptions ¶
func ToIntentRequestWithOptions(call ToolCall, opts IntentOptions) (schemagate.IntentRequest, error)
Types ¶
type ArgProvenance ¶
type CallContext ¶
type CallContext struct {
Identity string `json:"identity,omitempty"`
Workspace string `json:"workspace,omitempty"`
RiskClass string `json:"risk_class,omitempty"`
Phase string `json:"phase,omitempty"`
JobID string `json:"job_id,omitempty"`
SessionID string `json:"session_id,omitempty"`
RequestID string `json:"request_id,omitempty"`
RunID string `json:"run_id,omitempty"`
AuthMode string `json:"auth_mode,omitempty"`
OAuthEvidence *OAuthEvidence `json:"oauth_evidence,omitempty"`
AuthContext map[string]any `json:"auth_context,omitempty"`
CredentialScopes []string `json:"credential_scopes,omitempty"`
EnvironmentFingerprint string `json:"environment_fingerprint,omitempty"`
ContextEnvelopePath string `json:"context_envelope_path,omitempty"`
}
type Delegation ¶
type Delegation struct {
RequesterIdentity string `json:"requester_identity"`
ScopeClass string `json:"scope_class,omitempty"`
TokenRefs []string `json:"token_refs,omitempty"`
Chain []DelegationLink `json:"chain,omitempty"`
}
type DelegationLink ¶
type EvalResult ¶
type EvalResult struct {
Call ToolCall
Intent schemagate.IntentRequest
Outcome gate.EvalOutcome
Trust *schemagate.MCPTrustDecision
}
func EvaluateToolCall ¶
func EvaluateToolCall(policy gate.Policy, call ToolCall, opts gate.EvalOptions) (EvalResult, error)
func EvaluateToolCallWithIntentOptions ¶
func EvaluateToolCallWithIntentOptions(policy gate.Policy, call ToolCall, opts gate.EvalOptions, intentOpts IntentOptions) (EvalResult, error)
type ExportEvent ¶
type ExportEvent struct {
CreatedAt time.Time `json:"created_at"`
ProducerVersion string `json:"producer_version"`
RunID string `json:"run_id"`
SessionID string `json:"session_id,omitempty"`
TraceID string `json:"trace_id"`
TracePath string `json:"trace_path,omitempty"`
ToolName string `json:"tool_name"`
Verdict string `json:"verdict"`
ReasonCodes []string `json:"reason_codes,omitempty"`
PolicyDigest string `json:"policy_digest"`
IntentDigest string `json:"intent_digest"`
DecisionLatency int64 `json:"decision_latency_ms,omitempty"`
DelegationRef string `json:"delegation_ref,omitempty"`
DelegationDepth int `json:"delegation_depth,omitempty"`
}
type IntentOptions ¶
type IntentOptions struct {
RequireExplicitContext bool
}
type OAuthEvidence ¶ added in v1.2.5
type OAuthEvidence struct {
Issuer string `json:"issuer,omitempty"`
Audience []string `json:"audience,omitempty"`
Subject string `json:"subject,omitempty"`
ClientID string `json:"client_id,omitempty"`
TokenType string `json:"token_type,omitempty"`
Scopes []string `json:"scopes,omitempty"`
DCRClientID string `json:"dcr_client_id,omitempty"`
RedirectURI string `json:"redirect_uri,omitempty"`
TokenBind string `json:"token_binding,omitempty"`
AuthTime string `json:"auth_time,omitempty"`
EvidenceRef string `json:"evidence_ref,omitempty"`
}
type ScriptCall ¶ added in v1.2.8
type ScriptCall struct {
Steps []ScriptStep `json:"steps"`
}
type ScriptStep ¶ added in v1.2.8
type ScriptStep struct {
Name string `json:"name"`
Args map[string]any `json:"args,omitempty"`
Targets []Target `json:"targets,omitempty"`
ArgProvenance []ArgProvenance `json:"arg_provenance,omitempty"`
}
type ServerInfo ¶ added in v1.3.3
type Target ¶
type Target struct {
Kind string `json:"kind"`
Value string `json:"value"`
Operation string `json:"operation,omitempty"`
Sensitivity string `json:"sensitivity,omitempty"`
DiscoveryMethod string `json:"discovery_method,omitempty"`
DiscoveryMethodAlias string `json:"discoveryMethod,omitempty"`
ReadOnlyHint bool `json:"read_only_hint,omitempty"`
ReadOnlyHintAlias bool `json:"readOnlyHint,omitempty"`
DestructiveHint bool `json:"destructive_hint,omitempty"`
DestructiveHintAlias bool `json:"destructiveHint,omitempty"`
IdempotentHint bool `json:"idempotent_hint,omitempty"`
IdempotentHintAlias bool `json:"idempotentHint,omitempty"`
OpenWorldHint bool `json:"open_world_hint,omitempty"`
OpenWorldHintAlias bool `json:"openWorldHint,omitempty"`
Annotations map[string]any `json:"annotations,omitempty"`
}
type ToolCall ¶
type ToolCall struct {
Name string `json:"name"`
Args map[string]any `json:"args,omitempty"`
Script *ScriptCall `json:"script,omitempty"`
Target string `json:"target,omitempty"`
Targets []Target `json:"targets,omitempty"`
ArgProvenance []ArgProvenance `json:"arg_provenance,omitempty"`
Server *ServerInfo `json:"server,omitempty"`
Context CallContext `json:"context,omitempty"`
Delegation *Delegation `json:"delegation,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
type ToolResult ¶
type TrustSnapshot ¶ added in v1.3.3
type TrustSnapshot struct {
SchemaID string `json:"schema_id"`
SchemaVersion string `json:"schema_version"`
CreatedAt time.Time `json:"created_at"`
ProducerVersion string `json:"producer_version"`
Entries []TrustSnapshotEntry `json:"entries"`
}
func LoadTrustSnapshot ¶ added in v1.3.3
func LoadTrustSnapshot(path string) (TrustSnapshot, error)
type TrustSnapshotEntry ¶ added in v1.3.3
type TrustSnapshotEntry struct {
ServerID string `json:"server_id"`
ServerName string `json:"server_name,omitempty"`
Publisher string `json:"publisher,omitempty"`
Source string `json:"source,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Status string `json:"status,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
Score float64 `json:"score,omitempty"`
EvidencePath string `json:"evidence_path,omitempty"`
RegistryVerification *registry.VerifyResult `json:"registry_verification,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.