Treeship
Get started

Trust Templates

Pre-built attestation configs for common workflows. Apply in one command.

A trust template is a pre-built .treeship/config.yaml for a specific workflow. It answers three questions: what triggers an attestation, what gets captured in each receipt, and how the chain gets structured.

treeship init --template github-contributor

From that point, Treeship runs silently. The right things get attested at the right moments.

Available templates

All seven templates ship inside the CLI binary. No network access required.

TemplateWhat it does
github-contributorCommit and test provenance for OSS contributors. Proves tests passed before commit and lockfile was untouched.
ci-cd-pipelineSoftware delivery chain -- test, build, deploy -- with approval gates on deploys.
research-agentMulti-step research with source provenance.
mcp-agentOne import change, every MCP tool call receipted via @treeship/mcp.
claude-code-sessionFull audit trail of AI coding sessions.
openclaw-agentOpenClaw workflow attestation.
hermes-agentHermes Agent autonomous workflow attestation.

Template commands

CommandWhat it does
treeship templatesList all available templates grouped by category
treeship template preview <name>Preview what a template does without applying it
treeship template apply <name>Apply a template to the current project
treeship template validate <file>Validate a custom template YAML file
treeship template save --name <name>Save the current config as a reusable template
treeship init --template <name>Initialize a new project with a template

Preview before applying

treeship template preview ci-cd-pipeline

This prints the triggers, watched paths, capture settings, approval requirements, and Hub push behavior without writing any files.

Apply to an existing project

treeship template apply github-contributor

This writes .treeship/config.yaml in the current directory, converting the template into a project config.

Validate a custom template

treeship template validate my-template.yaml

Runs a series of checks: valid YAML, required fields present (name, description, session.actor), version >= 1, and successful conversion to a ProjectConfig.

Build your own

Answer four questions

  1. What are the meaningful moments? Not what Treeship does, what happens in the workflow.
  2. What proves each moment happened? Output digest, file changes, git state, approval.
  3. Which moments need human approval? Deployments, payments, publications.
  4. Does any moment need ZK TLS? Only if the verifier does not trust the agent AND the server response is legally significant.

Write the YAML

name: my-workflow
version: 1
description: >
  What this workflow does.
tags: [development]
audience: [developer]

session:
  actor: agent://my-agent
  auto_start: true
  auto_checkpoint: false
  auto_push: false

attest:
  commands:
    - pattern: "npm test*"
      label: test suite
      capture_output_digest: true
    - pattern: "git push*"
      label: code push
    - pattern: "kubectl apply*"
      label: deploy
      require_approval: true

  paths:
    - path: "src/**"
      on: write
      label: source change
      alert: false

capture:
  output_digest: true
  file_changes: true
  git_state: true
  lockfile_changes: false
  environment: false
  model_metadata: false

approvals:
  require_for:
    - label: deploy

hub:
  auto_push: true
  push_on: [session_close]
  endpoint: https://api.treeship.dev

onboarding: |
  Your workflow is configured.
  Run normally. Everything matching the rules gets attested.

Apply and test

# Apply from a file path
treeship init --template ./my-workflow.yaml

# Or validate first
treeship template validate my-workflow.yaml

# Test it
treeship wrap -- echo "test"
treeship verify last --full

Save from a live config

If you have been using Treeship, save your current config as a reusable template:

treeship template save --name my-workflow

This strips project-specific fields (ship ID, hub credentials, workspace ID) and writes a clean reusable YAML to ~/.treeship/templates/my-workflow.yaml.

Share templates

Templates are plain YAML files. Share them however you want:

# Via git
git add .treeship/templates/my-template.yaml

# Via file path
treeship init --template ./template.yaml

YAML schema reference

The full template YAML schema accepted by the CLI:

Top-level fields

FieldTypeRequiredDescription
namestringyesTemplate slug (e.g., my-workflow)
versionintegerrecommendedSchema version, should be >= 1
descriptionstringyesWhat this template does
tagsstring[]noCategorization tags (e.g., [development, ci])
audiencestring[]noWho this template is for (e.g., [developer, devops])
sessionobjectyesSession configuration
attestobjectyesWhat triggers attestation
captureobjectnoWhat data to capture in each receipt
approvalsobjectnoWhich labels require human approval
hubobjectnoHub push behavior
onboardingstringnoMessage shown after treeship init --template

session

FieldTypeDefaultDescription
actorstringagent://defaultDefault actor URI for all artifacts
auto_startboolfalseStart session when matching activity begins
auto_checkpointboolfalseAutomatically create Merkle checkpoints
auto_pushboolfalsePush to Hub after session closes

attest.commands[]

FieldTypeDefaultDescription
patternstringrequiredShell glob to match commands (e.g., npm test*)
labelstringrequiredHuman-readable label for receipts
require_approvalboolfalseBlock until treeship approve
capture_output_digestboolfalseHash stdout+stderr for this command

attest.paths[]

FieldTypeDefaultDescription
pathstringrequiredFile glob to watch (e.g., src/**)
onstringrequiredTrigger on: write, change, create, delete
labelstringnoneHuman-readable label for the attestation
alertboolfalseRaise an alert when triggered

capture

FieldTypeDefaultDescription
output_digestboolfalseHash stdout+stderr
file_changesboolfalseTrack modified files with content hashes
git_stateboolfalseGit HEAD before/after each command
lockfile_changesboolfalseDetect lockfile modifications
environmentboolfalseOS and runtime version fingerprint
model_metadataboolfalseCapture AI model info (name, provider)

approvals

FieldTypeDescription
require_forobject[]List of { label: "..." } entries matching command labels that need approval

hub

FieldTypeDefaultDescription
auto_pushboolfalsePush artifacts to Hub automatically
push_onstring[][]When to push: session_close, approval_required, git_push
endpointstringnoneCustom Hub endpoint URL

Templates configure what gets attested. They do not alter how your tools run or add dependencies to your project.