--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.22.0 name: harnesses.api.kagent.dev spec: group: api.kagent.dev names: categories: - kagent kind: Harness listKind: HarnessList plural: harnesses singular: harness scope: Namespaced versions: - additionalPrinterColumns: - jsonPath: .metadata.creationTimestamp name: Age type: date name: v1alpha3 schema: openAPIV3Schema: description: Harness defines a reusable agent runtime and infrastructure policy. properties: apiVersion: description: |- APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: description: |- Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object spec: description: HarnessSpec defines a reusable runtime and its infrastructure policy. properties: byo: description: BYOHarness selects an image that implements kagent's private A2A contract. type: object claude: description: ClaudeHarness selects the Claude runtime adapter. type: object codex: description: CodexHarness selects the Codex runtime adapter. type: object env: items: description: RuntimeEnvVar configures one literal runtime environment variable. properties: name: minLength: 1 type: string value: description: Value is a literal value, including an empty string. type: string required: - name - value type: object maxItems: 100 type: array x-kubernetes-list-map-keys: - name x-kubernetes-list-type: map kagent: description: KagentHarness configures the kagent runtime adapter. properties: compaction: description: |- Compaction summarizes older session events so the prompt stays small as a conversation grows. Omitted leaves the history uncompacted. properties: compactionInterval: description: |- CompactionInterval is the number of new user-initiated invocations that, once fully represented in the session, triggers a sliding-window compaction of those invocations. minimum: 1 type: integer eventRetentionSize: description: |- EventRetentionSize is the number of most recent events that tail retention keeps uncompacted. minimum: 1 type: integer overlapSize: description: |- OverlapSize is the number of already-compacted invocations pulled back into the next sliding window so consecutive summaries overlap. minimum: 0 type: integer summarizer: description: |- Summarizer selects the model and prompt that write the summaries. Omitted summarizes with the agent's own model and the runtime's default prompt. properties: modelConfigRef: description: |- ModelConfigRef references the ModelConfig (defaulting to the Harness namespace) that writes the summaries. Omitted uses the agent's own model. properties: name: maxLength: 253 minLength: 1 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string namespace: maxLength: 63 pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string required: - name type: object x-kubernetes-validations: - message: name must not be empty rule: has(self.name) && self.name != '' promptTemplate: description: |- PromptTemplate replaces the runtime's default summarization prompt. It must contain {conversation_history}, which the runtime replaces with the rendered events. minLength: 1 type: string type: object x-kubernetes-validations: - message: promptTemplate must contain {conversation_history} rule: '!has(self.promptTemplate) || self.promptTemplate.contains(''{conversation_history}'')' tokenThreshold: description: |- TokenThreshold is the prompt token count at which tail-retention compaction summarizes the history before the next model call. minimum: 1 type: integer type: object x-kubernetes-validations: - message: tokenThreshold and eventRetentionSize must be specified together rule: has(self.tokenThreshold) == has(self.eventRetentionSize) - message: overlapSize requires compactionInterval rule: '!has(self.overlapSize) || has(self.compactionInterval)' - message: at least one of the fields in [compactionInterval tokenThreshold] must be set rule: has(self.compactionInterval)||has(self.tokenThreshold) memory: description: Memory enables long-term memory for agents using this Harness. properties: modelConfigRef: description: ModelConfigRef references the embedding ModelConfig (defaulting to the Harness namespace). properties: name: maxLength: 253 minLength: 1 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string namespace: maxLength: 63 pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string required: - name type: object ttlDays: description: TTLDays controls how many days a stored memory entry remains valid. minimum: 1 type: integer required: - modelConfigRef type: object x-kubernetes-validations: - message: modelConfigRef name must not be empty rule: self.modelConfigRef.name.size() > 0 type: object substrate: description: RuntimeSubstratePolicy contains the Substrate policy shared by all runtime variants. properties: snapshotPolicy: description: SnapshotPolicy configures runtime snapshot storage. properties: location: description: Location is the snapshot storage location used by Substrate. pattern: ^[^[:space:]]+$ type: string required: - location type: object workerPoolRef: description: WorkerPoolRef references a WorkerPool in the resource's namespace. properties: name: default: "" description: |- Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic required: - snapshotPolicy - workerPoolRef type: object x-kubernetes-validations: - message: workerPoolRef name must not be empty rule: self.workerPoolRef.name.size() > 0 workload: description: Workload overrides the built-in runtime image and its command. BYO requires it. properties: args: description: Args overrides the image command arguments when set. items: type: string maxItems: 64 type: array command: description: Command overrides the image entrypoint when set. items: type: string maxItems: 32 type: array image: description: |- Image overrides the release's built-in runtime image. BYO requires an image. When set, it must be an OCI image reference pinned by sha256 digest. pattern: ^[^[:space:]@]+@sha256:[a-f0-9]{64}$ type: string type: object required: - substrate type: object x-kubernetes-validations: - message: BYO harnesses must specify workload.command rule: '!has(self.byo) || (has(self.workload) && has(self.workload.command) && size(self.workload.command) > 0)' - message: BYO harnesses must specify workload.image rule: '!has(self.byo) || (has(self.workload) && has(self.workload.image))' - message: exactly one of the fields in [kagent codex claude byo] must be set rule: (has(self.kagent)?1:0)+(has(self.codex)?1:0)+(has(self.claude)?1:0)+(has(self.byo)?1:0) == 1 required: - spec type: object served: true storage: true subresources: {}