# Agent Markup Language (AML) > AML is an asynchronous TypeScript and JSX runtime for composing complex, provider-agnostic agent workflows. AML gives JSX a new job. Instead of describing a user interface, the tree describes an agent workflow. The runtime resolves that tree from the leaves upward, manages provider and resource lifecycles, and returns the final Agent output as text or schema-validated structured data. Website: https://agent-markup-language.com/ Package: `@aml-jsx/sdk` License: MIT Status: under active development; public APIs and examples may change before the first stable release. ## Why AML Most AI SDKs are designed around chat: send a message, call a model, and stream a response. Agentic workflows need more around that conversation: multiple agents, tools, permissions, sandboxed execution, persistent files, explicit dataflow, provider adapters, and useful traces. AML brings those concerns into one executable async JSX tree. Developers use ordinary TypeScript, functions, promises, conditions, and schemas instead of learning a separate orchestration DSL. Editors already understand JSX, TypeScript already checks it, and coding agents already know how to write it. When an `` node resolves, the AML Runtime preloads its `` into the selected `` and prompts the Agent SDK through the Agent Client Protocol (ACP). The Workspace keeps files durable between runs; the Sandbox owns code execution, filesystem access, and permissions. AML workflows are: - Composable: package agents, prompts, capabilities, and control flow as async JSX components. - Provider-agnostic: use OpenCode, Codex, Pi, deterministic test providers, or custom provider adapters without rewriting the tree. - Explicit: child results appear in parent prompts at authored positions; parallel work starts through ordinary JavaScript. - Scoped: Tools, MCP servers, Sandboxes, and Workspaces are granted only where they are declared. - Observable: runtime lifecycle and trace events describe what happened during evaluation. ## Installation ```sh npm install @aml-jsx/sdk ``` Configure TypeScript to use AML's automatic JSX runtime: ```json { "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "@aml-jsx/sdk" } } ``` Use `.tsx` for files containing AML markup. AML is not React and does not require React. ## First workflow ```tsx import { Agent, AmlRuntime, opencodeAgent } from "@aml-jsx/sdk" const OpenCode = opencodeAgent({}) const runtime = new AmlRuntime() const result = await runtime.evaluate( Summarize this repository., ) ``` Root evaluation starts with `runtime.evaluate(tree)`. The standalone `evaluate(tree)` API is for work started inside an actively evaluated AML function component. ## Evaluation model AML resolves the tree from the leaves upward: 1. Resolve ordinary values, promises, fragments, and function components. 2. Resolve capability and prompt descriptors into their nearest Agent. 3. Run child Agents before their parents. 4. Insert child output into the parent prompt at its authored position. 5. Acquire and release Sandbox and Workspace resources around descendant work. 6. Return the final text or structured result. JSX children resolve in authored order. Sibling JSX does not imply concurrency. Start independent branches explicitly with `Promise.all()` and `evaluate()`: ```tsx import { Agent, evaluate } from "@aml-jsx/sdk" async function WeeklyStandup() { const [linear, github] = await Promise.all([ evaluate(Gather this week's Linear updates.), evaluate(Gather this week's GitHub updates.), ]) return ( Prepare our weekly standup. Linear: {linear} GitHub: {github} ) } ``` ## Core primitives - `` runs one provider-owned Agent session after its prompt, system content, capabilities, and child Agent results resolve. - `` adds resolved content to the nearest Agent's system prompt. - `` grants a provider-native Tool name or a JavaScript Tool created with `defineTool()`. - `` adds reusable inline instructions or instructions loaded from a local file. - `` writes resolved text, including Agent output, beneath the active Workspace before later siblings run. - `` grants a provider-native MCP name or a server created with `defineMcpServer()`. - `` adds an ordered later turn to the same provider-owned Agent session. - `` acquires ephemeral execution and scopes a narrowed filesystem policy to descendants. - `