Tin

Tin

A small typed language that compiles to WebAssembly, with agents, tools and human approval in the grammar.

One program

/// Send money. A person approves every call.
guarded tool fn wire(to: string, amount: int): string =>
  "sent {amount} to {to}"

/// Look up a balance.
tool fn balance(account: string): int => 120

agent Teller {
  model: "mock"
  tools: [balance, wire]
}

fn main() {
  print(Teller("wire 100 to 'bob'"))
}

When the person approves, it prints

mock: sent 100 to bob

When they decline

mock: error: Tool call denied by the user. Do not retry it; continue without it.

Call wire directly, skipping the person, and it does not compile

error: 'wire' is a guarded tool, and this call skips approval
  --> teller.tin:14:9
   |
14 |   print(wire("bob", 100))
   |         ^^^^^^^^^^^^^^^^
   = note: path: main → wire
   = note: give the tool to an agent (the agent loop asks before it runs), or call it from another guarded tool fn
   = note: or ask a person at this call: `match approve wire(...) { Ok(out) => ..., Err(why) => ... }` (approve gives a Result: Err when denied)

Run it in the playground

What the compiler checks

Agents are verified live on Bedrock Claude Haiku 4.5 and on gpt-oss-20b through an OpenAI-compatible endpoint; the other providers are tested against recordings. Agents in the browser need Chrome or Edge 137+. Status lists what works and what is in progress.

Start

curl -fsSL https://tin.ad/install.sh | bash

Needs Node 24 or newer. What it installs.

Learn Tin, from a first program to agents, in short chapters with checked exercises. Or read the 15-minute tour, the reference or the benchmarks.