Versions in this module Expand all Collapse all v0 v0.2.2 Oct 9, 2026 v0.2.1 Oct 8, 2026 Changes in this version + const AuditKeyFile + const EnvHarnessPipe + const EnvHarnessToken + var ErrBadFixtureStatus = errors.New("fixture device status must be pass, fail or error") + var ErrHarnessChannelLost = errors.New("agentweave-harness control channel lost") + var ErrPlanApprovalUnavailable = errors.New("no approvals webhook is configured") + var ErrPlanContainsPlanning = errors.New("a plan cannot contain Plan or Apply steps") + var ErrToolNotServed = errors.New("tool is not in the served surface") + var ErrUnknownPlan = errors.New("unknown plan_id; call Plan first") + func ApplyEffectiveConfig(ec wire.EffectiveConfig, enforceHTTPS *bool, deps *toolkit.BaseDeps, ...) + func AuditDestinationIsDir(dest string) bool + func AuditKeyDir(destination string) string + func AutoSealEvidence(tp policy.TransparencyPolicy, session string, plans []plan.Document, ...) + func BuildRungs(p RungPrimitives) map[string]RungFunc + func BundleEvidence(auditDir, session, recordingDir, outPath, keyFile string, ...) (evidence.Manifest, error) + func EgressStatus(svc *egress.Service, cfg policy.EgressPolicy) *status.EgressStatus + func EvaluatePolicy(ctx context.Context, devicePolicy *policy.Policy, reg *signals.Registry, ...) signals.Decision + func EvidenceSubdir(root, sub string) string + func ExportCredentials() export.Credentials + func ExportStatus(e policy.ExportPolicy, sink export.Sink) *status.ExportStatus + func GuardrailPaths(cfg GuardrailPathsConfig, p *policy.Policy) []toolkit.ProtectedPath + func HarnessAddress() (pipe, token string) + func HeartbeatFromAck(ack wire.HelloAck) time.Duration + func JourneyStatusMessage(passed bool, failed int, missing []string) string + func KillPolicyConfig(devicePolicy *policy.Policy) contain.KillActionConfig + func LoadPolicy(path string, reg *signals.Registry, logger *slog.Logger) (*policy.Policy, error) + func NewGuardrailRegistry(env EnvNames, logger *slog.Logger) *signals.Registry + func NewLogger(logFile string) (*slog.Logger, func(), error) + func ProvisionEgress(ctx context.Context, devicePolicy *policy.Policy, auditLog *audit.AuditLog, ...) (*egress.Service, func(), func(), error) + func ProvisionExport(devicePolicy *policy.Policy, auditLog *audit.AuditLog, logger *slog.Logger) export.Sink + func ReceivingChain(harnessEnforcing bool, auditMW mcp.Middleware, telemetryMW mcp.Middleware, ...) []mcp.Middleware + func ReconcileEvidence(expected []string, artifacts []toolkit.EvidenceArtifact) (captured, missing []string) + func ResolveAuditKey(env EnvNames, destination string, logger *slog.Logger) []byte + func ResolveStatusToken(t policy.TransparencyPolicy, logger *slog.Logger) (string, error) + func RugpullVerifier(rp *watch.RugPull, tools func() []*mcp.Tool, trip func(string)) watch.VerifyFunc + func ScrubSecretEnv(env EnvNames, devicePolicy *policy.Policy, logger *slog.Logger) + func SentinelToken(controlDir string, auditLog *audit.AuditLog, logger *slog.Logger) string + func SessionStamp() string + func SnapshotFn(startedAt time.Time, rp *watch.RugPull, hb *watch.Heartbeat, ...) status.SnapshotProvider + func TripFunc(trigger string, armed bool, kill *contain.KillSwitch, auditLog *audit.AuditLog, ...) func(string) + func ValidatePolicy(path string, reg *signals.Registry) (*policy.Policy, error) + func VerifyEvidence(zipPath, pubKeyHex string) (evidence.Report, error) + func WarnExportEgress(devicePolicy *policy.Policy, logger *slog.Logger) + func WithToolset(toolsets []string, id string) []string + func WriteRunRecord(dir, name, session string, rec *runrecord.Recorder) (string, error) + type DecisionHolder struct + func (h *DecisionHolder) Get() signals.Decision + func (h *DecisionHolder) Set(d signals.Decision) + type DialFunc func(addr string) (io.ReadWriteCloser, error) + type EgressRestoreHolder struct + func (h *EgressRestoreHolder) Run() error + func (h *EgressRestoreHolder) Set(fn func() error) + type EnforcementDescriber interface + Describe func() map[string]any + type EnvNames struct + Prefix string + func (e EnvNames) ApprovalKey() string + func (e EnvNames) AuditKey() string + func (e EnvNames) EvidenceKeyFile() string + func (e EnvNames) GraphClientID() string + func (e EnvNames) GraphClientSecret() string + func (e EnvNames) GraphTenant() string + func (e EnvNames) OTLPHeaders() string + func (e EnvNames) RemotePolicyToken() string + func (e EnvNames) Secrets() []string + type GuardrailPathsConfig struct + CredentialsFile string + Normalize toolkit.PathNormalizer + PolicyConfig string + type HarnessEgress struct + Executable string + Port int + func (h HarnessEgress) Announced() bool + type HarnessServant struct + func AttachHarness(dial DialFunc, pipe, token, serverVersion, sessionStamp string, ...) (*HarnessServant, wire.HelloAck, error) + func ConnectServant(conn io.ReadWriteCloser, token, serverVersion, sessionStamp string, ...) (*HarnessServant, wire.HelloAck, error) + func (s *HarnessServant) Close() error + func (s *HarnessServant) FireLost(err error) + func (s *HarnessServant) PushAuditAnchor(seq uint64, head string) error + func (s *HarnessServant) PushCredentialEvent(kind string, ids []string) error + func (s *HarnessServant) PushHeartbeat() error + func (s *HarnessServant) Serve(ctx context.Context) + func (s *HarnessServant) StartHeartbeat(ctx context.Context, interval time.Duration) + type InventoryRegistry struct + Deps any + Inv *inventory.Inventory + func (r InventoryRegistry) Has(tool string) bool + func (r InventoryRegistry) Invoke(ctx context.Context, tool string, rawArgs json.RawMessage) (*mcp.CallToolResult, error) + type JourneyReport struct + Completed int + Evidence []string + Failed int + Manifest string + MissingEvidence []string + Name string + Passed bool + PlanID string + Report string + RunRecord string + Skipped int + func RunJourney(ctx context.Context, raw []byte, name string, run JourneyRun) (JourneyReport, error) + type JourneyRun struct + AuditLog *audit.AuditLog + Deps any + Engine *policy.Engine + EvidenceRoot string + EvidenceSink toolkit.EvidenceSink + Inventory *inventory.Inventory + Logger *slog.Logger + ReadRegister toolkit.ReadRegister + ServiceName string + SessionStamp string + SetPlanner func(toolkit.Planner) + Version string + type JourneyTracer struct + func NewJourneyTracer(rec *runrecord.Recorder, origins []journeys.Origin, deps any, ...) *JourneyTracer + func (t *JourneyTracer) ObserveStep(e StepEvent) + type Planner struct + func NewPlanner(engine *policy.Engine, auditLog *audit.AuditLog, runner ToolRunner, ...) *Planner + func (p *Planner) Apply(ctx context.Context, planID string) (toolkit.PlanApplication, error) + func (p *Planner) Propose(ctx context.Context, rawPlan []byte) (toolkit.PlanProposal, error) + func (p *Planner) StoredPlans() []plan.Document + func (p *Planner) WithApprovals(approver enforce.Approver, sessionID string, timeout time.Duration) *Planner + func (p *Planner) WithReadRegister(r toolkit.ReadRegister) *Planner + func (p *Planner) WithStepObserver(fn func(StepEvent)) *Planner + type PolicyCoverage struct + Facts policy.ToolFacts + Known bool + Rules []PolicyCoverageRule + Signals []string + Tool string + func ExplainPolicy(devicePolicy *policy.Policy, reg *signals.Registry, index ToolIndex, ...) PolicyCoverage + type PolicyCoverageRule struct + Name string + OnFail string + Requires []string + type PolicyTestCaseResult struct + Detail string + Name string + OK bool + type PolicyTestReport struct + Cases []PolicyTestCaseResult + Fixture string + func RunPolicyFixtures(known []string, fixturePaths []string) ([]PolicyTestReport, error) + func (r PolicyTestReport) Passed() bool + type RungFunc func(params json.RawMessage) wire.ActuateResult + type RungPrimitives struct + Actuator contain.SystemActuator + Banner func(text string) + CleanupCreds func() + Egress egress.Enforcer + EgressRestore *EgressRestoreHolder + Finalize func() + Logger *slog.Logger + Seal func() error + SetRestore func(func() error) + type ServantDeps struct + Alive func() bool + Elevated bool + EnvFn func() *signals.Env + Logger *slog.Logger + OnLost func(error) + Registry *signals.Registry + RunContext signals.RunContext + Rungs map[string]RungFunc + type StepEvent struct + Detail string + Ended time.Time + Index int + Outcome StepOutcome + Started time.Time + Step plan.Step + Verdict string + type StepOutcome string + const StepFailed + const StepNotApproved + const StepOK + const StepRefused + type ToolIndex map[string]policy.ToolFacts + func NewToolIndex(ctx context.Context, inv *inventory.Inventory) ToolIndex + func (i ToolIndex) Lookup(tool string) (policy.ToolFacts, bool) + type ToolRunner interface + Has func(tool string) bool + Invoke func(ctx context.Context, tool string, rawArgs json.RawMessage) (*mcp.CallToolResult, error)