Skip to content
1Claw Academy
Curriculum/Compliance & Operations3 minAdvanced · Lesson 8 of 11

Declarative charts: provisioning that refuses more than it does

One YAML file describes a whole swarm. What 1claw apply will not do to reality is more interesting than what it will.

Every provisioning step in this course so far has been imperative: create this vault, then this agent, then this policy, one call at a time. 1claw apply takes a single file describing what you want, vaults, agents, policies, connectors, and reconciles reality toward it. If you have used Terraform or Kubernetes manifests, the shape is familiar. What is worth studying closely is not the YAML, it is the list of things apply is built to refuse.

  1. 1

    See what a chart would change before it changes anything. This never writes.

    bash
    1claw diff -f chart.yaml
  2. 2

    Apply it. Names in the chart are the reconcile keys: a second apply finds what the first one made by name, not by position.

    bash
    1claw apply -f chart.yaml
Concept

Both diff and apply are human-only, POST /v1/org/apply/diff and POST /v1/org/apply, and both are server-side reconciliation, not client logic. A chart provisions agents, vaults and access policies, so an agent that could apply one could grant itself access to a vault it cannot currently read.

  • It never deletes. A resource removed from the chart is left alone; there is no --prune. An apply that silently deletes is an apply nobody runs twice, and tearing down stays explicit and separate.
  • It skips anything edited outside the chart, naming the field that differs, rather than overwriting it. Someone changed it for a reason, and a reconciler that erases that reason at three in the morning is worse than one that does nothing.
  • It refuses guardrails outright. Transaction limits, host allowlists and approval policies are not chart fields; a reconciler that wrote them directly would be a way around the guardrail approval flow wearing a deployment tool's clothes.
  • It does not skip your org's approval gates. Apply calls the same handlers the API routes call, so a resource that needs consensus queues an approval exactly as a dashboard click would, and the rest of the chart still applies around it.
  • Unknown fields are errors, not warnings. A misspelled field that was silently dropped would report success while doing nothing you asked for, and the field's absence would be the only clue.
Watch out

Renaming an agent in the chart does not rename the agent. It creates a new one under the new name and leaves the old one running, because apply reconciles by name and a changed name is, to the reconciler, a resource it has never seen before.

The drift detection needs a state file, .1claw/apply-state.json, which apply itself writes and reads. That file is what distinguishes "someone edited this since I last applied" from "this existed before I ever ran": a resource that predates your first apply is not drift, and treating it as such would make apply refuse to manage anything that already existed in your org.

This is the same rule fleet rollouts use for hand-edited agents, applied one layer up: a reconciler's job is to move reality toward the declared state, not to erase whatever a human did in between. The two features share that rule because it is the same failure mode either way, an automated tool overwriting a deliberate manual intervention because a file says otherwise.

Audit this configuration

A teammate proposes a --force flag for 1claw apply that would let a chart overwrite fields changed outside the chart, and a --prune flag that deletes any resource no longer listed, to make onboarding new environments faster.

For each capability, mark every circle it contributes. Some contribute none.

  • apply --force (proposed)

    Overwrites hand-edited fields to match the chart, bypassing the drift-skip.

  • apply --prune (proposed)

    Deletes any resource not currently listed in the chart.

  • 1claw diff -f chart.yaml (existing)

    Reports what an apply would change, writing nothing.

Check your understanding

3 questions
1

A chart removes an agent that was previously listed. What does the next apply do to that agent?

2

An agent's system_prompt was changed by hand during an incident, outside any chart. What happens on the next apply of a chart that also sets system_prompt?

3

Why does 1claw apply refuse to change guardrail fields like tx_max_value directly, even when they're written into the chart?