InstallPython · Node.js · Homebrew
pip install open-agent-spec

Then run oa --version

Open Agent Spec logo

Open Agent Spec

AI agents as code | define once in YAML, run anywhere.

Open source · MITSpec v1.5.0Python · Node.js

AI agents are fragmented across frameworks and runtimes. Open Agent Spec defines them once, declaratively, and runs them anywhere via the oa CLI.

New in 1.5.0

Tool use, spec composition, and a test harness | all from YAML.

Tool use

Native tools, MCP servers, or custom Python, declared in the spec.

tools:
  reader:
    type: native
    native: file.read

tasks:
  summarise:
    tools: [reader]
    prompts:
      system: "Summarise the file."
      user: "Read {path} and summarise."
Spec composition

Delegate tasks to shared specialist specs. Reuse without duplication.

tasks:
  summarise:
    description: Delegated summariser
    spec: ./shared/summariser.yaml
    task: summarise

  sentiment:
    description: Delegated sentiment
    spec: ./shared/sentiment.yaml
    task: analyse_sentiment
Chaining + test harness

Data dependencies with depends_on. Eval cases with oa test.

tasks:
  extract:
    description: Pull key facts
    output: { facts: string }

  summarise:
    depends_on: [extract]
    description: Summarise facts
    output: { summary: string }

# oa test --spec agent.yaml
No orchestration engine. No framework. No SDK dependencies. Just YAML and the oa CLI — available for Python and Node.js.
Open Agent Spec CLI in action

Features

Multi-step task chaining

Declare data dependencies with depends_on. Output from one task flows automatically into the next. Linear, declarative, and strictly not an orchestration engine.

Tool use | native, MCP, custom

Declare tools in the spec. Built-in tools (file.read, http.get, …), any MCP server via JSON-RPC, or your own Python class. No SDK required.

Spec composition

A task can delegate its implementation to another spec with spec: + task:. Build coordinator specs that reuse shared specialists, zero duplication, full traceability.

Test harness

Run eval cases against any spec with oa test. Assert on task output fields. Make your agents verifiable before you ship them.

Provider interface | no SDK lock-in

All LLM calls go through a thin HTTP interface. OpenAI, Anthropic, Grok, xAI, Codex, local, or custom, swap engines with one line. No OpenAI SDK. No Anthropic SDK.

Behavioural contracts (optional)

Attach output contracts to tasks with the behavioural-contracts library. Validate required fields, confidence scores, and custom rules, after parsing, before returning. Degrades gracefully when not installed.

Node.js native runnernew

Run the same YAML specs from Node.js with no Python required. @prime-vector/open-agent-spec on npm — same oa:// registry, same depends_on chaining, same spec format.

Pull shared, versioned agent specs directly from the registry using the oa:// shorthand. No copy-paste. Just delegate.

Summariserv1.0.0

Summarise text and extract key points.

oa://prime-vector/summariser
Sentiment Analyserv1.0.0

Label tone as positive, negative, neutral, or mixed.

oa://prime-vector/sentiment
Text Classifierv1.0.0

Classify text into runtime-provided categories.

oa://prime-vector/classifier
Keyword Extractorv1.0.0

Extract keywords and phrases ordered by relevance.

oa://prime-vector/keyword-extractor
Code Reviewerv1.0.0

Review code for bugs, security issues, and improvements.

oa://prime-vector/code-reviewer

The Problem

Today, AI agents are often locked inside frameworks and hidden in SaaS dashboards. They're tightly coupled to specific runtimes, hard to version and review, and rarely portable across engines.

| There is no standard way to define an agent declaratively. Open Agent Spec solves that.

How It Works

  1. Define your agent in YAML using Open Agent Spec.
  2. Run locally with oa run --spec .agents/agent.yaml.
  3. Trigger from CI or GitHub Actions using the same spec.

The OA CLI handles validation, prompt rendering, and engine selection, then normalises outputs to match your declared schema.

There are Two 'Main' Ways to Use Open Agent Spec

Run Agents Directly

Execute specs without generating code. Ideal for CI and repo-native execution.

oa run --spec .agents/review.yaml \
  --task review \
  --input pr.json

Generate Agent Code

Scaffold working agents when you want code you own and can customise.

oa init --spec .agents/review.yaml \
  --output ./agents/review
Repo-native agents

Agents belong in your repo. The OA CLI reads .agents/*.yaml, validates them, and uses engine adapters to run your agents.

CI & sub-agents

A single spec can fan out into multiple sub-agent processes. The OA runtime routes each task to the right engine via adapters.

Diagram showing repo-native agents and CI sub-agent flow
Agent-as-code demo: oa run with review agent and jq in the terminal

What Open Agent Spec Is Not

  • Not a framework.
  • Not an orchestration engine.
  • Not tied to any model provider.

It's a declarative standard | a thin, portable layer on top of any runtime.

Agent as Infrastructure

Just as Terraform defines infrastructure, Open Agent Spec defines AI agents. Specs are version-controlled, reviewable, and portable.

Open source · MITSpec v1.5.0
Why Open Agent Spec
Framework-agnostic

Specs describe agents, not the web stack.

Engine-agnostic

OpenAI, Anthropic, Grok, xAI, Codex, local, custom, swap with one line.

Repo-native

Agents live in .agents/, versioned and reviewed like code.

CI-friendly

One spec for local runs, GitHub Actions, and sub-agent pipelines.

Tool-native

Declare file, HTTP, MCP, or custom tools directly in the spec.

Composable

Tasks delegate to shared specialist specs. Reuse without duplication.

Language-agnostic

Run from Python (pip) or Node.js (npm). Same YAML, same registry, same results.