Products / Captain

Captain

AI writes the program. You see what it will do first.

Captain is a programming language for AI coding agents. Before a program touches anything, you see every file, command and server it would touch, with the exact arguments. Approve that, and the run stops if the program tries anything else.

  1. 01

    See every step before it happens

    captain plan runs the program against a host that never acts, and lists each step it would take, in order, with its arguments. Nothing touches your files or servers until you approve.

  2. 02

    It does what you approved, nothing else

    Approval is bound to the plan's digest. Change the program or its inputs and the run refuses. Every run writes a log, and captain replay shows the same result again with no effects.

  3. 03

    Numbers you can audit

    No floating point. Decimals keep every digit, rounding happens only where the program names it, and a run record proves later which program, which inputs and which result.

See it

The plan you approve, and what happens when the agent changes one word:

$ captain plan notice.capb publish text="Lunch is at noon." at=board/today.txt
node 1: `createFileText path:content:` on LocalMachine
  path: "board/today.txt"#path
  content: "Lunch is at noon."
authorities required (minted on approval, bound to this plan's hash):
  Grant[Posted]

$ captain approve publish.capp

$ captain run notice.capb publish text="Lunch is at one." at=board/today.txt \
    --plan publish.capp.approved --allow-write board
error[CAP-PLAN-STALE]: this invocation plans to sha256 [..]
but the approval is for sha256 [..]

Pricing

Priced for your deployment

Captain is licensed commercially by Frogfish LLC. Tell us what you want to run, and where, and we'll come back with a price.

Ask for a price

The details

Everything Captain does

The full language is in the Captain documentation, where every example is checked against the real toolchain.

Captain is a language for programs that are checked before they run: operations whose every effect is known, planned and approved before it happens, and calculations with exact numbers whose results can be audited later.

What it is

Captain's main author is, more and more, a machine. Coding agents write Captain programs, and people read them, review the plans they produce and approve those plans by their digest. So Captain favours what makes a program safe to approve without having written it: explicit rules, visible boundaries, one obvious way to write each thing, and a checker built to catch what a reviewer would miss.

It has two strengths, and both are first-class:

  • Operations you can approve. Every effect a program can have is declared, and the checker computes which effects each procedure can have. captain plan runs the program against a host that never acts, and renders every effect it would perform, with its arguments, as a plan.
  • Calculations you can audit. A pure entry has no effects at all. Its numbers are exact decimals, its result is deterministic, and the same inputs always give the same result, byte for byte, on every machine.

What it does

Operations

  • Every effect is declared, and a program reaches the world only through its effects.
  • captain plan renders every effect a program would perform before any of them happens.
  • A plan has a digest. Approving it mints the grants that destructive steps demand, and running under the approval refuses if anything has changed.
  • Every run writes a run log, and captain replay re-executes the program against that log alone.
  • Secrets are supplied when a program runs, never written into it.

Infrastructure

  • A program can make servers through a cloud provider's API and then set them up over SSH, in one language and one plan.
  • Over SSH, a server needs sshd and nothing of Captain. Only the effects cross to it; the program runs on your machine.
  • parallelDo: runs one block per server, with results always in the order given.
  • An effect that destroys something demands a grant that only an approved plan can mint. A command that might do anything, exec or shell, is marked in the plan as weaker than a typed effect, and needs --allow-exec to run.

Calculations

  • No floating point. A Decimal keeps every digit, and / is exact or fails.
  • Digits are dropped only where the program names a scale and a rounding mode.
  • Quantities carry their units, so a percentage can't be added to a duration.
  • A run record proves later which program, which inputs and which result.

The toolchain

  • One command, captain, holds the checker, the compiler, the inspector, the planner, the virtual machine, the run-log replayer and a language server for editors.
  • captain build compiles source into one artifact, a .capb file of bytecode and a manifest of what the program offers and needs. Builds are deterministic, so an artifact's SHA-256 identifies the program exactly.
  • The checker refuses a program with a stable diagnostic code and a suggested fix.

Where it runs

The captain command line runs programs on your machine, and over SSH on your servers. Rust software can run pure Captain entries through the Captain SDK.

Other Frogfish systems run Captain programs too, each admitting the effects it supports and running them the same way, checked first:

  • Mate: every command at its prompt is a Captain program.
  • Fleet: the software it installs on servers is written in Captain.
  • Forge build recipes, Bosun project tasks, and apps and workers on Gump.

What it is not

  • Not a general-purpose systems language. No pointers, no threads, no foreign-function interface.
  • Not dynamic. No open records, no values that skip the checker, no eval.
  • Not floating point. Numbers are integers, exact decimals and quantities with units.
  • Not a configuration format. A Captain program is code, with procedures, control flow and types.

Getting it

  • Captain is the Gritpack package @frogfish/captain, for Linux x86-64 and macOS arm64.
  • Released formats and VM generations are never dropped: a program built for an older generation keeps running.
  • Official binaries are licensed by Frogfish LLC under the Frogfish Binary License 1.0.

More from Frogfish