Skip to main content

Accuracy and testing

Accuracy is measured, never maintained by hand. The numbers that used to live on this page (a 123-case baseline from 2026-03-01, "6-layer pipeline") went stale within weeks and stayed here for six months. Regenerate rather than read.

WhatCommandOutput
Regex-only vs full-pipeline precision/recall over the whole corpusgo test -run 'TestAccuracyMetrics|TestPipelineAccuracyMetrics' ./internal/analyzer/ -timeout 40mstdout
Known false negativesgo test -run TestGenerateFailingTestsReport ./internal/analyzer/ -timeout 40mFAILING_TESTS.md (gitignored)
Red-team regression: shell pipeline, guardian, MCPgo test -run TestRedTeam ./internal/analyzer/ ./internal/guardian/ ./internal/mcp/ -timeout 40minternal/*/testdata/*_REDTEAM_REPORT.md (gitignored)
MCP scenario coverage (TP + TN per rule)make mcp-verifystdout
Rule counts (terminal / MCP / total)make coverageCOVERAGE.md
Latency budget (typical / adversarial P95)make test-perfstdout

Two things to know before running these:

  • The analyzer suite takes 20+ minutes. Under the default go test timeout (10m) it dies in a way that looks like a performance regression (#3236) — always pass -timeout.
  • TestAccuracyMetrics is static (regex only); TestPipelineAccuracyMetrics is the live metric and the one that responds to pipeline changes. The 2026-07-01 stage ablation was measured against the latter.

The case corpus lives in internal/analyzer/testdata/*.go, one file per threat kingdom. Never quote a corpus size or recall figure from a doc — quote the test output and the commit it ran on.

Self-test of an installed binary:

agentshield scan
Source

This reference page is maintained in the open-source AgentShield repository as docs/accuracy.md, release v0.3.202610051906.