NylorunDocsBeta
Runtime APIAgentsManifests

Save an agent manifest

PUT
/v1/agent-manifests/{name}

Saves the manifest as its next version, or answers the latest unchanged when nothing differs. Every Agent that tracks the manifest moves to the new version: at once, at its pod's next start for a runtime change a pod applies only when it starts, or once a required secret the version adds is set; a pinned one stays, and so does one whose kind, harness or storage the version changes (agents_behind). The Runtime checks the harness and runtime sections against each other: a custom harness needs a pod with an image, every credential the harness names is a declared slot of the right type, and the runtime's kind gives the loop the sandbox it needs; every gap is named in one 422 manifest_inconsistent (details.gaps). If-Match: <version> refuses the save with 412 manifest_changed when the latest version is no longer the one you read (0 for a manifest that does not exist yet). With ?dryRun=true the answer is the plan: the changes by section, every reason a save would be refused (errors, the gaps first), warnings, the Agents it would move (moves) and how many stay on older versions (behind); nothing is saved. Clients compose the authoring files and drop their $schema before they send one document. With Content-Type: application/vnd.nylorun.folder+json the body is an agent folder by hash instead (feature agent-folders): every file uploaded first with PUT /v1/files/sha256:<hex>, the Runtime compiles it with @nylorun/core/folder, a folder that does not compile is 422 folder_invalid (details.diagnostics, each with its file, line and column), and the version keeps the folder as its source; the plan adds the compiled manifest, the compiler's diagnostics and compiler.

Authorization

applicationKey
headerAuthorizationBearer <token>

An application key of the Tenant (PUT /v1/tenant/keys/{keyId}), or Studio's key, derived from the admin key. With Nylorun-Subject and Nylorun-Scopes, it acts for that person, narrowed to those scopes. Never accepted from a browser (Origin).

Path Parameters

name*string

The agent manifest's name, such as triage

Query Parameters

dryRun?string

true: answer the plan and save nothing

Value in"true""false"

Header Parameters

Nylorun-Protocol*string

The protocol version, 18

Nylorun-Subject?string

The person an application key acts for

Nylorun-Scopes?string

The subject's space-separated scopes; required with a subject

Request Body

  1. body
manifestSchemaVersion*8
Value in8
name*string

An agent manifest's name, such as triage

description?string
metadata?
harness*|
runtime?
requestId?string
Length1 <= length

Response Body

The version saved, or the plan with dryRun

application/json
  1. response
manifest*
unchanged*boolean
warnings*array<>
diagnostics?array<>
import { createClient } from "@nylorun/agents";const client = await createClient();const { manifest } = await client.agentManifests.save(  {    agent: assistant, // its harness section; or an agent manifest v8 document    runtime: {      kind: "virtual",      network: { allowedHosts: ["api.linear.app"] },      secrets: {        linear: { type: "bearer", url: "https://mcp.linear.app/mcp" },      },    },  },  { ifMatch: 3 }, // the version you read; a newer one is 412 manifest_changed);// plan(...) sends ?dryRun=true and saves nothing; a manifest's files are saveFolder(await packFolder(dir))
{  "manifest": {    "name": "string",    "version": 1,    "hash": "string",    "manifest": {      "manifestSchemaVersion": 8,      "name": "string",      "description": "string",      "metadata": {        "property1": null,        "property2": null      },      "harness": {        "kind": "workflow",        "id": "string",        "inputSchema": {          "property1": null,          "property2": null        },        "outputSchema": {          "property1": null,          "property2": null        },        "root": {          "agent": "string",          "id": "string"        },        "agents": {          "property1": {            "kind": "workflow",            "workflowSchemaVersion": 3,            "id": "string",            "name": "string",            "description": "string",            "metadata": {              "property1": null,              "property2": null            },            "inputSchema": {              "property1": null,              "property2": null            },            "outputSchema": {              "property1": null,              "property2": null            },            "sandbox": {              "image": "string",              "network": {                "preset": "none",                "allow": [                  "string"                ]              },              "resources": {                "cpus": 1,                "memory": "string"              },              "idle": "string"            },            "root": {              "agent": "string",              "id": "string"            },            "agents": {              "property1": {},              "property2": {}            }          },          "property2": {            "kind": "workflow",            "workflowSchemaVersion": 3,            "id": "string",            "name": "string",            "description": "string",            "metadata": {              "property1": null,              "property2": null            },            "inputSchema": {              "property1": null,              "property2": null            },            "outputSchema": {              "property1": null,              "property2": null            },            "sandbox": {              "image": "string",              "network": {                "preset": "none",                "allow": [                  "string"                ]              },              "resources": {                "cpus": 1,                "memory": "string"              },              "idle": "string"            },            "root": {              "agent": "string",              "id": "string"            },            "agents": {              "property1": {},              "property2": {}            }          }        },        "plugins": [          {            "name": "string",            "version": "string"          }        ],        "loop": {          "property1": null,          "property2": null        }      },      "runtime": {        "kind": "virtual",        "image": "string",        "resources": {          "cpus": 1,          "memory": "string"        },        "storage": "string",        "network": {          "allowedHosts": [            "string"          ]        },        "lifecycle": {          "idle": "string",          "deleteAfter": "string"        },        "setup": [          {            "command": "string",            "cwd": "string",            "timeout": "string"          }        ],        "files": [          {            "artifactId": "string",            "version": 1,            "path": "string"          }        ],        "limits": {          "artifacts": {            "fileBytes": 1,            "totalBytes": 1          },          "skills": {            "totalBytes": 1          },          "disk": {            "versionBytes": 1,            "versionEntries": 1          }        },        "secrets": {          "property1": {            "type": "environment_secret",            "allowedHosts": [              "string"            ],            "inject": {              "header": "string",              "format": "string"            },            "required": true,            "description": "string"          },          "property2": {            "type": "environment_secret",            "allowedHosts": [              "string"            ],            "inject": {              "header": "string",              "format": "string"            },            "required": true,            "description": "string"          }        },        "triggers": {          "property1": {            "schedule": "string",            "timezone": "string",            "at": "2019-08-24T14:15:22Z",            "webhook": "standard-webhooks",            "session": "string",            "prompt": "string"          },          "property2": {            "schedule": "string",            "timezone": "string",            "at": "2019-08-24T14:15:22Z",            "webhook": "standard-webhooks",            "session": "string",            "prompt": "string"          }        },        "selfWake": true      }    },    "savedBy": {      "actor": "string"    },    "createdAt": "string",    "agents": 0,    "source": {      "compiler": "string",      "files": 0,      "bytes": 0    }  },  "unchanged": true,  "warnings": [    {      "code": "string",      "message": "string"    }  ],  "diagnostics": [    {      "severity": "error",      "code": "string",      "message": "string",      "file": "string",      "line": 1,      "column": 1,      "pointer": "string",      "fix": {        "kind": "rename_key",        "file": "string",        "line": 1,        "column": 1,        "from": "string",        "to": "string"      }    }  ]}