Skip to content

AgentSpec

One declarative manifest. Everything else follows.

agent.yaml is the single source of truth for your agent — its model, memory, tools, guardrails, evaluation, and observability, all in one place. Every AgentSpec capability flows from that file: validate it, health-check it, score it for compliance, drive agentic code generation from it, and attach a distributed control plane sidecar to it at runtime.

bash
npm install -g @agentspec/cli

agentspec validate agent.yaml   # schema check
agentspec health   agent.yaml   # runtime dependency check
agentspec audit    agent.yaml   # OWASP LLM Top 10 score
agentspec generate agent.yaml   # agentic code generation (LLM-driven)

Quick Start · Manifest Schema · GitHub


What it does

One declarative manifestagent.yaml captures model, memory, tools, MCP, guardrails, evaluation, and observability in a single, portable, machine-readable file. It is the only place you need to change when your agent's architecture changes.
Agentic code generationagentspec generate passes the manifest as a precise, token-efficient context to an LLM agent. The standard structure eliminates hallucinated configs and ambiguous wiring — the LLM generates correct, idiomatic code for any framework without bespoke per-framework adapters.
Runtime health checksagentspec health verifies every env var, file reference, model API endpoint, MCP server, and service dependency before your agent starts — all derived from the manifest.
Distributed control planeagentspec-sidecar loads as a Docker init container alongside your agent. It proxies all traffic, maintains an audit ring, and exposes a control plane with live gap analysis (/gap), capability discovery (/explore), and runtime health probing (/health/ready) — all grounded in the same agent.yaml.
Compliance scoringagentspec audit scores against OWASP LLM Top 10, memory hygiene, model resilience, and evaluation coverage — derived entirely from manifest declarations.
Behavioral policy enforcementagentspec generate-policy converts manifest declarations into a Rego bundle for OPA. Deploy OPA as a sidecar and get per-request enforcement of guardrail invocation, cost limits, TTLs, and tool confirmations — visible in the sidecar's /gap endpoint.

Why AgentSpec?

ProblemSolution
Agent config scattered across code, env files, and docsOne agent.yaml captures everything
No way to know if dependencies are ready before startupagentspec health checks all services and model endpoints at once
Manual compliance reviewagentspec audit scores against OWASP LLM Top 10
Framework code generation wastes tokens on boilerplate and hallucinationsagentspec generate gives the LLM a complete, structured manifest — token-efficient and standard-conformant
No visibility into a running agent's live stateagentspec-sidecar exposes /gap, /explore, and /health/ready backed by live runtime introspection
Agents not discoverable by other agentsagentspec export --format agentcard produces an A2A AgentCard

Architecture

agent.yaml is the root. Every tool in the AgentSpec ecosystem reads from it — nothing is configured twice.

agent.yaml  (single source of truth)

    ├──validate────────▶  schema check (Zod)
    ├──health──────────▶  pre-flight dependency check
    ├──audit───────────▶  OWASP LLM Top 10 compliance score
    ├──generate────────▶  LLM agent reads manifest → outputs framework code
    │   ├──deploy k8s──▶  k8s/ Deployment + Service + ConfigMap + Secret (deterministic)
    │   └──deploy helm─▶  full Helm chart with agentspec-sidecar (Claude-generated)
    ├──generate-policy─▶  Rego bundle → OPA sidecar (behavioral enforcement)
    │                         deny if guardrail not invoked
    │                         deny if cost limit exceeded
    │                         deny if TTL mismatch
    └──runtime─────────▶  agentspec-sidecar (Docker init)
                              ├── :4000  proxy  (audit ring, traffic hooks)
                              └── :4001  control plane
                                      ├── GET /health/ready   (live agent health)
                                      ├── GET /explore        (capability discovery)
                                      └── GET /gap            (gap analysis + OPA violations)

Relationship to existing standards

agent.yaml  ──extends──▶   AGENTS.md          (reference from AGENTS.md)
agent.yaml  ──declares──▶  MCP servers         (spec.mcp.servers[])
agent.yaml  ──exports──▶   A2A / AgentCard
agent.yaml  ──drives───▶   agentic generation  (LLM reads manifest, outputs any framework)
agent.yaml  ──implements──▶ AgentSkills        (spec.skills[])
agent.yaml  ──monitored─▶  agentspec-sidecar   (distributed control plane via Docker init)

AgentSpec extends existing standards — it does not replace them.

Minimal manifest

yaml
apiVersion: agentspec.io/v1
kind: AgentSpec

metadata:
  name: my-agent
  version: 0.1.0
  description: My first AgentSpec agent

spec:
  model:
    provider: openai
    id: gpt-4o-mini
    apiKey: $env:OPENAI_API_KEY

  prompts:
    system: $file:prompts/system.md

  requires:
    envVars: [OPENAI_API_KEY]

Released under the Apache 2.0 License.