Capabilities

Attach controlled abilities to an Agent without exposing raw server primitives by default.

Capabilities are user-shareable Agent abilities. They attach through defineAgent({ capabilities }) and can contribute tools, instructions, policy, metadata, requirements, triggers, commands, and invocation context values.

Capabilities only belong in the Agent docs because they matter when a model-backed actor needs an ability.

Capability vs server primitive

Server primitive:

import { kv } from '@vite-hub/kv'

await kv.set('settings', { theme: 'system' })

Agent Capability:

import { defineAgent } from '@vite-hub/agent'
import { kv } from '@vite-hub/agent/capabilities'

export default defineAgent({
  capabilities: [
    kv({ mode: 'read' }),
  ],
  instructions,
  model,
})

The primitive is app code authority. The Capability is model-facing authority.

What a Capability can contribute

ContributionMeaning
RequirementsPrimitive, workspace mode, path, or policy the Agent must satisfy before the Capability applies.
InstructionsCapability-owned guidance inserted through instruction slots.
ToolsModel-facing operations such as read, edit, query, execute, or search.
PolicyApproval and safety behavior for model-facing actions.
MetadataInspectable configuration details for runtime and DevTools.
TriggersProduct events that start Agent Invocations.
Context valuesTyped invocation values that later callbacks can read.
Copyright © 2026