Documentation
¶
Overview ¶
Package sentinel provides a composable AI evaluation and testing framework for Go. It tests AI agents the way you'd evaluate a human — skills, traits, behaviors, cognition, communication, perception.
Sentinel supports defining eval suites, running them across providers, detecting regressions, and integrating with CI. It is tenant-scoped, plugin-extensible, Forge-native, and Cortex-aware.
The Human-Like Testing Model ¶
Traditional AI eval: input → LLM → output → score.
Sentinel's human-like eval: scenario → agent (persona) → observe skills, traits, behaviors, cognition, communication, perception → multi-dimensional score.
Evaluation Dimensions ¶
- Skill: Can the agent do the job? Tool selection, proficiency, correctness.
- Trait: Who is the agent? Personality consistency across interactions.
- Behavior: How does it react? Trigger-action patterns fire correctly.
- Cognition: How does it think? Phase transitions, depth, focus.
- Communication: How does it talk? Tone, formality, verbosity.
- Perception: What does it notice? Attention focus, detail orientation.
- Persona: The whole person — end-to-end identity coherence.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Store errors. ErrNoStore = errors.New("sentinel: no store configured") ErrStoreClosed = errors.New("sentinel: store closed") ErrMigrationFailed = errors.New("sentinel: migration failed") // Not found errors. ErrEvaluationPlanNotFound = errors.New("sentinel: evaluation plan not found") ErrEvaluationPlanExists = errors.New("sentinel: evaluation plan already exists") ErrSuiteNotFound = errors.New("sentinel: suite not found") ErrCaseNotFound = errors.New("sentinel: case not found") ErrRunNotFound = errors.New("sentinel: run not found") ErrBaselineNotFound = errors.New("sentinel: baseline not found") ErrPromptVersionNotFound = errors.New("sentinel: prompt version not found") // Conflict errors. ErrSuiteAlreadyExists = errors.New("sentinel: suite already exists") ErrPromptVersionExists = errors.New("sentinel: prompt version already exists") // State errors. ErrInvalidState = errors.New("sentinel: invalid state transition") ErrRunCancelled = errors.New("sentinel: run cancelled") ErrEmptyInput = errors.New("sentinel: empty input") // Evaluation errors. ErrNoTarget = errors.New("sentinel: no target configured") ErrNoScorers = errors.New("sentinel: no scorers configured") ErrUnknownTarget = errors.New("sentinel: unknown target") ErrUnknownScorer = errors.New("sentinel: unknown scorer") ErrInvalidInput = errors.New("sentinel: invalid input") ErrUnsupportedFormat = errors.New("sentinel: unsupported format") )
Functions ¶
func AppFromContext ¶
AppFromContext extracts the app identifier from the context. Returns an empty string if no app is set.
func TenantFromContext ¶
TenantFromContext extracts the tenant identifier from the context. Returns an empty string if no tenant is set.
Types ¶
type Config ¶
type Config struct {
// DefaultModel is the LLM model name used when a suite does
// not specify one. Special values "smart" and "fast" are resolved
// by the target adapter.
DefaultModel string
// Temperature is the default LLM temperature for evaluations. A run
// uses its suite's temperature when that is non-zero and this value
// otherwise, so a suite temperature of 0 inherits it.
Temperature float64
// PassThreshold is the minimum score (0-1) for a case to pass.
PassThreshold float64
// RegressionThreshold is how far a metric may fall below the current
// baseline, as an absolute amount on its 0 to 1 scale, before a run
// counts as regressed. One value covers pass rate, average score, each
// dimension and each case, and lower is always worse.
RegressionThreshold float64
// Concurrency is the maximum number of cases evaluated in parallel.
Concurrency int
// ShutdownTimeout is the maximum time to wait for graceful shutdown.
ShutdownTimeout time.Duration
}
Config holds configuration for the Sentinel engine.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config with sensible defaults.
type Context ¶
Context is the execution context for Sentinel operations. It is a simple alias for context.Context. Scope is injected via forge.WithScope on the stdlib context.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api provides Forge-style HTTP handlers for the Sentinel evaluation engine.
|
Package api provides Forge-style HTTP handlers for the Sentinel evaluation engine. |
|
Package baseline defines evaluation baselines for regression detection.
|
Package baseline defines evaluation baselines for regression detection. |
|
Package comparison enables side-by-side evaluation of multiple models or configurations against the same suite.
|
Package comparison enables side-by-side evaluation of multiple models or configurations against the same suite. |
|
Package dataset provides utilities for loading, generating, and sampling test case data from various formats.
|
Package dataset provides utilities for loading, generating, and sampling test case data from various formats. |
|
Package engine provides the central Sentinel evaluation coordinator.
|
Package engine provides the central Sentinel evaluation coordinator. |
|
Package evalplan defines immutable evaluation inputs and scorer identities.
|
Package evalplan defines immutable evaluation inputs and scorer identities. |
|
Package evalrun defines evaluation runs and their results — the execution records of running a suite against a target.
|
Package evalrun defines evaluation runs and their results — the execution records of running a suite against a target. |
|
Package extension adapts the Sentinel engine as a Forge extension.
|
Package extension adapts the Sentinel engine as a Forge extension. |
|
contract
Package contract wires Sentinel into the Forge dashboard's contract path.
|
Package contract wires Sentinel into the Forge dashboard's contract path. |
|
Package id defines TypeID-based identity types for all Sentinel entities.
|
Package id defines TypeID-based identity types for all Sentinel entities. |
|
internal
|
|
|
telemetry
Package telemetry holds the span helpers sentinel's packages share, so every span records an error the same way.
|
Package telemetry holds the span helpers sentinel's packages share, so every span records an error the same way. |
|
Package observability provides a metrics extension for Sentinel that records lifecycle event counts via go-utils MetricFactory.
|
Package observability provides a metrics extension for Sentinel that records lifecycle event counts via go-utils MetricFactory. |
|
Package plugin defines the plugin system for Sentinel.
|
Package plugin defines the plugin system for Sentinel. |
|
Package promptversion tracks system prompt iterations for A/B testing and regression tracking across prompt changes.
|
Package promptversion tracks system prompt iterations for A/B testing and regression tracking across prompt changes. |
|
Package recorded defines captured execution evidence and durable evaluation work.
|
Package recorded defines captured execution evidence and durable evaluation work. |
|
Package redteam provides adversarial testing generators for AI safety evaluation.
|
Package redteam provides adversarial testing generators for AI safety evaluation. |
|
Package report generates human-readable and machine-readable reports from evaluation runs.
|
Package report generates human-readable and machine-readable reports from evaluation runs. |
|
Package scenario provides test case generators for persona-aware evaluation scenarios.
|
Package scenario provides test case generators for persona-aware evaluation scenarios. |
|
Package scorer defines the interface and built-in implementations for evaluating AI outputs.
|
Package scorer defines the interface and built-in implementations for evaluating AI outputs. |
|
Package sentineltest provides test assertions for evaluation results.
|
Package sentineltest provides test assertions for evaluation results. |
|
Package store defines the composite store interface for Sentinel.
|
Package store defines the composite store interface for Sentinel. |
|
memory
Package memory provides an in-memory implementation of the Sentinel composite store.
|
Package memory provides an in-memory implementation of the Sentinel composite store. |
|
mongo
Package mongo provides a MongoDB implementation of the Sentinel composite store using grove ORM with the mongodriver.
|
Package mongo provides a MongoDB implementation of the Sentinel composite store using grove ORM with the mongodriver. |
|
postgres
Package postgres provides a PostgreSQL implementation of the Sentinel composite store using grove ORM with Go-based migrations.
|
Package postgres provides a PostgreSQL implementation of the Sentinel composite store using grove ORM with Go-based migrations. |
|
sqlite
Package sqlite provides a SQLite implementation of the Sentinel composite store using grove ORM with the sqlitedriver.
|
Package sqlite provides a SQLite implementation of the Sentinel composite store using grove ORM with the sqlitedriver. |
|
storetest
Package storetest is the conformance suite every Sentinel store backend runs.
|
Package storetest is the conformance suite every Sentinel store backend runs. |
|
Package suite defines evaluation suites — named collections of test cases targeting a specific system prompt, model, and optional persona.
|
Package suite defines evaluation suites — named collections of test cases targeting a specific system prompt, model, and optional persona. |
|
Package target defines the interface for evaluation targets — the system under test.
|
Package target defines the interface for evaluation targets — the system under test. |
|
Package testcase defines test cases — individual evaluation scenarios within a suite.
|
Package testcase defines test cases — individual evaluation scenarios within a suite. |