{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://maneeshchaturvedi.github.io/engineering-agentic-systems/schemas/eas-manifest.schema.json",
  "title": "EAS Agent Manifest",
  "description": "Declarative description of one or more agentic Workflows, used as declared evidence for EAS conformance.",
  "type": "object",
  "required": [
    "eas_version",
    "workflows"
  ],
  "additionalProperties": false,
  "properties": {
    "eas_version": {
      "type": "string",
      "description": "Specification version the manifest targets, e.g. \"0.1\"."
    },
    "platform": {
      "type": "object",
      "description": "Platform components this manifest's Workflows inherit controls from.",
      "additionalProperties": false,
      "properties": {
        "components": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "implementation"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "$ref": "#/$defs/component"
              },
              "implementation": {
                "type": "string",
                "description": "Product or internal service implementing the component."
              },
              "assessment_ref": {
                "type": "string",
                "description": "Link to the component's own conformance assessment."
              },
              "controls": {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/control_id"
                }
              }
            }
          }
        }
      }
    },
    "workflows": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/workflow"
      }
    }
  },
  "$defs": {
    "control_id": {
      "type": "string",
      "pattern": "^EAS-(0[1-9]|1[0-2])\\.[0-9]{2}$"
    },
    "component": {
      "enum": [
        "scheduler",
        "orchestrator",
        "model-gateway",
        "context-service",
        "tool-gateway",
        "policy-engine",
        "action-ledger",
        "executor",
        "approval-service",
        "identity-broker",
        "egress-proxy",
        "state-store",
        "memory-store",
        "telemetry-pipeline",
        "pii-vault",
        "eval-platform",
        "release-control",
        "outcome-store",
        "data-governance"
      ]
    },
    "workflow": {
      "type": "object",
      "required": [
        "id",
        "version",
        "owner",
        "rung",
        "risk_tier",
        "framework",
        "tools",
        "budgets"
      ],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "owner": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "framework": {
          "type": "object",
          "required": [
            "name"
          ],
          "additionalProperties": false,
          "properties": {
            "name": {
              "type": "string",
              "description": "Stack profile name, e.g. langgraph, openai-agents-sdk, crewai, custom."
            },
            "version": {
              "type": "string"
            },
            "entrypoint": {
              "type": "string",
              "description": "Path to the module that defines the Workflow."
            }
          }
        },
        "rung": {
          "enum": [
            "code",
            "single_call",
            "fixed_workflow",
            "agent",
            "multi_agent"
          ]
        },
        "rung_justification": {
          "type": "string",
          "description": "Required for agent and multi_agent: the requirement the lower rung cannot meet."
        },
        "agents": {
          "type": "array",
          "description": "For multi_agent: each agent and the reason for its boundary.",
          "items": {
            "type": "object",
            "required": [
              "name",
              "boundary_reason"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "boundary_reason": {
                "enum": [
                  "context_isolation",
                  "permission_separation",
                  "parallelism",
                  "independent_ownership"
                ]
              },
              "tools": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        },
        "risk_tier": {
          "enum": [
            "T1",
            "T2",
            "T3"
          ]
        },
        "target_level": {
          "enum": [
            "L1",
            "L2",
            "L3"
          ]
        },
        "success_definition": {
          "type": "string"
        },
        "baseline": {
          "type": "string",
          "description": "The cheapest credible alternative the Workflow is measured against."
        },
        "principal": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "enum": [
                "user",
                "service"
              ]
            },
            "service_principal": {
              "type": "string"
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "credential_ttl_s": {
              "type": "integer",
              "minimum": 1
            },
            "execution_credential": {
              "enum": [
                "per_intent",
                "run_credential"
              ],
              "description": "How deferred effects are authorised: a credential minted per ActionIntent at execution time (EAS-06.13), or the Run's own credential."
            }
          }
        },
        "budgets": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "steps": {
              "type": "integer",
              "minimum": 1
            },
            "tokens": {
              "type": "integer",
              "minimum": 1
            },
            "wall_time_s": {
              "type": "integer",
              "minimum": 1
            },
            "cost_usd": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "tool_calls": {
              "type": "object",
              "properties": {
                "default": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": {
                "type": "integer",
                "minimum": 1
              }
            },
            "concurrency": {
              "type": "integer",
              "minimum": 1
            },
            "retries": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "owner_layer": {
                  "type": "string",
                  "description": "The single layer that retries, e.g. model-gateway."
                },
                "budget_ratio": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1
                }
              }
            }
          }
        },
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/tool"
          }
        },
        "policies": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "id",
              "description",
              "enforced_at"
            ],
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "category": {
                "enum": [
                  "privacy",
                  "money",
                  "legal",
                  "safety",
                  "quality",
                  "other"
                ]
              },
              "enforced_at": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "enum": [
                    "prompt",
                    "gateway",
                    "output",
                    "data_layer",
                    "network"
                  ]
                }
              },
              "code_ref": {
                "type": "string"
              },
              "tests_ref": {
                "type": "string"
              }
            }
          }
        },
        "context": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "sources": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "name",
                  "kind"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "kind": {
                    "enum": [
                      "static",
                      "slow",
                      "fresh",
                      "unstructured",
                      "analytical"
                    ]
                  },
                  "trust": {
                    "enum": [
                      "trusted",
                      "untrusted"
                    ]
                  },
                  "freshness_sla_s": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "state": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "checkpointer": {
              "type": "string"
            },
            "durability": {
              "enum": [
                "sync",
                "async",
                "exit",
                "none"
              ]
            },
            "version_strategy": {
              "enum": [
                "pin_and_drain",
                "compatible_only",
                "migrate"
              ]
            }
          }
        },
        "memory": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "provenance": {
              "type": "boolean"
            },
            "untrusted_policy": {
              "enum": [
                "exclude",
                "downgrade"
              ]
            }
          }
        },
        "observability": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "exporter": {
              "type": "string"
            },
            "redaction": {
              "enum": [
                "none",
                "in_process",
                "in_process_tokenised"
              ]
            },
            "payload_capture": {
              "enum": [
                "none",
                "tiered",
                "all"
              ]
            },
            "retention_days": {
              "type": "integer",
              "minimum": 0
            },
            "payload_sample_rate": {
              "type": "number",
              "minimum": 0,
              "maximum": 1,
              "description": "Random sample rate for full payload capture, in addition to error, rejection, escalation, canary and flagged Runs."
            },
            "archive_retention_days": {
              "type": "integer",
              "minimum": 0,
              "description": "Retention in governed archive storage; retention_days is the fast, interactive tier."
            }
          }
        },
        "evaluation": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "suite": {
              "type": "string"
            },
            "dataset_version": {
              "type": "string"
            },
            "mde": {
              "type": "number",
              "description": "Minimum detectable effect on the primary metric, as a proportion."
            },
            "gates": {
              "type": "array",
              "items": {
                "enum": [
                  "ci",
                  "shadow",
                  "canary"
                ]
              }
            },
            "kill_switch": {
              "type": "string"
            },
            "primary_metric": {
              "type": "string"
            },
            "regression_threshold": {
              "type": "number",
              "description": "Largest tolerated drop in the primary metric before the gate blocks."
            }
          }
        },
        "exceptions": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "control",
              "owner",
              "reason",
              "expires"
            ],
            "additionalProperties": false,
            "properties": {
              "control": {
                "$ref": "#/$defs/control_id"
              },
              "owner": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "compensating_control": {
                "type": "string"
              },
              "expires": {
                "type": "string",
                "format": "date"
              }
            }
          }
        },
        "execution": {
          "type": "object",
          "additionalProperties": false,
          "description": "How effectful ToolRequests become effects.",
          "properties": {
            "ledger": {
              "type": "string"
            },
            "executor": {
              "type": "string"
            },
            "dry_run": {
              "type": "boolean"
            }
          }
        },
        "measurement": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "attribution_window_days": {
              "type": "integer",
              "minimum": 1
            },
            "holdout_fraction": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "routing": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "cascade": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Models in escalation order."
                },
                "escalation_check": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "rung": {
                "enum": [
                  "agent",
                  "multi_agent"
                ]
              }
            }
          },
          "then": {
            "required": [
              "rung_justification"
            ]
          }
        }
      ]
    },
    "tool": {
      "type": "object",
      "required": [
        "name",
        "effect_class",
        "egress",
        "output_trust",
        "data_access",
        "output_limit_tokens"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string"
        },
        "effect_class": {
          "enum": [
            "none",
            "reversible",
            "reversible_delayed",
            "irreversible"
          ]
        },
        "egress": {
          "type": "boolean"
        },
        "output_trust": {
          "enum": [
            "trusted",
            "untrusted"
          ]
        },
        "data_access": {
          "enum": [
            "none",
            "private",
            "regulated"
          ]
        },
        "moves_money": {
          "type": "boolean",
          "default": false
        },
        "idempotency": {
          "enum": [
            "native_key",
            "upsert",
            "none",
            "not_applicable"
          ]
        },
        "output_limit_tokens": {
          "type": "integer",
          "minimum": 1
        },
        "required_scopes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "approval": {
          "enum": [
            "none",
            "policy",
            "human"
          ]
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "enum": [
                "first_party",
                "third_party",
                "mcp",
                "hosted"
              ]
            },
            "server": {
              "type": "string"
            },
            "description_sha256": {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            }
          }
        }
      }
    }
  }
}
