redteam

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package redteam implements the AgentPaaS P1 red-team smoke gate.

Each fixture exercises the REAL pipeline (pack.BuildImage, runtime.DockerRuntime, secrets.Broker/Gateway, Block 11 operator handlers) — no synthetic harnesses, direct daemon shortcuts, or test-only enforcement paths.

The runner prints a 6-row containment table plus a signed audit-export verification summary. Gate: make block12-gate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintReport

func PrintReport(report *Report, w *os.File) error

PrintReport writes the containment table and JSON report to stdout.

Types

type AuditSummary

type AuditSummary struct {
	ExportPath     string `json:"export_path"`
	RecordCount    int    `json:"record_count"`
	ChainValid     bool   `json:"chain_valid"`
	SignatureValid bool   `json:"signature_valid"`
	Verdict        string `json:"verdict"`
}

AuditSummary captures the signed audit-export verification.

type Fixture

type Fixture interface {
	ID() string
	Name() string
	Run() FixtureResult
}

Fixture is a single red-team fixture.

type FixtureResult

type FixtureResult struct {
	ID           string        `json:"id"`
	Name         string        `json:"name"`
	Status       string        `json:"status"` // PASS, FAIL, SKIP
	Duration     time.Duration `json:"duration_ms"`
	Containment  string        `json:"containment"`   // BLOCKED, CONTAINED, REFUSED, LEAKED
	AuditVerdict string        `json:"audit_verdict"` // verified, missing, n/a
	Detail       string        `json:"detail"`
}

FixtureResult captures the outcome of a single red-team fixture.

type Report

type Report struct {
	Timestamp     string          `json:"timestamp"`
	Suite         string          `json:"suite"`
	TotalFixtures int             `json:"total_fixtures"`
	Passed        int             `json:"passed"`
	Failed        int             `json:"failed"`
	Skipped       int             `json:"skipped"`
	Results       []FixtureResult `json:"results"`
	AuditSummary  AuditSummary    `json:"audit_summary"`
}

Report is the full red-team containment report.

func (*Report) ContainmentTable

func (r *Report) ContainmentTable() string

ContainmentTable prints a 6-row containment table to the given writer.

func (*Report) JSON

func (r *Report) JSON() ([]byte, error)

JSON returns the machine-readable JSON report.

func (*Report) Verdict

func (r *Report) Verdict() string

Verdict returns the overall gate verdict: "6/6 PASS" or "N/6 PASS (M FAIL)".

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner executes red-team fixtures and produces a containment report.

func NewRunner

func NewRunner(fixtures ...Fixture) *Runner

NewRunner creates a Runner with the given fixtures.

func (*Runner) RunAll

func (r *Runner) RunAll() *Report

RunAll executes all fixtures and returns the report.

func (*Runner) RunFixture

func (r *Runner) RunFixture(id string) (*Report, error)

RunFixture executes a single fixture by ID.

Jump to

Keyboard shortcuts

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