corpus

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: GPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package corpus is a public, labelled set of poisoned and ordinary MCP tool definitions and tool results, and the measurement of how well agentgate's scanners tell them apart. The numbers are not a claim; they are what `go test ./corpus` measures on every commit, misses and false alarms included, so a change to a scanner shows what it gains and costs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Markdown

func Markdown(scores ...Score) string

Markdown is the measurement as a docs block: rates, and every miss and false alarm by name.

Types

type Definition

type Definition struct {
	ID        string              `yaml:"id"`
	Attack    bool                `yaml:"attack"`
	Technique string              `yaml:"technique"`
	Others    []pinning.OtherTool `yaml:"others"`
	Def       map[string]any      `yaml:"def"`
}

Definition is one labelled definition.

func Definitions

func Definitions() ([]Definition, error)

Definitions loads the definition corpus.

func (Definition) Definition

func (d Definition) Definition() (pinning.Definition, error)

Definition turns the YAML definition into what the scanner reads.

type Outcome

type Outcome struct {
	ID        string
	Attack    bool
	Technique string
	Flagged   bool
	Why       string
}

Outcome is one entry's verdict.

type Result

type Result struct {
	ID        string `yaml:"id"`
	Attack    bool   `yaml:"attack"`
	Technique string `yaml:"technique"`
	Text      string `yaml:"text"`
}

Result is one labelled tool result.

func Results

func Results() ([]Result, error)

Results loads the result corpus.

type Score

type Score struct {
	Name                 string
	Attacks, Benign      int
	Caught, FalseAlarms  int
	Missed, FalseAlarmed []Outcome
}

Score is how one scanner did on one corpus.

func ScoreDefinitions

func ScoreDefinitions() (Score, error)

ScoreDefinitions runs the definition scanner over the corpus.

func ScoreResults

func ScoreResults() (Score, error)

ScoreResults runs the result scanner over the corpus.

func (Score) Detection

func (s Score) Detection() float64

Detection is the share of attacks caught.

func (Score) FalseAlarmRate

func (s Score) FalseAlarmRate() float64

FalseAlarmRate is the share of benign entries flagged.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL