The Agent
The AI helper on xAI models: keys, what it can read and change, which actions need your approval, memories, automations and what it costs.
4 min readUpdated Oct 17, 2026Applies to YourDesk 1.0.0
The Agent is an AI helper for the whole studio. Ask it in plain language to find things, summarise a project, list what is due or owed, or do the work: create and update records, draft letters, proposals and invoices. It runs on xAI models through your own xAI account and is entirely optional.
Open it from Agent in the sidebar, or with the Agent buttons on a project, a proposal or the Client updates page, which open it beside the record you are working on. Conversations are kept on the Agent page.
xAI keys
The Agent, and the AI drafting elsewhere in the app, look for a key in this order:
- Your personal key, saved under Settings → Agent. It must start with
xai-. - The studio owner's personal key, for teammates on the owner's desk.
XAI_API_KEYin the server environment, shared by every user of the deployment.
Personal keys are stored encrypted (AES-256-GCM, keyed from BETTER_AUTH_SECRET). Ops → System shows whether the platform key is set and how many personal keys exist.
Without any key, the Agent answers "Add your xAI API key in Settings → Agent." The rest of the app keeps working, with template drafts in place of AI ones.
| Feature | Model | Changeable |
|---|---|---|
| The Agent | grok-4.6 by default, through xAI's Responses API |
Yes, with XAI_AGENT_MODEL |
| Lead research in Discover | grok-4.5 |
No (fixed in code) |
| Letter drafting and refining in Client updates | grok-4.5 |
No (fixed in code) |
Check xAI's model list for current model names and prices.
What the Agent can do
It has 42 tools. Reading and ordinary writes happen straight away; anything that reaches outside the studio, touches money or deletes something waits for your approval.
| Kind | Runs | Tools |
|---|---|---|
| Read | Immediately | Search the desk, load a record, summarise a project, list due work, summarise open and overdue invoices, list memories |
| Write | Immediately | Create and update clients, projects, tasks and proposals; comment; assign, schedule and complete tasks; planner items; log and propose time; import a calendar; draft invoices, reminders, client updates, portal messages and emails; create leads; remember or forget a preference |
| External | After approval | Send an email, post to a portal, send a proposal, send an invoice, open a project from a proposal, ask the client for something, put up a deliverable, invite a teammate |
| Financial | After approval | Record an invoice payment |
| Destructive | After approval | Delete a record, remove a teammate |
Things to know:
- "Send a proposal" and "send an invoice" do what the buttons do: mark it sent and produce its link. They do not email it. "Send an email" does, through the studio's connected mailbox.
- Some completed actions offer Undo in the conversation.
- A run takes up to 20 steps. When it runs long it stops and says "Say continue and I will pick up the rest from here."
- Each user can start 60 runs per hour.
- You can attach up to three text files of up to 100 KB each to a message.
- Every run and every tool call is recorded with its inputs and result, and the Ops overview counts runs across the deployment.
What is sent to xAI
Each request sends the Agent's instructions, your message and any attachments, and a summary of the desk: the studio name and currency, active projects, today's plan, what is waiting, open invoices and the Agent's memories, plus the record in scope. Tool results the Agent asks for (a project briefing, a search) are sent back to the model as the run continues. Do not use the Agent for data you are not willing to share with xAI under its terms.
Memories
The Agent remembers preferences you state explicitly ("Use a warm, concise tone"), and you can add them yourself under Working memory on the Agent page. Review and forget them there at any time.
Automations
Under Scheduled briefs on the Agent page you can save an automation: a name, a schedule such as daily 09:00, weekdays 09:00 or weekly mon 09:00, and a prompt ("Review open work and shape today's priorities"). Running one tells the Agent to read and draft only; anything that needs approval still waits for you.
Important
Not in this version yet: automations do not run on their schedule. YourDesk calculates and stores the next run time, but nothing in 1.0.0 triggers due automations. Press the play button ("Run now") beside an automation to run it. Schedules are read in the server's timezone.
Costs
Every Agent message and AI draft is an xAI API call billed to the key's owner by token. A platform XAI_API_KEY means you pay for every user's AI use. The read-only demo account cannot run the Agent or AI drafting, so demo visitors do not add to it. Set a spending limit in the xAI console, or leave XAI_API_KEY unset and let each studio add its own key.
Turning it off
Switch the agent feature flag off under Ops → Product to turn the Agent off for the whole deployment. The Agent leaves the sidebar and the top bar, and the server refuses Agent conversations, runs, memories and automations, whoever's key would have paid for them.
The flag covers the Agent only. Letter drafting and refining in Client updates and lead research in Discover still call xAI when a key is available; switch discover off as well, or leave XAI_API_KEY unset, to limit those. Leaving XAI_API_KEY unset on its own stops AI features only for people who have not added a personal key.