Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AIF — Agent Instruction Format

CI npm PyPI Spec v1.0 License: MIT License: CC BY 4.0

A plain-text format for expressing executable instructions to autonomous agents, orchestration systems, and automated pipelines — with unambiguous syntax, explicit typing, and deterministic parse semantics.

Get Started

Try it live: AIF Playground — no install needed.

Install a parser:

# Python
pip install aif-parser

# TypeScript / Node.js
npm install aif-parser

Parse a document:

from aif_parser import parse_aif

result = parse_aif(open("pipeline.aif").read())
if result.valid:
    print(result.ast)
else:
    for err in result.errors:
        print(err)
import { parseAIF } from 'aif-parser'

const result = parseAIF(document)
if (result.valid) {
    console.log(result.ast)
} else {
    result.errors.forEach(e => console.error(e))
}

Validate any document:

python -m aif_parser pipeline.aif

Example

---
aif-version: 1.0
id:          deploy-pipeline-v1
title:       Production Deployment Pipeline
author:      platform-team
---

@Agent[test-runner] {
    name:        "Test Runner Agent"
    capabilities: [ test, coverage ]
    timeout:     10m
    on-error:    @ErrorPolicy::stop
}

@Task[run-tests] {
    title:     "Run test suite with coverage"
    agent:     test-runner
    priority:  @Priority::high
    input {
        branch:   String
        coverage: Boolean = true
    }
    output {
        passed:   Boolean
        coverage: Number
    }
}

@Rule[require-coverage] {
    title:    "Minimum 80% test coverage"
    severity: @Severity::error
    assert:   "output.coverage >= 80"
    message:  "Coverage below required threshold."
}

@Workflow[deploy-production] {
    title:   "Full Production Deployment"
    trigger: @Trigger::manual
    steps:   [ run-tests ]
    timeout: 60m
}

Why AIF?

Markdown was designed to convert plain text to HTML for humans. When repurposed as an agent instruction medium, its structural ambiguity becomes operational risk.

Capability Markdown / AGENTS.md AIF
Deterministic parsing Parser-dependent Guaranteed
Block addressing None Every block has a stable ID
Typed fields None Full primitive type system
Two-phase validation None Structural + semantic
Conditional logic None @Branch + AEL expressions
Secret handling None @Secret with vault refs
Canonical AST Not standardised JSON AST spec included

Block Types

Block Executable Purpose
@Agent Yes Declare an agent and its capabilities
@Task Yes Executable unit of work
@Step Yes Sequential instruction within a task
@Rule Yes Declarative constraint / policy
@Branch Yes Conditional flow routing
@Workflow Yes Orchestration graph (entry point)
@Schema No Reusable type declaration
@Param No Runtime variable with type and constraints
@Secret No Credential reference (vault path, not plaintext)
@Note No Human annotation (non-executable)

Full syntax reference in docs/AIF-Specification-v1.0.0.md.


Interoperability

Target How AIF maps
LLM Agents (Claude, GPT, Gemini) Parse plain text. @Workflow is the entry point. Block IDs enable precise execution logs.
Automation Platforms (n8n, Make, Zapier) @Task → workflow nodes. input/output blocks → typed data contracts.
Multi-Agent Orchestrators (CrewAI, AutoGen, LangGraph) @Agent → agent registry. depends-on → task assignment. @Rule → guardrails.
Embedded / IoT Minimal grammar parses in C or Rust. @Secret → hardware security modules.

Packages

Package Language Status Install
aif-parser Python Reference impl pip install aif-parser
aif-parser TypeScript Reference impl npm install aif-parser
aif-playground React Interactive editor Try online

Project Status

AIF is a v1.0 draft, open for community review. See SPEC.md for implementation status.

Spec changes follow the RFC process — open a GitHub Discussion before proposing changes to block types, field syntax, or the AST.


Resources


License

Format specification: CC BY 4.0

Reference implementations: MIT

Metadata

Release files for aif-parser 0.1.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aif-parser 0.1.1a0
File Size Uploaded Provenance
aif_parser-0.1.1a0.tar.gz 14.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aif-parser 0.1.1a0
File Interpreter ABI Platform
aif_parser-0.1.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 24.0 kB

Release files / aif_parser-0.1.1a0.tar.gz

Download URL aif_parser-0.1.1a0.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
555785e53b7fc8fd8bc8d3162a42d4ea02a0bb34408a364458c5676d48d1a210
BLAKE2b-256 checksum
How to use checksums
285779116695e8ae5d7e6ef4776f4895560892de15c08dd2b7802dbe96d61d4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2026.

Transparency log

Release files / aif_parser-0.1.1a0-py3-none-any.whl

Download URL aif_parser-0.1.1a0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f3df9c9d786b7799a61a98faa7abe6bf89992961be1fac7a746d309200cb2b50
BLAKE2b-256 checksum
How to use checksums
c86f90d299e7fe4498fa01349376d921079a80d6707eeed48d7a6fbd2a623d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2026.

Transparency log

Security for aif-parser 0.1.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aif_parser-0.1.1a0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page