Implementations

Open-source ANML 1.0 libraries maintained by the ANML Foundation. All implementations target full RFC compliance with draft-jeskey-anml-01.

Official Libraries

anml-server-rust
RustISC License

Reference ANML 1.0 server implementation. Serves ANML duckuments over HTTP with full protocol support including discovery endpoints, content negotiation (XML/JSON), trust delegation, and SRI integrity headers.

  • Well-known URI and Link header discovery
  • Dual serialization (XML + JSON) with content negotiation
  • Trust delegation via DNS TXT verification
  • SRI integrity headers on media responses
  • Configurable persona, constraints, and flow state
cargo add anml-server
anml-client-rust
RustISC License

Full-featured async ANML 1.0 client. Discovers, fetches, and interacts with ANML services over HTTPS with complete protocol compliance including disclosure evaluation, action execution, and flow navigation.

  • Discovery — well-known URI, Link header, HTML link, DNS-SD
  • 7-step RFC disclosure evaluation with consent management
  • Action execution with parameter binding and SSRF protection
  • Multi-step flow navigation with retry and backoff
  • SRI verification, pagination, middleware chain
cargo add anml-client
anml-client-node
TypeScriptISC License

ANML 1.0 client for Node.js and TypeScript. Zero-dependency (beyond XML parsing), ESM-only, built on native fetch. Full type safety with comprehensive ANML document type definitions.

  • TypeScript-first with full type definitions
  • Discovery — well-known URI, Link header, HTML link
  • Disclosure evaluation with consent store
  • Action execution (urlencoded, multipart, JSON)
  • Flow navigation, knowledge exchange, SRI verification
npm install @anml-foundation/client
anml-client-python
PythonISC License

ANML 1.0 client for Python. Async-first with httpx, Pydantic v2 models for full type safety, and safe XML parsing via defusedxml. Designed for AI/ML agent frameworks and LLM tool-calling pipelines.

  • Async-first with httpx, Pydantic v2 data models
  • Discovery — well-known URI, Link header, HTML link
  • Disclosure evaluation with consent store
  • Action execution with parameter binding
  • Flow navigation, knowledge exchange, SRI verification
pip install anml-client
anml-server-python
PythonISC License

ANML 1.0 server SDK for Python. Fluent document builder, dual serialization (XML/JSON), content negotiation, and Pydantic validation. Framework-agnostic with optional FastAPI and Flask adapters.

  • Fluent builder API for constructing duckuments
  • Dual serialization with content negotiation
  • Pydantic models ensure spec compliance at build time
  • Framework-agnostic (FastAPI, Flask, Django)
  • Persona, branding, disclosure, flow, knowledge, rights
pip install anml-server
anml-server-node
TypeScriptISC License

ANML 1.0 server SDK for Node.js/TypeScript. Type-safe document builder, XML/JSON serialization, discovery middleware, and validation. Works with Express, Fastify, or any HTTP framework.

  • Fluent builder API with full TypeScript types
  • Dual serialization with content negotiation
  • Discovery middleware (well-known, Link headers)
  • Document validation against the spec
  • Persona, branding, disclosure, flow, knowledge, rights
npm install @anml-foundation/server

Capability Matrix

CapabilityServer (Rust)Client (Rust)Client (Node.js)Client (Python)
XML parsing/generation
JSON parsing/generation
Well-known discovery
Link header discovery
DNS-SD discovery
Disclosure evaluation
Consent management
Action execution
Flow navigation
SRI integrity
Pagination
Middleware/interceptors
Retry with backoff
Circuit breaker
Trust delegation

Quick Start

Python

import asyncio
from anml_client import AnmlClient, AllowListTrustPolicy

async def main():
    client = (
        AnmlClient.builder()
        .base_url("https://api.example.com")
        .trust_policy(AllowListTrustPolicy(["https://api.example.com"]))
        .build()
    )

    # Discover and fetch an ANML duckument
    doc = await client.fetch("/service")

    # Inspect knowledge
    for inform in doc.knowledge.inform if doc.knowledge else []:
        print(inform.content)

    # Execute an action
    response = await client.execute_action(doc, "create-session", {
        "email": "user@example.com",
    })

asyncio.run(main())

Node.js / TypeScript

import { AnmlClient, AllowListTrustPolicy } from '@anml-foundation/client';

const client = AnmlClient.builder()
  .baseUrl('https://api.example.com')
  .trustPolicy(new AllowListTrustPolicy(['https://api.example.com']))
  .build();

// Discover and fetch an ANML duckument
const doc = await client.fetch('/service');

// Inspect knowledge
for (const inform of doc.knowledge?.inform ?? []) {
  console.log(inform.content);
}

// Execute an action
const response = await client.executeAction(doc, 'create-session', {
  email: 'user@example.com',
});

Rust

use anml_client::prelude::*;

#[tokio::main]
async fn main() -> anml_client::Result<()> {
    let client = AnmlClient::builder()
        .base_url("https://api.example.com")
        .trust_policy(AllowListTrustPolicy::new()
            .allow_url("https://api.example.com"))
        .build()?;

    let doc = client.fetch("/service").await?;

    // Navigate the flow
    if let Some(step) = doc.current_step() {
        println!("Current step: {}", step.label.unwrap_or(&step.id));
    }

    Ok(())
}

Contributing

All implementations are open source under the ISC license. We welcome contributions — whether that's bug fixes, new features, documentation improvements, or entirely new language implementations.

If you're building an ANML implementation in another language (Python, Go, Java, etc.), we'd love to hear about it. Reach out to discuss inclusion in the ANML Foundation organization.