Skip to content
Last updated

Agent Channels

WebDesktop

An Agent Channel is a governed entry point that lets software outside Treasure AI Studio run chats inside it. Your application gets the same agent your team talks to in Studio — grounded in the same shared work folder, running with the same permissions — without you building an agent, hosting a model, or handing anyone a login. Set one up when a product you own needs a conversation with your data in it: a support widget, an internal tool, a customer-facing assistant.

This page explains what an Agent Channel is, what it fixes at creation time, and how a request travels from your application to an answer. The pages under it cover creating one, the credentials involved, and writing the application itself.

What an Agent Channel Is

An Agent Channel is a named, account-level object that binds together three things: one shared work folder the chats read, one executor whose permissions and credits the chats run with, and one or more connection secrets your application authenticates with. Every chat that arrives through the channel gets exactly that combination — there is no request parameter that changes it.

Anchoring the folder and the executor to the channel, rather than to the secret, is what makes a channel governable. A secret carries no permissions of its own, so issuing another one grants nothing new, and rotating one cannot widen what the channel reaches without anyone noticing.

Agent Channels come in one kind, the SDK App: an entry point for an application you host, which creates chats from its own server and streams them to its users.

How a Request Reaches an Agent

Your application never talks to Treasure AI Studio's internal APIs. It talks to the Agent Gateway, a service that speaks the Vercel AI SDK UI Message Stream protocol so you can drive a chat with an unmodified open-source client.

Create a chat

Chat Access Token
+ endpoint URLs

Run a turn (SSE)

Streamed answer

End user
(browser or mobile)

Your server
holds the Gateway Token

Agent Gateway

Treasure AI Studio
agent + shared work folder

Create a chat

Chat Access Token
+ endpoint URLs

Run a turn (SSE)

Streamed answer

End user
(browser or mobile)

Your server
holds the Gateway Token

Agent Gateway

Treasure AI Studio
agent + shared work folder

Four things happen, in this order:

  1. Your server creates a chat by calling the Agent Gateway with its Gateway Token, the channel's long-lived connection secret.
  2. The gateway answers with a Chat Access Token and a set of endpoint URLs. That token is scoped to that one chat and nothing else.
  3. Turns run against those endpoints, streamed as server-sent events. Your server can proxy them, or your client can call the gateway directly.
  4. The agent works inside the channel's shared work folder, reading it as the executor, and its answer streams back the same way.

The two credentials exist because the second one can safely reach a browser and the first one cannot. Gateway Tokens and Chat Access Tokens explains what each one permits and how long it lives.

What an SDK App Fixes at Creation Time

The choices that decide how much a channel exposes are made once, when it is created, by someone who already holds the permission to make them:

What Is Fixed Meaning
Shared work folderThe single folder the channel's chats can read. Chosen from folders the creator manages, and it cannot be changed afterward — a different folder means a different SDK App
ExecutorThe Treasure AI Studio user the chats run as. Always the creator at first; another manager of the same folder can take over later. Permissions, connections, credits, and audit trail all follow the executor — never the end user who triggered the chat
Browser accessWhether the gateway accepts calls that carry an Origin header. Off by default, which means only your server can drive a chat
Chat Access Token lifetimesHow long a per-chat credential survives idle, and its absolute ceiling. Defaults are 24 hours and 30 days

Because these are fixed on the channel, an end user of your application has no way to reach a second folder, borrow someone else's permissions, or extend their own access. What they can do is send a prompt and stop a running answer — What an Agent Channel Chat Can Reach sets out the full boundary, including the parts that are not restricted.

Where Agent Channels Live

Agent Channels have their own section in Treasure AI Studio's settings, on Web and Desktop. Open Settings → Agent Channels to see the account's channels.

Every member of the account can see that a channel exists, along with its name and status. The folder it reaches, its executor, its connection settings, and its tokens are shown only to the people who manage that folder, the executor, and account administrators — for everyone else those cells are masked. Creating and Managing an SDK App covers the page in detail.

Who Does What

Setting up a channel involves up to three roles, and one person often fills more than one:

Role Responsibility
Folder managerCreates the SDK App, picks the folder, issues and revokes connection secrets, and deletes the channel. Opening a folder to an outside application is their decision, so the irreversible actions stay with them
ExecutorConsents to chats running under their permissions and cost. Becomes executor by claiming the role, and can step down at any time, which stops the channel but leaves it and its tokens intact
Account administratorSees every channel in the account, can switch one off or back on, and sets who may create channels. Being an administrator alone does not let them create, edit, delete, or revoke — administrator actions on a channel are all reversible by design

Whether a folder manager can create a channel at all depends on the account's creation policy: by default any folder manager can, and an account administrator can limit creation to administrators. See Choose Who Can Create Agent Channels.

What a Channel Covers

Aspect Detail
Kinds of channelOne: the SDK App. One shared work folder per channel, running as a fixed executor
ProtocolThe Vercel AI SDK UI Message Stream — the one protocol the Agent Gateway publishes for chat clients
Per-channel tool and credential restrictionsNone. A channel's chats run with the executor's full set of tools, connections, and credentials — see What an Agent Channel Chat Can Reach

Frequently Asked Questions

Do my application's users need Treasure AI Studio accounts? No. An Agent Channel exists so that people without a Treasure AI Studio account can use an agent through your application. Identifying your own users, and deciding which of them may start a chat, is your application's job.

Whose credits do these chats consume? The executor's. Every chat created through a channel is attributed to the executor for permissions, connections, quota, and cost, regardless of which end user triggered it. Budget for a channel as you would for one heavy user.

Can two applications share one SDK App? They can share a Gateway Token, but it is usually not what you want. A channel is the unit you disable, delete, and audit, so two applications sharing one lose the ability to stop one without stopping the other. Create one SDK App per application and give each its own token.

Can an Agent Channel write to the shared work folder? No. The channel's chats can read the folder but never write to it, and the scratch space each chat writes to is discarded when the chat ends. Anything the agent produces has to leave through the conversation.

Can I see these chats in Treasure AI Studio? The executor sees them in their own chat list, labelled SDK App with a key on the chat icon, which distinguishes them from chats started in the app.

Next Steps