{"modulePath":"github.com/agentshield-dev/agentshield","version":"v0.0.1-rc.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package modelanalyzer\n\nPackage modelanalyzer is the production [reasoning.Analyzer](/github.com/agentshield-dev/agentshield/pkg/reasoning#Analyzer): it connects a model client to the read-only MCP tools for one pinned analysis and retries failed attempts.\n\nEach attempt opens a fresh in-memory MCP session over the same [reasoning.ContextProvider](/github.com/agentshield-dev/agentshield/pkg/reasoning#ContextProvider) and runs [reasoning.AnalyzeCandidateWithTools](/github.com/agentshield-dev/agentshield/pkg/reasoning#AnalyzeCandidateWithTools). Only transport, MCP, and decoding errors are retried; a policy rejection is a successful analysis with a rejected outcome and is never retried into a different answer. Because every attempt sees the same pinned packet and graph revision, a retry cannot observe newer state. When all attempts fail, the error stops the reasoning service; see [reasoning.Service.Run](/github.com/agentshield-dev/agentshield/pkg/reasoning#Service.Run).\n\n## Types\n\n```go\ntype Analyzer struct {\n\t// contains filtered or unexported fields\n}\n```\nAnalyzer runs model investigations with bounded retry.\n\n```go\nfunc New(client reasoning.Client, config Config) (*Analyzer, error)\n```\nNew returns an analyzer for client. The client must have an endpoint.\n\n```go\nfunc (analyzer *Analyzer) Analyze(ctx context.Context, packet reasoning.Packet, provider *reasoning.ContextProvider) (reasoning.AnalysisRun, error)\n```\nAnalyze implements [reasoning.Analyzer](/github.com/agentshield-dev/agentshield/pkg/reasoning#Analyzer). The returned run records every failed attempt's error, including when a later attempt succeeds.\n\n```go\ntype Config struct {\n\tAnalysis    reasoning.AnalysisConfig\n\tMaxAttempts int\n}\n```\nConfig configures an [Analyzer](#Analyzer). MaxAttempts defaults to 3.\n\n","path":"github.com/agentshield-dev/agentshield/pkg/reasoning/modelanalyzer","name":"modelanalyzer","synopsis":"Package modelanalyzer is the production reasoning.Analyzer: it connects a model client to the read-only MCP tools for one pinned analysis and retries failed attempts.","isRedistributable":true}
