Documentation
¶
Overview ¶
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT
SPDX-License-Identifier: MIT
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Categories = []string{
"prompt-injection",
"jailbreak",
"extraction",
"guardrail-bypass",
"owasp-llm",
"hallucination",
"harmful-content",
"bias",
}
Categories is the list of all valid probe categories.
Functions ¶
func CountByCategory ¶
CountByCategory returns a map of category → probe count.
func ValidCategory ¶
ValidCategory returns true if the given category is valid.
Types ¶
type Case ¶
type Case struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Input string `yaml:"input"`
Judge JudgeDef `yaml:"judge"`
}
Case is a single test case within a probe suite.
type Indicator ¶
type Indicator struct {
Contains string `yaml:"contains,omitempty"`
ContainsAny []string `yaml:"contains_any,omitempty"`
Regex string `yaml:"regex,omitempty"`
StartsWith string `yaml:"starts_with,omitempty"`
}
Indicator is a single matching rule used by the judge.
type JudgeDef ¶
type JudgeDef struct {
SuccessIndicators []Indicator `yaml:"success_indicators"`
FailureIndicators []Indicator `yaml:"failure_indicators"`
LLMJudgeCriteria string `yaml:"llm_judge_criteria,omitempty"`
}
JudgeDef defines the success and failure indicators for judging a probe result.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads probe suites from an embed.FS or os filesystem.
func NewLoader ¶
NewLoader creates a probe loader that reads from the given filesystem. Typically pass autoattack.EmbeddedProbes for the embedded probe library.
type Resolved ¶
type Resolved struct {
SuiteID string
Version int
Category string
Subcategory string
Severity Severity
OWASPLLM string
CaseID string
CaseName string
Input string
Judge JudgeDef
}
Resolved is a flattened probe ready for execution, combining suite metadata with a specific case.
func FilterByCategories ¶
FilterByCategories filters resolved probes to only include specified categories.
func FilterByOWASP ¶
FilterByOWASP filters resolved probes to only those with an OWASP LLM tag.
type Suite ¶
type Suite struct {
ID string `yaml:"id"`
Version int `yaml:"version"`
Name string `yaml:"name"`
Category string `yaml:"category"`
Subcategory string `yaml:"subcategory"`
Severity Severity `yaml:"severity"`
OWASPLLM string `yaml:"owasp_llm"`
Description string `yaml:"description"`
References []string `yaml:"references"`
Cases []Case `yaml:"cases"`
}
Suite is a collection of test cases loaded from a single YAML file.