agentruntimepolicy

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package agentruntimepolicy resolves registered external runtime policy for Task producers that must materialize the exact brokered tool request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaterializeRuntimeRefAllowedTools

func MaterializeRuntimeRefAllowedTools(task *corev1alpha1.Task, policy *RuntimeRefPolicy) error

MaterializeRuntimeRefAllowedTools copies the registered harness-v2 allowlist into a generated Task while preserving an explicit empty list.

func ResolveAndMaterializeRuntimeRefAllowedTools

func ResolveAndMaterializeRuntimeRefAllowedTools(
	ctx context.Context,
	reader client.Reader,
	task *corev1alpha1.Task,
	agent *corev1alpha1.Agent,
) error

ResolveAndMaterializeRuntimeRefAllowedTools resolves an Agent's registered policy and materializes its exact allowlist into a generated Task.

func ResolveAndMaterializeTaskRuntimeRefAllowedTools

func ResolveAndMaterializeTaskRuntimeRefAllowedTools(
	ctx context.Context,
	reader client.Reader,
	task *corev1alpha1.Task,
) error

ResolveAndMaterializeTaskRuntimeRefAllowedTools loads the Agent referenced by a generated Task and materializes the registered harness-v2 allowlist.

func ResolveAndReplaceTaskRuntimeRefAllowedTools

func ResolveAndReplaceTaskRuntimeRefAllowedTools(
	ctx context.Context,
	reader client.Reader,
	task *corev1alpha1.Task,
) error

ResolveAndReplaceTaskRuntimeRefAllowedTools resolves the Agent referenced by a copied Task and replaces inherited runtime overrides for external harness-v2 execution with the registered allowlist. Built-in and harness-v1 settings are preserved unchanged.

Types

type RuntimeRefPolicy

type RuntimeRefPolicy struct {
	ProviderKind    string
	Model           string
	WorkspaceIntent corev1alpha1.WorkspaceIntent
	AllowedTools    []string
	DisallowedTools []string
	AllowBash       bool
}

RuntimeRefPolicy is the registered harness-v2 policy a generated Task must explicitly request. The AgentRuntime remains the policy authority.

func PolicyForRuntime

func PolicyForRuntime(runtime *corev1alpha1.AgentRuntime) (*RuntimeRefPolicy, error)

PolicyForRuntime returns the registered harness-v2 policy from an already resolved AgentRuntime. Other contracts return a nil policy.

func ResolveRuntimeRefPolicy

func ResolveRuntimeRefPolicy(
	ctx context.Context,
	reader client.Reader,
	namespace string,
	agent *corev1alpha1.Agent,
) (*RuntimeRefPolicy, error)

ResolveRuntimeRefPolicy resolves an Agent's external harness-v2 policy. Built-in and harness-v1 Agents return a nil policy.

Jump to

Keyboard shortcuts

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