Sentinel

Go Packages

Quick reference for all Sentinel Go packages and their public APIs.

All Sentinel packages are importable from github.com/xraph/sentinel.

Core packages

github.com/xraph/sentinel

Root package. Exports context helpers, error constants, and shared types.

ExportDescription
WithTenant(ctx, id)Inject tenant ID into context
WithApp(ctx, id)Inject app ID into context
TenantFromContext(ctx)Read tenant ID from context
AppFromContext(ctx)Read app ID from context
ConfigEngine configuration struct
DefaultConfig()Returns default Config values
EntityBase type with timestamps
NewEntity()Returns Entity with current timestamps
ErrNoStore, ErrStoreClosed, ErrMigrationFailedStore errors
ErrSuiteNotFound, ErrCaseNotFound, ErrRunNotFoundNot-found errors
ErrBaselineNotFound, ErrPromptVersionNotFoundNot-found errors
ErrSuiteAlreadyExistsConflict error
ErrInvalidState, ErrEmptyInputState errors
ErrNoTarget, ErrNoScorersEvaluation errors

github.com/xraph/sentinel/engine

The central Engine and all CRUD operations.

ExportDescription
New(...Option) (*Engine, error)Create an engine
Engine.Start(ctx)Initialize the engine
Engine.Stop(ctx)Graceful shutdown
Engine.CreateSuiteCreate a suite
Engine.GetSuiteGet suite by ID
Engine.GetSuiteByNameGet suite by name
Engine.ListSuitesList suites
Engine.UpdateSuiteUpdate a suite
Engine.DeleteSuiteDelete a suite
Engine.CreateCaseCreate a case
Engine.CreateCaseBatchCreate multiple cases
Engine.GetCaseGet case by ID
Engine.UpdateCaseUpdate a case
Engine.DeleteCaseDelete a case
Engine.ListCasesList cases for a suite
Engine.CountCasesCount cases for a suite
Engine.ImportCasesImport cases from file
Engine.GetRunGet run by ID
Engine.ListRunsList runs with filter
Engine.ListRunsBySuiteList runs for a suite
Engine.ListResultsList results for a run
Engine.GetResultStatsGet aggregate run stats
Engine.SaveBaselineSave a baseline
Engine.GetBaselineGet baseline by ID
Engine.GetLatestBaselineGet latest baseline for suite
Engine.ListBaselinesList baselines for suite
Engine.DeleteBaselineDelete a baseline
Engine.CreatePromptVersionCreate a prompt version
Engine.GetPromptVersionGet prompt version by ID
Engine.ListPromptVersionsList prompt versions
Engine.GetCurrentPromptVersionGet current prompt version
Engine.SetCurrentPromptVersionSet current prompt version
WithStore, WithConfig, WithExtension, WithLoggerEngine options

Entity packages

github.com/xraph/sentinel/suite

Suite entity and store interface. See Entities.

github.com/xraph/sentinel/testcase

Case entity, ScenarioType constants, ScorerConfig. See Entities.

github.com/xraph/sentinel/evalrun

Run, Result, RunTrace, ScorerResult, ResultStats. See Runs.

github.com/xraph/sentinel/baseline

Baseline and BaselineResult. See Baselines.

github.com/xraph/sentinel/promptversion

PromptVersion entity and store interface.

Evaluation packages

github.com/xraph/sentinel/scorer

Scorer interface, registry, and 22 built-in scorers.

Traditional scorers: exact, contains, not_contains, regex, json_valid, json_schema, length, latency, cost, llm_judge, semantic, hallucination, factual, custom

Persona-aware scorers: skill_usage, trait_consistency, behavior_trigger, cognitive_phase, communication_style, perception_focus, persona_coherence

github.com/xraph/sentinel/target

Target adapters for evaluation:

TypeDescription
LLMTargetDirect LLM API calls
AgentTargetAgent invocation with trace capture
FuncTargetWrap a plain function

github.com/xraph/sentinel/scenario

6 scenario generators: skill_challenge, trait_probe, behavior_trigger, cognitive_stress, comms_adaptation, perception_test

github.com/xraph/sentinel/redteam

5 adversarial attack generators: injection, jailbreak, leakage, hallucination, off-topic

github.com/xraph/sentinel/comparison

Multi-model comparison and baseline diff/regression detection.

github.com/xraph/sentinel/dataset

Data loaders (JSON, CSV, JSONL) and LLM-generated test case creation.

github.com/xraph/sentinel/report

Report generators: terminal, JSON, HTML, CI-friendly output.

Store packages

github.com/xraph/sentinel/store

Composite store interface embedding all subsystem stores.

github.com/xraph/sentinel/store/postgres

PostgreSQL backend via bun ORM with embedded migrations.

github.com/xraph/sentinel/store/sqlite

SQLite backend via bun ORM.

github.com/xraph/sentinel/store/memory

In-memory backend for testing.

Infrastructure packages

github.com/xraph/sentinel/plugin

Extension interfaces (16 hooks) and type-cached Registry.

github.com/xraph/sentinel/observability

func NewMetricsExtension() *MetricsExtension
func NewMetricsExtensionWithFactory(factory gu.MetricFactory) *MetricsExtension

github.com/xraph/sentinel/audit_hook

Audit trail extension with Recorder interface and RecorderFunc adapter.

github.com/xraph/sentinel/api

Forge-native HTTP handlers. New(eng, router) creates the API, RegisterRoutes(router) mounts all endpoints.

github.com/xraph/sentinel/extension

Forge framework extension adapter. New(...Option) creates the Forge extension.

ID package

github.com/xraph/sentinel/id

func NewSuiteID() SuiteID
func NewCaseID() CaseID
func NewEvalRunID() EvalRunID
func NewEvalResultID() EvalResultID
func NewBaselineID() BaselineID
func NewRedTeamID() RedTeamID
func NewPromptVersionID() PromptVersionID

func ParseSuiteID(s string) (SuiteID, error)
func ParseCaseID(s string) (CaseID, error)
func ParseEvalRunID(s string) (EvalRunID, error)
func ParseEvalResultID(s string) (EvalResultID, error)
func ParseBaselineID(s string) (BaselineID, error)
func ParseRedTeamID(s string) (RedTeamID, error)
func ParsePromptVersionID(s string) (PromptVersionID, error)

All IDs implement String() string and are based on TypeID (UUIDv7, K-sortable).

On this page