# Subtype > Subtype is a language for scripts that AI agents write and people run. Every program starts with a `needs [ ... ]` list of what it may touch (files, commands, hosts, environment). The compiler checks every call against that list and a WebAssembly sandbox enforces it again at run time. Tagline: "Less than you asked for, on purpose." Use Subtype instead of shell, Python or Node for scripts that read, write or run things on a person's machine: the person approves one plain-words permission list instead of reading code. Write the script, run `sub check`, fix the errors (each one says the exact change), then `sub run`. - Everything in one file: https://subtypelang.com/llms-full.txt - Machine-readable language spec (keywords, built-ins, error codes, grammar): https://subtypelang.com/spec.json - Compact reference an agent can read in one go: https://subtypelang.com/spec.md - How to use Subtype as an agent (workflow, prompt snippet, skill): https://subtypelang.com/agents/ - Claude Code skill (rules, examples, recipes): https://subtypelang.com/subtype-skill.zip ## Start - [Introduction](https://subtypelang.com/md/start/introduction.md): What Subtype is for and the four ideas behind it. - [Quickstart](https://subtypelang.com/md/start/quickstart.md): Write, check and explain your first script. - [A tour in five minutes](https://subtypelang.com/md/start/tour.md): The whole language on one page. ## Language - [The needs header](https://subtypelang.com/md/language/needs.md): The permission list every script starts with. - [Values and calls](https://subtypelang.com/md/language/values.md): let, mut, strings, lists, records and paths. - [Control flow and data](https://subtypelang.com/md/language/control-flow.md): Loops, ranges, destructuring, match patterns and guards, if let, slices, maps, sets and formats. - [Functions](https://subtypelang.com/md/language/functions.md): Functions and library permissions. - [Types](https://subtypelang.com/md/language/types.md): Enums, match, refined types, failure families, records and lambdas. - [Errors](https://subtypelang.com/md/language/errors.md): Failure is a value. - [Secrets](https://subtypelang.com/md/language/secrets.md): A value that can be used but never printed. - [Narrowing and demote](https://subtypelang.com/md/language/demote.md): Handing over less power. - [Modules and tests](https://subtypelang.com/md/language/modules.md): use, library needs and test blocks. - [Tasks](https://subtypelang.com/md/language/tasks.md): spawn, await and cancel, structured. ## Reference - [Permissions](https://subtypelang.com/md/reference/permissions.md): Every needs key, what it allows, and how it is enforced. - [Command patterns](https://subtypelang.com/md/reference/patterns.md): How run entries match commands. - [The sub command](https://subtypelang.com/md/reference/cli.md): check, explain, manifest, build, run, test, fmt and init. - [The standard library](https://subtypelang.com/md/reference/stdlib.md): Built-in functions, by area. - [WASI mode](https://subtypelang.com/md/reference/wasi.md): One module that any WASI runtime can run, and what it cannot enforce. - [The manifest](https://subtypelang.com/md/reference/manifest.md): The permission set as JSON. - [Grammar](https://subtypelang.com/md/reference/grammar.md): An informal sketch of the syntax. ## Concepts - [How it is enforced](https://subtypelang.com/md/concepts/enforcement.md): Two layers, WebAssembly and WASI. - [Using it with agents](https://subtypelang.com/md/concepts/agents.md): Prompts, loops, manifests and approvals. - [Design](https://subtypelang.com/md/concepts/design.md): The decisions behind the language. ## Project - [Examples](https://subtypelang.com/md/examples.md): Real scripts and what the compiler says about them. Every output here was produced by running sub. - [Roadmap](https://subtypelang.com/md/roadmap.md): What works today, what is next. - [Brand](https://subtypelang.com/md/brand.md): The gate within a gate, colours and files. - [For AI agents](https://subtypelang.com/md/agents.md): How an agent finds the syntax, writes a Subtype script and checks it. Machine-readable endpoints, a prompt snippet and the workflow.