Skip to content

Caveman Cloud· Hosted & VPCBuild & Deploy Agents

AGENT.md Format and Deterministic Builds

Complete reference for AGENT.md frontmatter keys, folder layout, lazy skills, subagents, custom tools, determinism rules, and cvm agent build.

An agent build is a folder containing AGENT.md (YAML frontmatter plus Markdown instructions), or a single .md agent file. Running cvm agent build compiles that folder offline into a deterministic agent.json manifest and SHA-256 digest matching the public schema https://caveman.so/schemas/agent-build.schema.json.

Folder layout#

my-agent/
├── AGENT.md # Frontmatter + instructions (required)
├── skills/
│ └── refunds/
│ └── SKILL.md # Lazy-loaded skill (every file under skills/<name>/)
├── agents/
│ └── security/
│ └── AGENT.md # Nested subagent (every file under agents/<name>/)
├── tools/
│ └── prorate_refund.mjs # Custom code tool annotated with // @caveman-tool
└── evals/
└── basic.eval.json # Eval files (*.eval.json, *.eval.yaml, *.eval.yml)

Anything outside those conventions is reported as excluded from the build. With no path argument, cvm agent build builds ./AGENT.md, or a single agent located under .caveman/agents/ (<name>.md or <name>/AGENT.md).

Build and inspect locally (no network)#

cvm agent build ./my-agent
cvm agent build ./my-agent --out ./dist-build

Without --out, nothing is written to disk. --out requires a new or empty directory and writes agent.json plus all included build files.

Frontmatter keys#

cvm agent build parses fourteen frontmatter keys directly:

---
name: support-triage
description: Route billing tickets and draft refunds
engine: caveman
model: claude-sonnet-5-5
computer: none
connectors:
linear:
tools: [list_issues, create_issue]
after_untrusted: approve
drives:
/kb: support-kb
/memory: { drive: support-memory, write: true }
secrets: [STRIPE_KEY]
budgets:
tools: 4000
channels:
slack:
events: [app_mention, direct_message]
thread_mode: session
approvals: interactive
schedules:
daily-audit:
cron: "0 9 * * 1-5"
timezone: "UTC"
task: "Summarize open escalations."
concurrency: skip
budget_usd: 2
output_schema:
type: object
required: [verdict, summary]
properties:
verdict: { type: string }
summary: { type: string }
---

Your agent instructions go here.
KeyPurposeAllowed values / notes
nameAgent identity[A-Za-z0-9._-]{1,100}. Defaults to folder or file name when omitted.
descriptionShort summaryDisplayed in cvm deployments and agent cards.
engineAgent runtime loopcaveman (default), claude-agent, or codex.
modelModel class or exact slugfast, base, frontier, auto, or an exact catalog model ID (cvm models).
computerSandbox tiernone (default for lightweight agents), code, or linux. none strips coding tools to keep prompt prefixes small.
toolsBuilt-in or custom toolsBuilt-in tool name string, or {type: custom, name, description, input_schema} for caller-answered tools.
connectorsOrg MCP connectorsList ([linear, notion]) or map with tools (1-200), as (shared, user, end_user, or {read, write}), args (up to 16 scalar defaults), approve, unpinned, and after_untrusted. Up to 32 connectors; names only, never URLs or secrets.
budgetsToken budgets{tools: N} (100 to 100,000) caps total tokens consumed by the connector tool card.
drivesMounted versioned DrivesMap of mount path to Drive name ("/kb": "support-kb") or {drive, write, review, as}. Set review: true so writes land in human-reviewed changesets.
secretsNamed org secretsList of org secret names ([STRIPE_KEY]). Injected per command on Linux sandboxes; never embedded in the build.
schedulesCron triggersNamed schedules with cron, timezone, task, concurrency (skip), and budget_usd.
channelsInbound integrationsslack (events, thread_mode, approvals) or github (events, mention, thread_mode).
subagentsSubagent configurationSubagent definitions alongside agents/<name>/AGENT.md.
output_schemaStructured final outputStandard JSON Schema object describing the agent's final structured payload.

Frontmatter syntax rules#

Frontmatter supports plain and quoted scalars, inline arrays [a, b], inline objects {a: b} (single-line or indented), block lists, nested block maps, or a single JSON object.

The parser fails closed (exit 2) with an exact line number on:

  • YAML block scalars (|, >), anchors, aliases, or tags
  • Tab indentation
  • Multi-line scalar continuations
  • Unrecognized connector fields or out-of-range tool budgets

Determinism and size limits#

Two identical folders always produce the exact same agent.json SHA-256 digest:

  • Files are sorted bytewise by relative path.
  • No timestamps, git commits, local machine paths, or credentials enter agent.json.
  • Refused (exit 2): symlinks, non-UTF-8 binary files, any file over 2 MiB, AGENT.md or agent.json over 256 KiB, or a total build over 8 MiB or 1,000 files.

Compile from TypeScript#

@caveman-ai/agent exposes the exact same folder compiler programmatically:

import { compileAgentFolder } from "@caveman-ai/agent";

const build = compileAgentFolder("./my-agent");
console.log(build.digest);

Verify and undo#

Validate a folder without touching the network:

cvm agent build ./my-agent --format json

Next: test locally and ship with Deploy, Run & Rollback.

Esc

Start here