Catalog PyPI
PACKAGE EXPLORERView in registry

aif-parser

PyPI

Reference parser for the Agent Instruction Format (AIF)

Versions collected1
Direct dependencies3From release 0.1.1a0
Last observed21 Oct, 10:44 UTC

README

Version 0.1.1a0 documentation

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.

CapabilityMarkdown / AGENTS.mdAIF
Deterministic parsingParser-dependentGuaranteed
Block addressingNoneEvery block has a stable ID
Typed fieldsNoneFull primitive type system
Two-phase validationNoneStructural + semantic
Conditional logicNone@Branch + AEL expressions
Secret handlingNone@Secret with vault refs
Canonical ASTNot standardisedJSON AST spec included

Block Types

BlockExecutablePurpose
@AgentYesDeclare an agent and its capabilities
@TaskYesExecutable unit of work
@StepYesSequential instruction within a task
@RuleYesDeclarative constraint / policy
@BranchYesConditional flow routing
@WorkflowYesOrchestration graph (entry point)
@SchemaNoReusable type declaration
@ParamNoRuntime variable with type and constraints
@SecretNoCredential reference (vault path, not plaintext)
@NoteNoHuman annotation (non-executable)

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


Interoperability

TargetHow 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 / IoTMinimal grammar parses in C or Rust. @Secret → hardware security modules.

Packages

PackageLanguageStatusInstall
aif-parserPythonReference implpip install aif-parser
aif-parserTypeScriptReference implnpm install aif-parser
aif-playgroundReactInteractive editorTry 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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.1a022 Apr 20263

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:44 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:1e44580e30bf626c2cca91d7872c74dd8eaf0c36c03cf9d8de474a5a0f3e2277