Skip to main content
The agent-first language
X07X07

AI agents guess when the language leaves room for guesswork. x07 is designed so they don't have to.

One canonical API per capability. Zero ambiguity. Agents get it right on the first try — with sandboxed execution, structured error IDs, and machine-applicable fixes.

Why it matters

Less guesswork in the language. Less guesswork in the repair loop.

The first example is about API ambiguity. The second is about what happens when the first attempt is wrong.

Reversing bytes should be boring

Python exposes several valid-looking ways to read stdin and manipulate bytes. X07 exposes one canonical bytes helper.

PythonSeveral plausible wrong turns
# Wrong turn 1 — text instead of bytes
import sys
data = sys.stdin.read()

# Wrong turn 2 — .reverse() does not exist on str
result = data.reverse()
# → AttributeError: 'str' has no attribute 'reverse'

# Wrong turn 3 — reversed(data) is an iterator
data = sys.stdin.buffer.read()
sys.stdout.buffer.write(reversed(data))
# → TypeError: a bytes-like object is required, not 'reversed'
X07One canonical bytes operation
{
  "schema_version": "x07.x07ast@0.4.0", // Canonical x07AST schema.
  "kind": "entry",
  "module_id": "main",
  "imports": ["std.bytes"],             // Import the bytes module.
  "decls": [],
  "solve": ["std.bytes.reverse", "input"] // Call the one reverse helper.
}

The X07 side is the shipped 03_reverse example. The point is not that Python cannot reverse bytes, but that X07 leaves the agent with far less API guesswork.

When the first attempt is wrong, the repair surface matters

Python gives the agent a human traceback. X07 gives it stable JSON diagnostics and deterministic repair commands.

PythonHuman traceback
Traceback (most recent call last):
  File "reverse.py", line 6, in <module>
    sys.stdout.buffer.write(reversed(data))
TypeError: a bytes-like object is required, not 'reversed'
X07Machine-readable repair loop
x07 lint --input src/main.x07.json
# -> emits x07diag JSON with:
#    stable code
#    x07AST pointer
#    optional quickfix as JSON Patch

x07 fix --input src/main.x07.json --write
# -> applies the quickfix deterministically

The X07 docs define diagnostics as machine-readable, error codes as stable, and quickfixes as deterministic JSON Patch operations.

Agents can't hallucinate APIs that don't exist

One canonical API per capability means there is exactly one right answer. No ambiguous choices, no wrong guesses, no import roulette.

Errors tell agents exactly what to fix

Every error carries a structured ID, a machine-readable explanation, and a suggested fix. Agents don't guess at repairs — they read and apply.

From edit to production, one toolchain

Formatter, linter, test runner, MCP bridge, WASM compiler, package registry, and deploy platform — all speaking the same typed contracts.