Overview
Aguara re-exports core types from internal packages so you don’t need to import internal dependencies.ScanResult
Source:internal/types/types.go:100
Holds the complete results of a scan operation.
Fields
| Field | Type | Description |
|---|---|---|
Findings | []Finding | All detected security issues |
FilesScanned | int | Number of files analyzed |
RulesLoaded | int | Number of detection rules loaded |
Duration | time.Duration | Scan duration (not serialized to JSON) |
Target | string | Scan target path (not serialized to JSON) |
JSON Marshaling
When serialized to JSON,Duration is converted to duration_ms (milliseconds):
Example
Finding
Source:internal/types/types.go:66
Represents a single security finding.
Fields
| Field | Type | Description |
|---|---|---|
RuleID | string | Rule identifier (e.g., "PROMPT_INJECTION_001") |
RuleName | string | Human-readable rule name |
Severity | Severity | Severity level (0-4) |
Category | string | Rule category (e.g., "prompt-injection") |
Description | string | What the rule detects |
FilePath | string | File path where issue was found |
Line | int | Line number (1-indexed) |
Column | int | Column number (0-indexed) |
MatchedText | string | Text that triggered the rule |
Context | []ContextLine | Surrounding lines of code |
Score | float64 | Risk score (0-100) |
Confidence | float64 | Detection confidence (0-100) |
Remediation | string | How to fix the issue |
Analyzer | string | Which analyzer detected it ("pattern", "nlp-injection", "toxicflow", "rugpull") |
InCodeBlock | bool | True if match is inside a fenced code block (markdown only) |
Example
Severity
Source:internal/types/types.go:13
Represents the severity level of a finding.
Methods
String()
"INFO", "LOW", "MEDIUM", "HIGH", "CRITICAL", or "UNKNOWN".
Example:
Functions
ParseSeverity()
Source:internal/types/types.go:41
Severity level (case-insensitive, whitespace trimmed).
Example:
JSON Serialization
Severity serializes to an integer in JSON:Comparison
ContextLine
Source:internal/types/types.go:59
Represents a line of source code around a finding.
Fields
| Field | Type | Description |
|---|---|---|
Line | int | Line number (1-indexed) |
Content | string | Full line content |
IsMatch | bool | True if this is the line that matched |
Example
RuleOverride
Source:aguara.go:54
Allows changing the severity of a rule or disabling it.
Fields
| Field | Type | Description |
|---|---|---|
Severity | string | New severity: "critical", "high", "medium", "low", "info" |
Disabled | bool | If true, rule is completely disabled |
Example
RuleInfo
Source:aguara.go:60
Provides summary metadata about a detection rule.
Example
RuleDetail
Source:aguara.go:68
Provides full information about a rule, including patterns and examples.
Example
Discovery Types
Re-exported from thediscover package:
Related
- Scan() - Returns
ScanResult - ScanContent() - Returns
ScanResult - ListRules() - Returns
[]RuleInfo - ExplainRule() - Returns
*RuleDetail
