How it runs
Follow one turn from your input through the Runtime and back to history.
One turn looks like this:
- 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.
- The Runtime calls the Tenant's model.
- 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.
- 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.
- 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
| Page | Basic usage |
|---|---|
| Local Tenants | npx nylorun start |
| Models | npx nylorun tenant models set |
| Tool policy | admin.toolPolicy.put({ rules }) |
| Runtime limits | admin.settings.limits.put({ limits }) |
| CLI | nylorun <group> <command>, npm create |
| Agents | client.agents.put(id, { manifest }) |
| Saving manifests | client.agentManifests.save({ agent, runtime }) · npx nylorun apply |
| Secrets and credentials | client.agents.secrets.put(id, name, { value }) |
| Triggers and wakes | runtime.triggers · client.agents.runs(id) |
| Agent memory | harness.memory · client.agents.memories.put(id, path, content) |
| Sessions | client.createSession({ agent, ownerUserId }) |
| Events | session.history() · session.observe() |
| Traces | session.trace(turnId) |
| Pauses and control | session.cancel({ idempotencyKey }) |
| Files | client.artifacts.upload(…) · session.inputParts(parts, { idempotencyKey }) |
| Studio | npx 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.