shield

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package shield bridges the Shield safety engine to the Cortex safety.Scanner interface, following the same DI auto-discovery pattern as cortex/llm/nexus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EngineOption

func EngineOption(c vessel.Vessel) engine.Option

EngineOption returns an engine.Option that auto-discovers a Shield engine from the DI container and configures the cortex engine's safety scanner. If no shield engine is found, returns a no-op option (safe to always include).

Types

type Adapter

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

Adapter implements safety.Scanner by delegating to a shield engine.

func New

func New(eng *shieldengine.Engine) *Adapter

New creates a new Shield adapter from a shield engine.

func (*Adapter) ScanInput

func (a *Adapter) ScanInput(ctx context.Context, req *safety.ScanRequest) (*safety.ScanResult, error)

ScanInput scans input content via shield.

func (*Adapter) ScanOutput

func (a *Adapter) ScanOutput(ctx context.Context, req *safety.ScanRequest) (*safety.ScanResult, error)

ScanOutput scans output content via shield.

Jump to

Keyboard shortcuts

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