shieldguard

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package shieldguard adapts github.com/xraph/shield to the agent.Guard seam. It is opt-in: core/agent never imports shield. Wire it with forgeext.WithGuard(shieldguard.New(shieldExt.Engine())).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(s Scanner) agent.Guard

New builds a Guard over a shield Scanner (an *engine.Engine satisfies Scanner).

Types

type Guard

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

Guard adapts a shield Scanner to agent.Guard.

func (Guard) Guard

Guard scans in.Text through the shield engine and maps the verdict onto agent.GuardResult. GuardIngest scans input (user->agent), GuardEmit scans output (agent->user). On a scanner error it returns the error unmodified so the caller's applyGuard can apply the deployment's fail-closed/open policy.

type Scanner

type Scanner interface {
	ScanInput(ctx context.Context, in *scan.Input) (*scan.Result, error)
	ScanOutput(ctx context.Context, in *scan.Input) (*scan.Result, error)
}

Scanner is the subset of *engine.Engine this adapter needs (so it is testable without standing up a full shield engine).

Jump to

Keyboard shortcuts

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