gating

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeniedCommands added in v0.1.0

func DeniedCommands() [][]string

DeniedCommands returns the deny list for adapters that project it into native rules.

Types

type Call added in v0.1.0

type Call struct {
	CWD     string
	Tool    string
	Command string
	Patch   string
	Path    string
	URL     string
}

Call is the normalized tool event consumed by every adapter hook.

func DecodeCall added in v0.1.0

func DecodeCall(r io.Reader) (Call, error)

DecodeCall accepts the vendor envelope at the boundary, not in the policy.

type Decision

type Decision struct {
	Allowed bool
	Reason  string
}

func Check added in v0.1.0

func Check(policy config.PolicyConfig, root string, call Call) Decision

Check normalizes names and shell token boundaries before Evaluate. It is an accident-prevention guardrail, not an adversarial shell or network sandbox.

func Evaluate

func Evaluate(policy config.PolicyConfig, worktreePath, tool string, args []string) Decision

Evaluate decides whether a role may execute a tool call. This is the enforcement point every backend adapter's PreToolUse-equivalent hook calls before letting a tool call through. Shell checks are guardrails, not isolation.

Jump to

Keyboard shortcuts

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