Husk
GitHub

Reference

husk.yaml schema index

Every field of HuskSpec as a flat lookup — path, type, exact zod constraint, default — followed by one fully annotated file.

This is the lookup table: every leaf path in HuskSpecSchema, with the constraint the validator actually enforces. For the prose walkthrough — what each block is for, with worked examples — read husk.yaml instead.

name is the only required field. Everything else has a default, so the smallest valid file is one line:

name: my-bot

Top level

PathTypeConstraintDefault
apiVersionliteral"husk/v1"husk/v1
namestring1–64 chars, ^[a-z0-9][a-z0-9-]*$required
displayNamestring≤ 96 chars—
versionstring—0.1.0
descriptionstring≤ 280 chars""
modelstring—auto
fallbackModelsstring[]—[]
engineobjectsee below{ type: builtin }
temperaturenumber0–2—
personastring—""
knowledgeobject[]see below[]
examplesobject[]see below[]
toolsstring[]—["computer"]
computerobjectsee belowall defaults
limitsobjectsee belowall defaults
guardrailsobjectsee belowall defaults
memoryobjectsee belowall defaults
triggersarraydiscriminated on type[{ type: cli }]
metadatarecordany values{}
originobjectsee below—

engine

PathTypeConstraintDefault
engine.typeenumbuiltin | claude-code | codexbuiltin
engine.resumestring^[A-Za-z0-9-]{8,80}$, a Claude Code session id; needs claude-code—

On claude-code or codex the file is refused when guardrails.approvalMode is not auto, or when it sets denyCommands, allowCommands, a network allow or deny list, or computer.image. See husk.yaml.

knowledge[]

PathTypeConstraintDefault
knowledge[].titlestring—required
knowledge[].contentstring—required
knowledge[].sourcestring——

No length cap on either required field. At run time each item is appended to the system prompt under ## Reference as a ### <title> block.

examples[]

PathTypeConstraintDefault
examples[].userstring—required
examples[].assistantstring—required

origin

Provenance, written by husk distill. Optional as a whole; source is required once the block exists.

PathTypeDefault
origin.sourcestringrequired
origin.transcriptIdstring—
origin.importedAtstring—
origin.messageCountnumber—

computer

PathTypeConstraintDefault
computer.enabledboolean—true
computer.providerstringnot validated against the provider listbest available
computer.flavorenumbase | python | node | fullbase
computer.browserenumchrome | lightpandabrowser in ~/.husk/config.json, else chrome
computer.imagestringoverrides flavor—
computer.cpusnumber> 0, ≤ 64; no limit on local and ssh2 on Docker and Podman, 1 on Fly
computer.memoryMbinteger> 0, ≤ 131072; Fly rounds up to a multiple of 2562048 on Docker and Podman, 1024 on Fly
computer.diskMbinteger> 0; Docker and Podman, a /work that is not persisted2048
computer.idleTimeoutSecinteger≥ 0; 0 disables900
computer.maxLifetimeSecinteger≥ 0; 0 disables0
computer.packagesstring[]one word each; refused on ssh and fly[]
computer.setupstring——
computer.envrecord of string${NAME} is read from Husk's environment{}
computer.workdirstring—/work
computer.persistbooleanDocker and Podman: /work is a volumefalse
computer.network.modeenumnone | egress | fullegress
computer.network.allowstring[]one leading *. wildcard supported—
computer.network.denystring[]applied even in full—
computer.network.strictbooleanrefuses a provider that cannot hold every process to the policy—
computer.mounts[].sourcestringhost pathrequired
computer.mounts[].targetstringpath in the machinerequired
computer.mounts[].readonlyboolean—true
computer.userstringDocker and Podman; root is accepted1000:1000
computer.labelsrecord of stringhusk.ssh, husk.ssh.key, husk.fly.app, husk.fly.region, husk.fly.ports—

limits

PathTypeConstraintDefault
limits.maxStepsinteger1–50024
limits.maxCostUsdnumber≥ 00.5
limits.maxTokensinteger> 0200000
limits.timeoutSecinteger> 0300
limits.execTimeoutSecinteger> 0120
limits.maxOutputBytesinteger> 0262144

Every ceiling is checked before the next model call, not after. See Cost and budgets.

guardrails

PathTypeConstraintDefault
guardrails.approvalModeenumauto | ask | readonlyauto
guardrails.denyCommandsstring[]regex, falls back to substring[]
guardrails.allowCommandsstring[]regex, falls back to substring[]
guardrails.refusestring[]free text[]
guardrails.redactSecretsboolean—true

allowCommands beats both denyCommands and the built-in deny list, where an entry matches: a command chained after an allowed one is checked on its own. See Isolation and Approvals.

memory

PathTypeConstraintDefault
memory.enabledboolean—false
memory.backendenumfile | memory | sqlitefile
memory.windowTurnsinteger> 020
memory.summariseboolean—true

backend: file keeps notes between runs in ~/.husk/bots/<name>/memory/, through a memory tool, on every engine; memory keeps nothing once the run ends. See Notes between runs.

triggers[]

A discriminated union on type. Seven variants; husk serve mounts all but cli.

typeFieldTypeDefault
httppathstring/
authnone | tokentoken
cronschedulestringrequired
promptstringrequired
webhookpathstringrequired
secretstring—
discordchannelsstring[][]
mentionOnlybooleantrue
slackchannelsstring[][]
mentionOnlybooleantrue
telegramallowliststring[][]
cli———

discord, slack and telegram each start a chat adapter once its bot token is set, and are not started while channels or allowlist is empty. See Triggers. http's auth field is stored and never checked.

tools[]

Bundle names expand; individual tool names are also accepted.

BundleExpands to
computershell, expose_port, computer_info
browserbrowse, browser_goto, browser_snapshot, browser_click, browser_type, browser_screenshot
filesread_file, write_file, edit_file, list_dir, search_files, move, delete
webfetch_url, plus web_search when TAVILY_API_KEY or BRAVE_API_KEY is set
httphttp_request

A tool that cannot work is skipped rather than registered-and-broken. Tools needing a machine are dropped when computer.enabled is false, and http_request is opt-in — naming the http bundle counts as naming it. hand_off is opt-in and in no bundle: see husk.yaml. An unknown tool name is dropped silently (at debug log level).

One annotated file

husk.yaml
# The schema version. Bumped only on a breaking change.
apiVersion: husk/v1
 
# Required. Lowercase alphanumerics and dashes, 1-64 chars. This is the URL
# segment, the CLI handle, and the computer's name.
name: ci-triage
displayName: CI Triage        # <= 96 chars, human label
version: 0.2.0                # yours, not husk's
description: Reads failing CI logs and says what broke, in one paragraph.
 
# An alias or a provider/model id. `auto`, `free` and `local` are strategies.
model: sonnet
# Tried in order when the model before is unavailable, by `husk run` and the API alike.
fallbackModels: [flash, gemma]
temperature: 0.2              # omit to use the provider's default
 
# The system prompt. {{name}} placeholders come from `husk run --var name=…`.
persona: |
  You triage CI failures for a TypeScript monorepo.
 
  Always read the failing job's log before forming an opinion. Quote the first
  line that actually failed -- not the last line, which is usually the runner
  giving up.
 
  Answer in one paragraph. No preamble.
 
# Appended to the prompt under "## Reference".
knowledge:
  - title: Repository layout
    content: |
      packages/* are libraries, apps/* are deployables. Any change under
      packages/core forces a full rebuild.
    source: https://github.com/org/repo/blob/main/README.md
 
# Few-shot pairs. Both sides required.
examples:
  - user: main is red
    assistant: The `build (node 20)` job failed at `packages/core` with TS2345.
 
# Bundles, individual tool names, or both.
tools: [computer, files]
 
computer:
  enabled: true               # false removes the machine and every tool needing one
  flavor: node                # base | python | node | full
  # image: ghcr.io/me/custom:1   # overrides flavor
  cpus: 2
  memoryMb: 2048
  diskMb: 2048
  idleTimeoutSec: 600         # destroyed by the reaper after 10 idle minutes; 0 disables
  maxLifetimeSec: 0           # hard ceiling regardless of activity; 0 disables
  workdir: /work
  persist: false              # true: /work is a volume on Docker and Podman
  packages: [pnpm]            # installed when the computer is made; ssh and fly refuse
  setup: mkdir -p /work/out   # one shell snippet, once, after creation
  env:
    GITHUB_TOKEN: ${GITHUB_TOKEN}   # explicit values survive the env scrub
  mounts:
    - source: ./fixtures
      target: /work/fixtures
      readonly: true          # the default; set false deliberately or not at all
  network:
    mode: egress              # none | egress | full
    allow: ['*.github.com', 'objects.githubusercontent.com']
    deny: ['telemetry.example.com']   # refused even in `full`
 
limits:
  maxSteps: 20                # 1-500
  maxCostUsd: 0.25            # 0 admits only models priced at zero
  maxTokens: 200000
  timeoutSec: 240             # wall clock for the whole run
  execTimeoutSec: 120         # per exec inside the machine
  maxOutputBytes: 262144      # per tool result, before redaction
 
guardrails:
  approvalMode: auto          # auto | ask | readonly; `ask` fails closed
  denyCommands:
    - 'git\s+(push|commit|reset\s+--hard)'
  allowCommands: []           # beats denyCommands AND the built-in list
  refuse:
    - deploying, reverting, or merging anything
  redactSecrets: true
 
memory:
  enabled: false              # the only gate; off means no notes and no trimming
  backend: file               # file keeps notes between runs | memory | sqlite (not built)
  windowTurns: 20
  summarise: true
 
triggers:
  - type: http                # ALL /v1/t/ci-triage
  - type: cron
    schedule: '*/15 * * * *'
    prompt: Any red builds on main in the last 15 minutes? If none, reply "clear".
 
# Free-form, carried through untouched.
metadata:
  owner: platform-team
 
# Written by `husk distill`. `source` is required once the block exists.
origin:
  source: claude-code
  transcriptId: tr_01hxyz
  importedAt: 2026-09-01T10:00:00.000Z
  messageCount: 214

Validation

husk validate                 # ./husk.yaml
husk validate support.yaml
husk validate --json

Every problem at once, each as path: message:

error husk.yaml is not a valid husk
  ✗ name: name must be lowercase alphanumeric with dashes
  ✗ limits.maxSteps: Too big: expected number to be <=500
  ✗ triggers.0.schedule: Invalid input: expected string, received undefined
hint:  `husk init --force` regenerates a valid file, or see `husk help init`

parseSpec throws E_SPEC_INVALID carrying the same list in details.issues. safeParseSpec returns { ok: false, issues } instead of throwing.

Over HTTP, POST /v1/husks/validate returns { ok, issues? } with HTTP 200 either way — it is a validator, not an operation that can fail.