Documentation
¶
Overview ¶
Package aguara provides a public API for security scanning of AI agent skills and MCP server configurations.
This is the library entry point. For the CLI tool, see cmd/aguara/.
Index ¶
- Constants
- type ContextLine
- type Finding
- type Option
- func WithCategory(cat string) Option
- func WithCustomRules(dir string) Option
- func WithDisabledRules(ids ...string) Option
- func WithIgnorePatterns(patterns []string) Option
- func WithMinSeverity(sev Severity) Option
- func WithRuleOverrides(overrides map[string]RuleOverride) Option
- func WithWorkers(n int) Option
- type RuleDetail
- type RuleInfo
- type RuleOverride
- type ScanResult
- type Severity
Constants ¶
const ( SeverityInfo = types.SeverityInfo SeverityLow = types.SeverityLow SeverityMedium = types.SeverityMedium SeverityHigh = types.SeverityHigh SeverityCritical = types.SeverityCritical )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextLine ¶
type ContextLine = types.ContextLine
Re-export core types from internal/types so consumers don't need to import internal packages.
type Finding ¶
Re-export core types from internal/types so consumers don't need to import internal packages.
type Option ¶
type Option func(*scanConfig)
Option configures a scan operation.
func WithCategory ¶
WithCategory filters rules by category (only applies to ListRules).
func WithCustomRules ¶
WithCustomRules loads additional rules from a directory.
func WithDisabledRules ¶
WithDisabledRules excludes specific rule IDs from scanning.
func WithIgnorePatterns ¶
WithIgnorePatterns sets file patterns to ignore during directory scanning.
func WithMinSeverity ¶
WithMinSeverity sets the minimum severity threshold for reported findings.
func WithRuleOverrides ¶
func WithRuleOverrides(overrides map[string]RuleOverride) Option
WithRuleOverrides applies severity overrides or disables rules.
func WithWorkers ¶
WithWorkers sets the number of concurrent workers (default: NumCPU).
type RuleDetail ¶
type RuleDetail struct {
ID string `json:"id"`
Name string `json:"name"`
Severity string `json:"severity"`
Category string `json:"category"`
Description string `json:"description"`
Patterns []string `json:"patterns"`
TruePositives []string `json:"true_positives"`
FalsePositives []string `json:"false_positives"`
}
RuleDetail provides full information about a rule, including patterns and examples.
func ExplainRule ¶
func ExplainRule(id string, opts ...Option) (*RuleDetail, error)
ExplainRule returns detailed information about a specific rule.
type RuleInfo ¶
type RuleInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Severity string `json:"severity"`
Category string `json:"category"`
}
RuleInfo provides summary metadata about a detection rule.
type RuleOverride ¶
RuleOverride allows changing the severity of a rule or disabling it.
type ScanResult ¶
type ScanResult = types.ScanResult
Re-export core types from internal/types so consumers don't need to import internal packages.
func ScanContent ¶
func ScanContent(ctx context.Context, content string, filename string, opts ...Option) (*ScanResult, error)
ScanContent scans inline content without writing to disk. filename is a hint for rule target matching (e.g. "skill.md", "config.json").
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
aguara
command
|
|
|
internal
|
|
|
engine/rugpull
Package rugpull detects tool description changes (rug-pull attacks) by comparing current file content hashes against previously stored versions.
|
Package rugpull detects tool description changes (rug-pull attacks) by comparing current file content hashes against previously stored versions. |
|
engine/toxicflow
Package toxicflow detects dangerous capability combinations within a single skill or MCP server.
|
Package toxicflow detects dangerous capability combinations within a single skill or MCP server. |
|
state
Package state provides a persistent JSON store for tracking file content hashes across scan runs.
|
Package state provides a persistent JSON store for tracking file content hashes across scan runs. |