v0.6.5 is out

The NTNT
Programming Language.

The agent-optimized language for building modern applications.

import { json, parse_json } from "std/http/server"
import { schema, validate, required, email } from "std/validate"

let signup_rules = schema(map {
    "email": [required, email],
    "name": [required, str]
})

// @implements: feature.signup
fn signup(req)
    requires len(req.body) < 4096
{
    let body = parse_json(req) otherwise {
        return json(map { "error": "bad json" }, 400)
    }
    let user = validate(signup_rules, body) otherwise {
        return json(map { "errors": err }, 422)
    }
    return json(map { "welcome": user["name"] }, 201)
}

post("/signup", signup)
listen(8080)
## Glossary

| Term                          | Means                     |
|-------------------------------|---------------------------|
| someone signs up with {body}  | POST /signup body {body}  |
| they are welcomed             | status 201                |
| they are asked to fix it      | status 422                |

---

Feature: Signup
  id: feature.signup

  Scenario: Valid details
    When someone signs up with {"email": "[email protected]", "name": "Ada"}
    → they are welcomed
    → body contains "Ada"

  Scenario: Bad email
    When someone signs up with {"email": "nope", "name": "Ada"}
    → they are asked to fix it
$ ntnt intent check server.tnt -vv

✓ Feature: Signup
  ✓ Valid details
      → they are welcomed
      → body contains "Ada"
        ✓ status: 201
        ✓ body contains "Ada"
  ✓ Bad email
      → they are asked to fix it
        ✓ status: 422

=== Summary ===
Features:   1 total, 1 passed, 0 failed
Scenarios:  2 passed, 0 failed, 0 skipped
Assertions: 3 passed, 0 failed

Built for agentic development.

Every major programming language was designed for people writing code by hand. NTNT is designed for agents writing the code while people decide what it should do, so the language, the tooling, and the standard library are all built around how an agent works.

Self-teaching language
ntnt learn writes setup files for Claude Code, Cursor, Codex, and Copilot, and ntnt docs answers any question about a function from the terminal. Your agent doesn’t need NTNT in its training data.
Closed-loop verification
With Intent-Driven Development, your requirements become scenarios, and ntnt intent check runs them against the real code after every change. ntnt lint and ntnt validate report errors as JSON, and ntnt inspect lists every route, function, and contract. The server hot-reloads, so each change is checked in seconds.
Operational minimalism
HTTP, databases, migrations, auth, jobs, email, and live updates are in one binary, under 40 MB for Linux x64. Every package install is a step where an agent can go wrong, and there’s no dependency tree to audit or install script to run, a common route for supply-chain attacks on npm and PyPI.
Flexible types, strict errors
Start without type annotations and add them where they help. NTNT_TYPE_MODE sets how strictly types are checked at runtime and NTNT_LINT_MODE sets how strictly they’re checked before it runs, so a prototype and a production app can use the same code. Errors are Result values, handled with ? or otherwise instead of slipping past, and requires and ensures report the values that broke them. In a route, a failed requires returns a 400.
Security-forward architecture
Templates escape output, fetch blocks private network addresses and cloud metadata endpoints, responses get security headers, and std/secrets keeps credentials out of logs and pages. Rate limiting is built in and turns on with one environment variable. PostgreSQL connections to other hosts use verified TLS by default, and rediss:// URLs do the same for Redis and Valkey.

Built with NTNT.

Applications running on NTNT in production today.

See all projects

Intent-driven development.

Describe what the app should do in plain sentences, and NTNT turns them into tests. Scenarios are written in the Intent Assertion Language (IAL), where a glossary maps each phrase to a concrete check against routes, responses, or functions. Contracts check the code from the inside: requires and ensures state what each function accepts and returns, and fail with the values that broke them. Your agent writes both from your request, runs them after every change, and fixes what fails.

  1. Describe the intent

    Your agent writes your requirements as IAL scenarios in a .intent file, and ntnt intent lint confirms every phrase resolves before anything runs.

    ntnt intent lint server.intent
  2. Implement against it

    @implements ties each function to the requirement it serves. requires and ensures check what goes in and what comes out.

    ntnt lint server.tnt
  3. Verify, then iterate

    ntnt intent check runs every scenario against the real code and reports each assertion. Your agent fixes what fails and runs it again.

    ntnt intent check server.tnt

How Intent-Driven Development works, with coverage reports and a visual studio

What you can build.

Each of these has a recipe with a working example or a prompt you can hand to your agent.

Server-rendered websites.

Routes render HTML templates with escaped output, loops, conditionals, and shared partials. No front-end build step, and no template package to install.

Build a website with templates

Google and GitHub login.

std/auth handles OAuth and OpenID Connect for Google, GitHub, Microsoft, Apple, and others, with sessions and CSRF protection. A few lines turn on login; no auth package needed.

Add social login

Live updates.

Server-Sent Events and WebSockets run through your ordinary routes, so your middleware and login checks apply before a connection opens. One publish call reaches every open stream, and there’s no separate realtime server to run.

Push live updates

Database migrations you can review.

Schema changes are numbered SQL files. ntnt db plan tests them on a scratch database and shows what will change, ntnt db migrate runs only the plan you approved, and ntnt db verify checks the result. Works with PostgreSQL and SQLite.

Set up migrations

Sign-in and secrets.

Magic-link authentication includes sessions and rate limiting. std/secrets keeps secret values redacted in logs and rendered output.

Build a passwordless flow

Durable background jobs.

Jobs live in PostgreSQL or Redis. Several workers can share a queue, pick up work left by a worker that crashed, and retry on failure. ntnt jobs and ntnt workers show the queue and scale workers while they run.

Queue email safely

Network monitoring.

DNS, ICMP, TCP, and SNMP checks are native APIs. Persistent ping probes keep results current, and a check that starts late is reported as late.

Build a network check

Function-level tests.

Call ordinary functions from .intent scenarios to test business rules without starting an HTTP server.

Run a function-level intent test

554 functions. 28 modules. One binary.

Web servers, databases, authentication, and background jobs ship in the runtime. ntnt docs gives an agent any function’s signature and examples without leaving the terminal.

Web

  • std/http/serverRouting, middleware, static files, SSE, WebSockets, rate limits
  • std/httpFetch with SSRF protection and safe redirects
  • std/authOAuth/OIDC, sessions, CSRF, TOTP, magic links
  • std/validateDeclarative schemas for forms and APIs
  • std/emailSMTP, batches, and a log transport for dev

Data

  • std/postgresPooled queries, transactions, verified TLS
  • std/sqliteEmbedded database with transaction modes
  • std/kvRedis, Valkey, SQLite, or in-memory
  • std/json std/csvParse and serialize
  • std/markdownRendering and source-mapped block parsing

Runtime

  • std/jobsDurable queues, cron, retries, crash-safe leases
  • std/concurrentTasks, channels, broadcasts, parallel, race
  • std/processSupervised child processes, off by default
  • std/secretsOpaque, redacted secret values
  • std/logStructured logs with JSON context

Everything else

  • std/net std/netmonCIDR math, ping, TCP, DNS, SNMP
  • std/string std/collectionsText and higher-order data tools
  • std/time std/mathDates, durations, “3 hours ago”
  • std/cryptoHashing, AES-GCM, Argon2, UUIDs
  • std/fs std/path std/env std/urlFiles, paths, config, URLs

Full standard library reference

HTTP performance.

Requests are handled by a Rust HTTP server on Tokio, and your route handlers run in the NTNT interpreter. In our nine-framework comparison, NTNT served over 300,000 plaintext requests per second.

How we benchmark NTNT

Actix (Rust)477K
Gin (Go)406K
NTNT303K
FastAPI174K
Hono (Bun)118K
Fastify81K
Express18K
Django18K
Rails11K
Plaintext requests / sec · NTNT 0.4.2 comparison

Recently shipped.

The 0.6 releases added database migrations you can review, live updates over Server-Sent Events and WebSockets, built-in rate limiting, and verified TLS for PostgreSQL and Redis.

  1. 0.6.5Migrations for more schemas. ntnt db accepts SQLite AUTOINCREMENT and built-in functions such as the JSON functions, and PostgreSQL enums, domains and extensions such as citext. Extensions a superuser installs can be declared, and a database restored with pg_restore no longer reports drift. If you use it with PostgreSQL, read the upgrade notes first: scratch databases have new requirements.
  2. 0.6.4Safer database migrations. ntnt db accepts SQLite timestamp defaults and partial and expression indexes, refuses a drop that would delete rows in related tables, and says which file, migration or setting caused each refusal. Runtime errors in imported modules point at the right file and line.
  3. 0.6.3Security fixes and verified TLS. Auth rules cover every handler they name, fetch blocks cloud metadata endpoints however they’re written, and PostgreSQL and Redis connections can use verified TLS. Read the upgrade checklist before deploying.
  4. 0.6.2Database setup and PostgreSQL TLS. ntnt db init and ntnt db new scaffold a database and its migration files, ntnt db connects to PostgreSQL over verified TLS, and large tables can get longer migration time limits.
  5. 0.6.1Native WebSockets. WebSocket endpoints run through ordinary routes and middleware and can share a broadcast with SSE. Memory from unreachable closures is reclaimed, and migrations handle more real PostgreSQL schemas.

All releases on GitHub

Built in the open.

NTNT is open source under MIT and Apache 2.0. The code, the issues, and the roadmap are on GitHub.

Latest
v0.6.5
Commits
1,300+
Stdlib functions
554
Modules
28

Sponsored by