NylorunDocsBeta
Run

How it runs

Follow one turn from your input through the Runtime and back to history.

One turn looks like this:

  1. Your app or Studio sends input on a session: text, data, or files. A trigger or a wake the agent booked can start a turn too. A message sent while a turn runs waits in the session's queue.
  2. The Runtime calls the Tenant's model.
  3. When the model calls a tool, the Runtime applies the Tenant's tool policy: the call runs, waits for a person's approval, or is denied.
  4. The Runtime runs the call: an HTTP tool is one request to your service, and an MCP tool a call to a remote MCP server, both through the gateway with the secrets of the session's Agent. A shell command runs in that Agent's sandbox. An Agent is made from a saved agent manifest and moves to new versions of it in place.
  5. The Runtime records the turn in history.

The Runtime runs the agent from the manifest version its Agent runs, and never calls your code during a session. Model calls, tool calls, skills, and Agents all run in the Runtime.

import { createClient } from "@nylorun/agents";

const client = await createClient();
const session = await client.createSession({
  agent: "assistant",
  ownerUserId: "user-123",
});

await session.input("Look up order demo-123", {
  idempotencyKey: crypto.randomUUID(),
});

createClient() finds the Runtime through the project link locally, or through NYLORUN_RUNTIME_URL and NYLORUN_SERVER_KEY.

Pages

PageBasic usage
Local Tenantsnpx nylorun start
Modelsnpx nylorun tenant models set
Tool policyadmin.toolPolicy.put({ rules })
Runtime limitsadmin.settings.limits.put({ limits })
CLInylorun <group> <command>, npm create
Agentsclient.agents.put(id, { manifest })
Saving manifestsclient.agentManifests.save({ agent, runtime }) · npx nylorun apply
Secrets and credentialsclient.agents.secrets.put(id, name, { value })
Triggers and wakesruntime.triggers · client.agents.runs(id)
Agent memoryharness.memory · client.agents.memories.put(id, path, content)
Sessionsclient.createSession({ agent, ownerUserId })
Eventssession.history() · session.observe()
Tracessession.trace(turnId)
Pauses and controlsession.cancel({ idempotencyKey })
Filesclient.artifacts.upload(…) · session.inputParts(parts, { idempotencyKey })
Studionpx nylorun studio

Under npm run dev, saving a file saves each agent again as a new version of its manifest. The starter's Agent tracks its manifest, so it moves to each new version in place, and each session's next turn runs it; a turn already running ends on its version.

Next step

On this page