Documentation
¶
Overview ¶
nolint:lll
nolint:lll
Index ¶
- Constants
- Variables
- func LoadLocalRules() ([]api.AiPrompt, error)
- type AgentOption
- type DetectionAgent
- func (agent *DetectionAgent) Detect(ctx context.Context, scanData *model.ScanData) (*DetectionResult, error)
- func (agent *DetectionAgent) DetermineViolationLocation(ctx context.Context, scanData *model.ScanData, ...) (*LocationDeterminationResult, error)
- func (agent *DetectionAgent) VerifyViolation(ctx context.Context, scanData *model.ScanData, ...) (*VerificationResult, error)
- type DetectionResult
- type LocationDeterminationResult
- type LocationDeterminationResultData
- type VerificationResult
- type VerificationResultData
- type VerificationResultInternal
Constants ¶
View Source
const LocationDeterminationSystemPrompt = `` /* 933-byte string literal not displayed */
View Source
const LocationDeterminationUserPrompt = `` /* 734-byte string literal not displayed */
View Source
const VerificationSystemPrompt = `` /* 1592-byte string literal not displayed */
View Source
const VerificationUserPrompt = `` /* 1249-byte string literal not displayed */
Variables ¶
View Source
var EmbeddedAgentRules embed.FS
Functions ¶
func LoadLocalRules ¶ added in v0.0.10
LoadLocalRules returns one api.AiPrompt per embedded *.md file in this package. The filename (without extension) is converted to a rule ID by replacing the first dash with a slash: "datadog-go-sqli.md" -> "datadog/go-sqli". When the language token in the filename maps to a known glob, the rule is scoped to that language; otherwise it falls back to "**/*".
Types ¶
type AgentOption ¶
type DetectionAgent ¶
type DetectionAgent struct {
// contains filtered or unexported fields
}
func NewDetectionAgent ¶
func NewDetectionAgent(ctx context.Context, agentOption *AgentOption) (*DetectionAgent, error)
func (*DetectionAgent) Detect ¶
func (agent *DetectionAgent) Detect(ctx context.Context, scanData *model.ScanData) (*DetectionResult, error)
func (*DetectionAgent) DetermineViolationLocation ¶ added in v0.0.7
func (agent *DetectionAgent) DetermineViolationLocation(ctx context.Context, scanData *model.ScanData, violation model.LLMResultViolation, verification *VerificationResult) (*LocationDeterminationResult, error)
func (*DetectionAgent) VerifyViolation ¶
func (agent *DetectionAgent) VerifyViolation(ctx context.Context, scanData *model.ScanData, violation model.LLMResultViolation) (*VerificationResult, error)
type DetectionResult ¶
type LocationDeterminationResult ¶ added in v0.0.7
type LocationDeterminationResult struct {
LocationDeterminationResultData
InputTokens int32
OutputTokens int32
}
type LocationDeterminationResultData ¶ added in v0.0.7
type VerificationResult ¶
type VerificationResult struct {
VerificationResultData
InputTokens int32 `json:"input_tokens"`
OutputTokens int32 `json:"output_tokens"`
}
type VerificationResultData ¶
Click to show internal directories.
Click to hide internal directories.