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) What the compiler checks
- A path to a
guardedtool that skips a person is a compile error, and the error shows the path. Proof - The JSON a model sees for a tool is generated from its types and
///docs. Proof - Ask an agent for a struct and you get a struct, checked against its type. Proof
tin capsreports what each agent can reach before it runs; a model's reply cannot reach outside code withoutapprove. Proof- A run can be recorded to a tape and replayed with no model and no network. Proof
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.