The agent runtime

An agent combines a tenant-scoped Agent, an AgentTemplate describing its behavior, and a Harness selecting its runtime. Sessions execute through Substrate workers. An agent definition is not a dedicated, always-running Deployment.

The pinned contract

The platform targets kagent 1.0.1, with Go source pinned to 558e3d761d8ed2b0d23bfef1867a9d1915210121. Its resources use api.kagent.dev/v1alpha3; Substrate (1.0.0) resources use ate.dev/v1. The cluster runs the kagent chart’s own controller at that version, one replica; the platform does not fork it.

Resource Responsibility
AgentTemplate Prompt, model, skill selection and tool bindings
Agent References a template and the tenant’s Harness
Harness Selects the runtime image, WorkerPool and snapshot location
WorkerPool Supplies the tenant’s Substrate execution capacity
Session and task Runtime state reached through kagent’s APIs, not Kubernetes custom resources

The tenant baseline creates the spooky-kagent Harness and tenant WorkerPool. CreateAgent validates the requested configuration and establishes the required model, credentials and tool bindings before writing the agent resources. It requires at least one schedule and writes the schedules to kagent’s ScheduledRunService right after the Agent, since kagent schedules only an Agent that exists: agents are headless, a schedule is the only thing that starts a run, and an empty list is refused with InvalidArgument before anything is written. A schedule that still cannot be written after retries takes the agent back with it. Kubernetes acceptance does not mean a session has started, and the multiple resource writes are not a database transaction. A durable creation reservation assigns the immutable agent UID before brokerage and credential publication. A matching retry reuses that UID; a background reconciler repairs accepted agents whose configuration publication or activation was interrupted. New work remains blocked while creation is incomplete.

Upstream documentation moves faster than this pin.

Current kagent 1.x documentation describes the same Agent, AgentTemplate and Harness custom resources, with sessions in kagent’s PostgreSQL rather than in etcd (read 2026-11-07), and it tracks kagent’s main branch, so it can run ahead of the 1.0.1 pin. Use the pinned API when changing this integration; do not transplant current-main examples without an upgrade.

See the pinned API source and current upstream concepts.

Skills and native tools

The skills catalog comes from the Spooky-Labs/skills Git plugin package. The custom runtime image bakes its selected package revision into /plugins/plugin-0; the image digest and skills_package_commit travel together in the deployment pin file. The legacy RPC name ListContainerSkills now lists this package. It does not enumerate OCI images.

An explicit skill selection must resolve in the catalog. An empty selection uses the defaults; disable_workspace_tools selects no skills. A skill provides instructions and resources for existing tools. Its presence alone does not create an arbitrary new native tool or MCP server.

The runtime keeps skill discovery/loading and workspace file tools when the skills capability is enabled. The native bash tool and kagent’s ask_user tool are off for every agent and subagent through kagent’s Helm values config.runtimeDefaults.builtinTools.disableBash and disableAskUser, set on the kagent release in iac gcp/workloads/kagent.tf; the runtime image carries only the cached-plugin source patch. Agents are headless (owner decision 2026-10-04): nothing answers an agent during a run, so no tool may stop a run to wait for a person. The platform MCP server exposes scheduling tools, not a replacement shell or code runner. See Runtime isolation.

Each existing package cache must carry a source marker matching the requested repository, commit and path, or the applicable OCI/S3 source fields. Missing, malformed or mismatching markers stop materialization before agent construction and server startup. The image build validates packaged skills with the pinned ADK parser and records that source marker. Missing or renamed selected skills also fail instead of silently selecting alternatives.

This check runs when each runtime starts. It is not an API check that the deployed image supports all saved skill revisions, or a cluster-wide promotion gate. A new catalog pin does not rewrite existing agents: preserve compatibility with their saved sources when promoting runtime images.

Capabilities and edits

Skills, workspace-tool choices, delegation targets, tool bindings and paper-trading markets are fixed at creation, and no RPC edits an agent afterwards: changing those choices requires a new agent. AgentSpec has no arbitrary tools, mcp_servers, memory or workspace fields. Each delegation target’s SubagentRef.description becomes the description of kagent’s subagent binding, which the parent’s model reads to decide when to hand work over; an empty one names the child.

Agent read-back includes selected skills with source URL, commit, path or OCI reference, workspace_tools_enabled and native_tools. Without skills the native inventory is empty. With skills enabled it is list_skills, load_skill, load_skill_resource, read_file, write_file and edit_file. It does not advertise native Bash, ask_user or optional file tools that this runtime does not enable.

The supported capabilities are:

Capability How it is supplied
Model inference A catalog model through the platform’s model gateway
Prompt composition System prompt plus prompt fragments (guide)
Skills and files Pinned plugin skills plus the runtime’s file tools
Tool approval None. No write path sets requireApproval, so no run pauses; see Streaming
Delegation Named agents in the same tenant; self, duplicate and cross-namespace targets are refused
Scheduling kagent’s scheduler, the only way a run starts: at least one schedule set at creation, Run now on one of them (refused while a run of the agent is still going), and the agent’s own one-shot wakes through the platform MCP tools schedule_wake, list_wakes and cancel_wake. A wake must be at least the tenant’s min_schedule_interval_seconds ahead and at most 30 days out, and an agent holds at most max_wakes_per_day pending wakes
Paper trading Brokerage tools filtered to the agent’s configured markets
Public data Twelve free tools, included with every agent: ten over official public sources (SEC, EIA, CFTC, World Bank, GLEIF, NWS) and two that search and read news the platform’s crawler captured; see Public data tools

Tool availability also depends on configured services. The API’s read-back and runtime bindings, not a count inferred from selected skills, determine what an agent can call.

Prompt fragments come from two ConfigMap libraries in the tenant namespace: platform-prompts (include alias platform), read-only to tenants because the baseline rewrites it on every pass, and tenant-prompts (alias tenant), the tenant’s own. CreateAgent resolves every include against those libraries at write time, then dry-runs the template with kagent’s own semantics and the four values it fills in (.AgentTemplateName, .AgentTemplateNamespace, .Description and .ToolNames), so an unknown fragment or value is InvalidArgument instead of an agent that never becomes ready. Only a prompt that includes a fragment gets spec.template.promptTemplate, which is kagent’s gate: the controller renders the template when it compiles the agent’s revision, inserting each fragment verbatim, and an edit to either library compiles a new revision of every agent that reads it. A fragment an agent includes cannot be deleted (FailedPrecondition, reason PROMPT_FRAGMENT_IN_USE).

Configuration reconciliation

The Agent retains the desired template; the separate AgentTemplate is its runtime projection. Failed projection writes are retried from that desired configuration. Reconciliation also converges per-agent credentials, MCP server references and model gateway settings while preserving the selected model, skill pins and tool selections. It does not provision a replacement brokerage account. A successful definition update does not establish that an already prepared actor has loaded it.

Suspension, deletion and history

There is no per-agent suspension: the contract removed SuspendAgent and ResumeAgent. An agent stops taking new work only with its account or its deletion, and both are checked at admission each time work would start. AdminService.SuspendTenant pauses the tenant’s kagent schedules (kagent’s paused, which stops scheduled executions), refuses Run now and new wakes, stops the runs in flight as well as it can, and writes nothing on the agent. A slot that passes while paused does not run. Lifting the suspension resumes the schedules, except one-shots whose time has passed, and each run after that starts in a new session. The sweep parks the sessions whose runs it stopped through kagent’s session suspension, which snapshots state and releases the worker allocation. None of this is a replica-count change on a per-agent Deployment.

Deletion records durable intent and blocks new work before cleanup. Cleanup waits for admitted operations, stops active tasks and retries remaining steps. It deletes every one of the agent’s kagent schedules and records the deleted agent’s immutable identity. A deleted agent’s name stays taken, because its usage, runs, trades and leaderboard closes are kept under it: CreateAgent refuses the name with AlreadyExists. Only a create the platform gave up on, which never reached the agent directory, frees its name once its cleanup finishes. The schedule history of a deleted agent is empty, and ListScheduleRuns still answers a deleted schedule’s runs by the schedule’s UID, because kagent keeps them.

A suspension request, an admitted run and a completed task are different states. Partial failures must remain visible. Task history is a persisted projection with the reconciliation limits described on Streaming, not a promise to replay every live frame.

Retired runtime

The separate agents repository is archived historical material. The current Harness uses the custom runtime built from platform-api/runtime/kagent; the archived BYO image is not a supported alternative deployment path.