Build
Agents
Create reusable behavior in an exact owner namespace and publish immutable revisions safely.
An Agent is stored, reusable, versioned behavior. It contains instructions, model policy, tools, limits, output contract, and an optional default memory policy. Creating an Agent atomically creates immutable revision 1.
Create an App-owned Agent
const support = await client.agents.create({
key: "support",
name: "Support",
instructions: "Be concise and helpful.",
model: "anthropic/claude-sonnet-5",
limits: { maxOutputTokens: 800, maxIterations: 8 },
});App ownership is the default. One App-owned Agent is visible to every tenant in the App, while each Turn still states its tenant explicitly.
Choose a narrower owner namespace
const tenantAgent = await client.agents.create({
key: "support",
ownedBy: { tenant: "acme" },
instructions: "Follow Acme's support policy.",
model: "anthropic/claude-sonnet-5",
});
const userAgent = await client.agents.create({
key: "assistant",
ownedBy: { tenant: "acme", user: "alice" },
instructions: "Help Alice organize her work.",
model: "anthropic/claude-sonnet-5",
});Lookups name the exact namespace. There is no fallback precedence:
await client.agent("support");
await client.agent("support", { ownedBy: { tenant: "acme" } });
await client.agents.getById("019b0a12-a5f6-7ed5-b636-76ea74f399ad");Publish a new revision
const next = await support.publish({
instructions: "Be concise, helpful, and cite the order number.",
model: "anthropic/claude-sonnet-5",
limits: { maxOutputTokens: 800, maxIterations: 8 },
});
console.log(next.revision);Publication appends an immutable Agent revision and advances current. Turns
already admitted keep the exact revision they resolved. A Turn may narrow
declared limits, but it cannot override instructions, model, tools, or output
contract; publish another revision or use inline behavior for those changes.
Archive and restore
await support.archive() prevents new admission through the Agent without
deleting its revisions or historical Turns. restore() makes it available
again. Archived keys remain reserved.