AI Agents

An AI Agent is a worker for your business. It runs on your sites and data, follows playbooks you give it (Skills), can run code, call APIs, and send email — and it asks before anything big, shows you every step, and can never overspend. You build, run, and manage the whole thing just by chatting in plain English — everything below is what happens under the hood.

Every plan on sale includes AI agents, as running them needs a paid plan; a workspace still on the old Free plan can build up to 10 but not run them. See Pricing.

Your first agent in 5 minutes

You don't need to know how any of it works. Say the job in your own words, check what the agent may use, try it while you watch, then let it work on its own. You stay in charge the whole way.

  1. Say the job in the chat. Open AI Agents in the menu and tell the Chat there what you want done, in a sentence or two. It sets the agent up for you: its name, its job and what it may use. You can also press New agent and fill in the form yourself. Not sure what to ask for? Start from one of the jobs below.
  2. Check what it may use, and when it asks you. Open the agent, then Settings → What it can use. An agent can use only what is listed there. Take away anything this job doesn't need, there or by asking the chat. If the job needs an account of yours, connect it first (More → Sending accounts for the mailbox it sends email from, More → Connectors for other apps), then give it to the agent. Under When it asks you, a new agent is set to Ask me first. It waits for your OK before it sends an email, uses a connected app, publishes a site, deletes something or pays. An agent made with Full access starts by asking only before deleting and paying.
  3. Try it while you watch. Type one small task in the agent's own chat, or press Run a task. You see each step as it happens and can press Stop at any moment. Running an agent, or chatting with one, needs a paid plan. Each run shows what it used.
  4. Let it work on its own. Tell the chat when it should work (“every weekday at 9am”, “when an email arrives”, “when a row is added to my orders table”), or set it under Settings → When it runs. When the chat sets this up, it shows you a card first: nothing is saved and nothing starts until you press Allow. An agent you make is already on. Turn off, in the ⋯ menu at the top of its chat, stops it running on its own; you can still chat with it.
  5. Know where to look. When an agent stops for you, it waits; nothing happens until you answer. Open Approvals in the menu: everything your agents need is listed there in one place. A step waiting for a yes (you choose Allow or Don't allow), a question (type your answer), a run paused at its spending limit, and an agent whose runs failed 3 times in a row, with the reason and a link to the agent to fix it. The number next to Approvals counts them all, the bell also tells you of a question, a spending-limit stop and an agent that keeps failing, and each agent's own page shows its own. Only a person can approve; no AI can. To see what an agent did, open it and press Tasks: its finished work is under Past tasks.

Jobs to start with

Each one is only a sentence to send to the chat; change any word of it. Nothing is given to the agent by picking a job: you still check what it may use in step 2.

  • Answer support email. Every customer email gets a drafted reply, and you approve it before it goes.Say: “Make an agent that answers customer emails. Give it its own email address, have it write a reply from the answers I will give you, and ask me before it sends anything.”It needs: An email address of its own, for the mail that comes in; Your sending mailbox, to reply from. Runs: Each time an email arrives at its address.
  • Reply to contact-form messages. No enquiry from your site waits until Monday: each one gets a reply drafted for your OK.Say: “Make an agent that replies to the messages people send through the contact form on my site. Have it write a friendly answer from our opening hours and prices, and ask me before it sends anything.”It needs: The table your contact form saves to (look only); Your sending mailbox, to reply from. Runs: Each time a new message is saved.
  • Weekly report. A short report of the week lands with you every Monday, without anyone building it.Say: “Make an agent that reads my orders table every Monday at 9am and writes me a short report of the week: what came in, what is still open and anything unusual. Ask me before it emails the report.”It needs: The tables the report is about (look only); Your sending mailbox, if you want the report by email. Runs: Every Monday at 9am.
  • Chase unpaid invoices. Late invoices get a polite reminder, so you stop chasing them yourself.Say: “Make an agent that checks my invoices table every weekday at 10am, finds the invoices that are more than 7 days late and writes each customer a polite reminder. Ask me before it sends anything.”It needs: Your invoices table (look only); Your sending mailbox, to send the reminders from. Runs: Every weekday at 10am.
  • Post to social. A new post is written for you every weekday, and nothing is posted until you say yes.Say: “Make an agent that writes one short post about my business every weekday at 8am for the social account I connected. Ask me before it posts anything.”It needs: A social account you connected, and only the posting part of it. Runs: Every weekday at 8am.
  • Daily summary. Each morning you read in a minute what came in since yesterday.Say: “Make an agent that reads my orders and messages tables every morning at 8am and tells me, in a few lines, what came in since yesterday and what needs me today.”It needs: The tables you want summarised (look only). Runs: Every morning at 8am.
  • Sort new enquiries. Every new enquiry is labelled by kind and urgency, so the urgent ones are never buried.Say: “Make an agent that reads each new row in my enquiries table and fills in two columns: the kind (sales, support or other) and whether it is urgent. It may change only that table.”It needs: Your enquiries table (it can change rows in that one table). Runs: Each time a new row is added.
  • Research helper. Before a call you get a five-line briefing on the company, read from its public website.Say: “Make an agent I can give the web address of a company to. It reads that public website and gives me a five-line summary: what they do, who they sell to and anything I should know before a call.”It needs: The web: public pages only. Runs: When you ask it, in its chat or with @ from any chat.

Agent, chat, task, run

  • Agent — an identity: its instructions, skills, what it may touch and who may use it.
  • Chat — a conversation with an agent: ask it questions, change its settings, or ask it to take on a task.
  • Task — one piece of work an agent is given, which hands back a result. Every start makes one.
  • Run — the work the agent does for a task, step by step. You can watch it and stop it.

You do all of this by chatting

You never have to wire any of this up by hand. Describe what you want and it creates the agent and everything it needs — skills, scripts, triggers, functions, even the webhook — and edits it later the same way. There are two places to chat:

Inside Serenities

The built-in Chat on the AI Agents page writes and edits the agent, its skills, and its scripts for you — just tell it what the agent should do.

From your own AI

Connect an AI app you already use, like Claude or ChatGPT (here is how), and manage all your agents by chatting there — build, run, and check on them without leaving your AI.

Delegate to an agent from any chat — type @

In every chat on the platform — a site, a Base, a Flow, Automations, or the Agents page — type @ to pull in one of your agents. Pick from the list (keyboard or mouse, several at once), send, and the agent runs the task; its result comes back into the chat.

  • It gets a focused task, not your whole conversation — plus the context of what you're looking at.
  • The result flows back in, and the chat carries on from it. Ask a research agent for the facts, and the chat builds the table or article from what it found — automatically, no extra step.
  • The agent still follows its own permissions, approvals, and limits — a delegation can never do anything the agent itself couldn't.

Run an agent on your own AI provider

Agents are not limited to the platform models. Add a key under Your AI (left rail) — OpenAI, Anthropic, Google, Azure OpenAI, Amazon Bedrock, Mistral, Groq and 20 more — and that provider's models appear in the agent's model list, one entry per key (“GPT-5.4 · OpenAI (Work)”). An agent run on your own AI key uses no AI credits: you pay your provider for the model. It still needs a paid plan, and its run time counts toward your plan's included compute like any agent run, then your balance.

  • Keep several named keys per provider and pick which one an agent uses; rename a key or replace its secret without touching the agent.
  • The same keys work in every chat and in functions (how a function calls them is under For builders).
  • See Your AI for the full provider list and setup.

1. Create an agent

Open AI Agents in the menu. The fastest way is to just tell the chat what you want, in plain English — it builds the whole agent for you, including any skill and script:

"Build an agent called Contact Concierge. When a contact form is
submitted, classify the enquiry, look up our opening hours, and email
the person a reply. Give it a webhook I can point my form at."

You (or the AI) set a few things, all editable later:

  • Identity & instructions — who the agent is and how it works.
  • Access — Full access (everything in this workspace, including what is added later; only someone who may use everything can choose it) or Custom (only what you pick below). From the AI chat or your own AI, switching Full access on waits for your OK on its approval card.
  • Abilities — the exact tools it may use (read data, write rows, send email, fetch the web, run functions…). Nothing outside this list exists for the agent.
  • Sites & Bases it may touch — data access is granted, never assumed. Each site is Read-only or Can edit, and the choice is enforced for every tool, not just the obvious ones: a tool outside the sites and bases you gave it is refused. For a site or Base you can also pick Which tables it may use.
  • Can run your apps and sites — the actions of an installed app stay off for agents until you turn each one on under the app’s App settings → Actions (or Profile → Apps & actions) and pick which agents may run it.
  • Can create functions — off by default, and only a person can switch it on. A function the agent writes gets the agent’s sites, tables and connected apps as they are that day, keeps them, and is set up so only that agent can run it until you change its Who can run this function. An agent changes functions that stay inside its own sites, tables and connected apps; a function with "Runs as Admin" switched on, the code of one holding secrets or powers, a function’s limits and what it declares it does stay yours to change.
  • Approval mode — Ask first (pauses before anything external or destructive) or Full autonomy. The top of When it asks you says in one line when this agent asks you (for example “This agent asks you before: publishing sites, sending email and app changes, deleting things and payments.”), and one switch, Let it make changes without asking, leaves only money and deleting asking; switch it off and it asks before every kind again (a plain edit never asks). Money and deleting still ask. App actions also need their own setting "On its own". The boxes below it choose kind by kind. When your AI (the chat or your own AI client) turns asks off, nothing changes until you approve its card; turning asks on applies at once.
  • Limits — spend per run, runs per day, actions per run, and a hard time limit. How often an agent hands work to or asks other agents in one run has no default limit; ask the AI chat to set a maximum for that agent (1 to 50), and the next one past it is refused, with the reason. What always applies: 20 agent runs at once per workspace, hand-offs at most 3 levels deep, and your credits.
  • Try again if it fails — 0 to 3 (0, off, unless you set it; Settings → Cost and limits, or ask the AI chat). Only a run nobody started (a schedule, webhook, event or flow) that failed for a passing reason and sent nothing is tried again; each try is a new run and costs credits.
  • Continue — a failed task in Past tasks can be continued: the same task goes on from where it stopped, and what it already sent is never sent again. It costs credits like any task and needs Run agents. While the task is already being tried again automatically, Continue is not offered: wait for the new try. If its record of what it sent is missing and it called an outside service (an email or a connected app), it can't be continued. Start again starts it over as a new task instead. The AI chat and your own AI do the same (the tool's name is in §13).
Some workspace apps come with their own agents. Installing the app makes them for you, switched off and asking you before every kind of hard-to-undo step (turn that off with the one switch under When it asks you), with only what you may give them: the app’s own tables, and its actions if you may allow them for agents. The install tells you what each still needs (a connection to connect, the app’s actions to allow, a paid plan to run it); you start each one yourself. Uninstalling the app stops and deletes its agents and keeps their run history, or you can keep the agents, switched off.

That kept history stays easy to find: open Removed apps’ agents at the bottom of your list of agents (or ask the AI chat) to see those runs, newest first, with the app’s and the agent’s names, and press an app’s name to see only its runs. It is read only. Runs kept before names were recorded show as Removed app (name not recorded), and if your access is limited the names are not shown to you.

2. How agents run (triggers)

Every start makes a task. Schedules, webhooks, events and incoming mail are set in the agent's Settings, under When it runs (the same rows a function has on its Triggers tab; More → All triggers lists them across the account); the other ways to start one are listed after them:

  • Manually — One agent, two ways to use it: Chat = talk to it and set it up (it acts as you; changes ask your OK first); Task = it does its job on its own with its saved setup. Open the agent and chat with it (the main part of its page; chatting needs a paid plan, like running it). It is an ordinary chat, priced like every AI chat message: ask it questions, have it change its own settings (it asks you before every change, with an Allow card) or read what it did, or ask it to take on a task, which it asks you to approve before it runs. A task is one run, and you watch it work right there. An agent that needs no message (a weekly report, a check) starts with Run a task at the top of that chat: a small sheet asks what it should do (its saved standing task is filled in), and with nothing typed it takes the agent's oldest Planned task, else starts its standing job. Its tasks are listed under Tasks as its to-do list: To do (add one in the box there, with Add a task or with Add to to-do in the Run a task sheet; the first is marked NEXT, with Start now and Remove), Working (Step n of m, Stop) and Done (Start again); when its schedule starts it with no text of its own, it takes the oldest Planned task on that list, and with none waiting it does its standing job. With Work through its to-do On (Settings › When it runs; On for an agent you make on the dashboard when you may turn agents on, otherwise Off), a task you add starts by itself when the agent is free, then the next, one at a time, within all its limits; Off (“Only when it runs”), a task waits until you start it or its schedule takes it. Each task can say for itself when it starts (its row, or When in the Add a task box: Now, When it's free, At a time); a limit reached leaves it Planned with “Paused: ...” and a link to the limits. An open task shows what it did as steps, with the agents it asked, handed work to or started as subagents (each with a link to its task), and what it learned, with Save as skill and See its memory; under it, Use the chat takes you back to talking to it. The Tasks button beside it opens what is waiting for your OK and its past tasks; Settings opens its eight groups: About (its name, one line, job and AI model, changed in place), When it runs, What it can use, When it asks you, What it remembers, Who can run it, Cost and limits, and Turn off or delete.
  • On a schedule — repeating (say it in plain English, e.g. “every weekday at 9am”) or a one-off (“in 2 weeks”). An agent can have several scheduled tasks, each with a name, its own task and its own On/Off (a daily one, a weekly one, a monthly one): add one from Add a task › When › Repeat…, here, or by asking the AI chat; each is listed under Scheduled tasks in Tasks. A repeating schedule runs at most once a minute. A schedule runs in the time zone you give it; a time zone that isn't one we know is refused, for a one-off as for a repeating schedule. A run missed during downtime is caught up once on restart. On a Free plan a schedule is saved, with a note that it starts nothing until you move to a paid plan. Before you save a repeating schedule, the schedule box says what it will cost, for example “About 22 runs a month, about 44 credits (about 2% of your plan).” (from what the agent's last runs cost; a new agent with fewer than three runs gets the runs a month and a note that there is no usual cost yet). The AI chat tells you the same line before you tap its approval card.
  • Webhook — a secret web address. What a contact form or another app sends to it becomes the agent's task (how to send to it is in §13).
  • Event (when something happens) — a row added or changed in a base (narrowed to which base, which table, only when a field changes, only rows where…), a file, a flow or agent run, a site event, a payment, a connector, or your own event. Write what to ask the agent with {{properties.row.Customer}}-style placeholders, or let it read the event as-is.
  • Incoming mail (email address) — give the agent an address; every email that arrives becomes a task.
  • Hand-off — one agent passes its full result to another to continue the work: an agent on its “Can hand off work to another agent” list or in one of its groups (see §6).
  • From a flow or a function — a flow's AI agent step, or a function, starts a task for the agent (the function's one line of code is in §13).
  • From Telegram — each message to your bot is a task for the agent you picked on the Channels page, or for the agent whose name starts the message.
  • From its to-do — under Settings → When it runs, Work through its to-do: On (a new agent you make on the dashboard, when you may turn agents on; one made from the AI chat or your own AI, an app's agents and anyone else's start Off), a task you add under Tasks starts by itself when the agent is free, then the next, one at a time; Only when it runs, a task waits for Run a task with nothing typed, or for a scheduled task with no task text of its own. Each task can also say for itself: Yes (start as soon as it is free), No (wait), or At a time (it starts then; a time in the past is refused). The New task box asks When: Now, When it's free, or At a time. Every limit still applies (a paid plan, runs per day, spending limits, approvals): a task a limit holds back stays Planned and says why, with a link to the limit. The AI chat and your own AI do the same (the tools' names are in §13).
  • From your own AI — an AI app you connected, like Claude or ChatGPT, can start a task and pass on your answer when the agent asks you a question (how is in §13).
  • Another agent asks or starts a sub-agent — each of those is a task for the agent that gets it (who may ask whom is in §6).
Webhook and email payloads, and what a connected app sends back, reach the agent marked as outside content: it is told to treat it as data, not instructions, and it can never give the agent more than you gave it.
Your OK before anything starts on its own. When the AI chat, your own AI app or an API key switches on something that makes an agent run later by itself (a scheduled task, its to-do or a task that starts by itself, a webhook, the agent itself, an event or incoming mail aimed at it), nothing changes until you allow the card it makes. The AI tells you first what the dashboard would have told you (on a Free plan a schedule starts nothing until you move to a paid plan; an agent that sends email needs a mailbox). Only the person who asked allows their card. Allowing applies exactly what was asked, once; Don't allow changes nothing. The card never shows a new webhook's address; after you allow it, you find it on the agent's Settings, When it runs, and your AI can read it there too when you may turn agents on. Switching any of these off is at once, and doing it yourself in the dashboard needs no card. An agent run nobody started, a flow or a function can never switch them on.

3. Sending email

Grant the email ability and an agent can send replies, reminders, and reports. It sends from your own mailbox (More → Sending accounts): your default one, or the one the agent names. There is no platform sender and no monthly quota from us; with no mailbox, nothing is sent and the run says why. Sending is an external action, so it pauses for approval unless the agent is on full autonomy.

4. Approvals & safety

Agents are safe by default. In Ask first mode, the run pauses and waits for you before anything that reaches outside or can't be undone:

  • External — sending email, calling a function, or using a connected app.
  • Publish — pushing a site live or unpublishing it.
  • Payments — anything touching money.
  • Destructive — deleting a project, table, rows, or a function.
  • Changing a site it only holds read-only — the run pauses the same way.

Paused runs wait on the Approvals page (and on the agent’s own Needs your approval tab). An agent that a site page or an event starts runs as your workspace, inside its own sites, bases, tools and approvals — never with the visitor’s rights and never with more than you gave it. An agent never sets or sees your secret values: you name the secrets it may use and the hosts they may go to, and the server fills them in. An agent also never reads a person’s email address from run history (journey runs, event trigger runs, flow and function runs): it sees it masked, like g***a@example.com. You and your own AI (the chat, your own AI app or an API key) see it in full.

When your AI (the chat, your own AI app or an API key) asks for several changes in a row, they come to you as one card on its /pending/ page and on Approvals (the chat shows each change as its own card): each change keeps its own Allow and Don't allow, and Allow all / Refuse all answer the waiting ones the card shows you. A High one, or one you can't allow, is left waiting by Allow all and needs its own tap; a change that joins after the card was shown waits until you look at it; and each change says what happened to it.

Your AI (the chat, your own AI app or an API key) never switches on by itself something that runs later: a schedule, a webhook, an email or event trigger, a flow with a trigger, or a function with live triggers. It asks you on a card, and nothing runs until you tap Allow. A new time that makes a schedule that is on run more often asks the same way. Switching off is at once, and so is anything you do yourself in the dashboard.

Being switched on: on the Allow card your AI asks for when it wants a paused step approved, you choose Allow once (this one step runs), Always allow (it runs, and the agent stops asking for that kind of step, for example publishing; its other approvals and money allowance stay as they are) or Don't allow (nothing runs). Always allow is offered only to someone who may change the agent's approvals, and never for a money step or an app's permission: a person always approves those. It is not offered on an app's action step (the action can also ask by its own setting, which Always allow would not stop; to stop the agent asking before changes in apps, untick Sending email and app changes) or for a step a connection's own approval setting paused, because the agent's setting is not what asks there. Change it back in the agent's settings, under When it asks you.

On top of that: every run has a spend cap, a daily run limit, an action limit, and a hard time limit — reach any and the run stops cleanly. You see every step it took, the exact input and output of each tool call, and can hit Stop at any moment. Scripts are sandboxed (§9) and secrets stay server-side (§11).

What a run costs, and its limits. Running an agent needs a paid plan. A run on our models uses AI credits; a run on your own key uses none, but its run time counts toward your plan's included compute. Each run shows what it used. For runs on your own key you can set dollar limits per run, day, week, month or year in Settings → Cost and limits(everyone sees them; only a person who may see the payment details changes them): the run is checked against its exact cost before each model call and stops or pauses at the limit. With a dollar limit set, a model that has no price does not run, and the agent's page says why. For every run, on our models or your own key, you can also set token limits per run, day, week or month there (anyone who may change the agent can): each step's input and output tokens are counted before the next one, and the run stops or pauses at the limit.

5. Who an agent acts as

  • Every run. An agent run always uses the agent's saved setup, whoever starts it (a person on the dashboard, AI chat, MCP or API, a schedule, a trigger, a hand-off): who started it is recorded, never their permissions.
  • Access. "Full access" gives it every tool, connection, site and base of the workspace an agent may hold, including ones added later; only someone who may use everything can switch it on, and deletes and money beyond its allowance ask first by default. "Custom" gives it only what was picked, and you can pick only what you may use.

An everyday example: the Invoice chaser agent may read the Invoices base and send email. Whether Priya asks it in the AI chat or it runs on its Monday schedule, it does exactly the same: what it was set up to do.

6. Groups and hand-offs

Try one agent first. Start with ONE agent plus skills. Add a second only for different rights (a secret or connection the first should not have), a different schedule or trigger, or parallel runs. Prefer asking another agent (it answers back) over handing off. Asking another agent returns its answer to the first one, in the same run. A hand-off passes the work on: the first agent does not get the result back.

A group is a set of agents that work together, like a marketing group of agents. Make one on the AI Agents page under Groups, or ask the chat. An agent can hand work to and ask the agents on its “Can hand off work to another agent” list, and the agents in its groups (a group’s Lead also reaches the other groups’ Leads). A group gives no agent any ability.

  • A group gives no abilities. Each agent keeps its own tools, sites and approvals, and runs as its own setup, whoever starts it (§5).
  • A Lead. Give a group a Lead and it can also reach the other groups’ Leads, so teams can pass work to each other through their heads.
  • Sub-groups report through their own Lead: a sub-group is not part of its parent group. A workspace has at most 100 groups (sub-groups count), a group at most 50 agents, and groups nest at most 3 levels.
  • Limits. How often an agent hands work to or asks other agents in one run has no default limit; ask the AI chat to set a maximum for that agent (1 to 50), and the next one past it is refused, with the reason. What always applies: 20 agent runs at once per workspace, hand-offs at most 3 levels deep, and your credits.
If an agent holds or reaches something you may not use, such as a secret (“Use secrets”) or the power to email your contacts (“Send email to contacts”), you are refused when you save it, arm its trigger or put agents in touch with it (a hand-off list, a group, a Lead). The refusal names the permission and whom to ask.

For builders

Everything above is all an owner needs. The rest of this page is for people who want to see how it is built: skills and their files, scripts, functions, secrets, a worked example with code, and the names your own AI and your code use.

7. Skills & the SKILL.md format

A Skill is a reusable playbook an agent follows for a kind of task. Serenities uses the open Agent Skills (SKILL.md) standard — the same format as Claude and ChatGPT skills — so a skill from any public library drops in unchanged. A skill is a folder:

my-skill/
├── SKILL.md          # required: YAML frontmatter + instructions
├── references/       # docs the agent loads only when it needs them
├── scripts/          # Python or Node the agent runs (stdin → stdout)
└── assets/           # templates/files used in the output

The SKILL.md front-matter carries the standard fields:

---
name: contact-triage
description: Classify a contact enquiry and answer it from the FAQ.
  Use whenever a contact form is submitted.
license: Apache-2.0
allowed-tools: [skills_run_script, web_fetch, email_send]
---

# Contact triage
1. Run scripts/classify.py to categorise the message.
2. Read references/faq.md for the facts.
3. Reply to the person by name using only those facts.

allowed-tools narrows a run. After the agent reads a skill that lists Serenities tools, its other tools are refused for the rest of that run unless the skill lists them (it can never add tools the agent was not given). The agent’s plan, memory and questions still work, and so does reading the skill’s own files. A skill with no list, or a list with none of our tool names in it (for example one written for another product), changes nothing. You change a skill’s list by uploading a new version of it (the agent’s Settings → What it remembers → Import skill, as a .zip bundle; a single SKILL.md does not carry the list).

Three ways to add a skill to an agent:

  • Ask the chat — “give this agent a skill that…” and it writes the SKILL.md and scripts for you.
  • Upload a .zip/.skill bundle (or a single SKILL.md) in the agent’s Settings, under What it remembers.
  • The agent writes its own — when Learning is on, an agent saves a playbook once it finds a procedure that works.

Every skill lives in a shared Skills library (the Skills tab), so once you have one you can reuse it across as many agents as you like — tick it on for another agent there, or just ask the chat to. Edit it in one place and every agent that uses it stays in sync.

Progressive disclosure keeps it cheap: only each skill's name + description sit in the agent's context at all times; the full playbook loads when the skill is triggered, and a reference or asset loads only when the agent actually opens it.

8. When does an agent use a skill?

This is the important part. Every skill's name and description are always in the agent's system prompt. When a task comes in, the agent matches the task against each description and, if one fits, reads the full skill first and follows it. It is the same mechanism Claude uses — the description is the trigger.

So triggering is only as good as your description. Write it to say both what the skill does and when to use it:

  • Third person, specific. “Extracts text and tables from PDFs. Use when the user uploads a PDF or mentions forms.”
  • Include the trigger words a real request would contain (“refund”, “invoice”, “shipping”).
  • Avoid vague descriptions like “helps with documents” — the agent can't tell when to reach for it.

If an agent isn't using a skill you expected, tighten its description — that is almost always the fix.

9. Scripts — Python & Node

A skill's scripts/ hold real code — Python or Node — for the deterministic parts a program does better than prose (parsing, maths, formatting, date logic). The agent calls a script, which reads its input as JSON on stdin and returns its result on stdout:

# scripts/classify.py
import sys, json
d = json.load(sys.stdin)
msg = d["message"].lower()
urgent = any(w in msg for w in ["urgent", "refund", "damaged"])
print(json.dumps({"category": "support", "urgent": urgent}))

Every script runs in a locked-down sandbox — this is the whole point:

  • No network, no filesystem beyond the skill itself — it can't read your secrets or reach your database.
  • Capped CPU, memory, processes, and time — a runaway or malicious script can't affect anything else.

Because scripts have no network, fetching external data is the agent's job: the agent uses web_fetch (below) to get the data, then passes it into the script as input. Clean separation — the fetch is guarded, the script stays airtight.

10. Functions & external APIs

There are two ways an agent reaches the outside world, for two different needs:

web_fetch — public data

Fetch a public URL or open API. HTTPS only; internal/private addresses are blocked. Great for public data (prices, holidays, public records). It cannot send auth headers by design. Turn it on with the agent's web ability (grants.capabilities “web” for an AI); it is never put in the tool list.

Functions — authenticated calls & logic

A function (in a site or in your workspace) is your own code (with ctx.fetch, your data, email) that the agent invokes and gets a result from. This is how an agent calls an authenticated API — the key stays inside the function (next section).

To let an agent run a function, grant it the invokeFunction ability. Functions are also how you give an agent bespoke logic that doesn't belong in a skill script (it needs your database, or a secret, or to send email as part of the work).

There's a third route outward: connected apps. Anything you've connected under Connections (Gmail, Slack, and the like) can be handed to an agent — and you choose exactly which of that app's tools it may use, switching each one on or off. Using a connected app reaches outside your account, so it pauses for approval too.

11. Secrets & API keys — never exposed to the agent

You can give an agent the power to call an API that needs a key without the key ever reaching the agent or the AI model — the same principle Claude uses (the secret is substituted into the request server-side; the model never holds it). The recipe:

  1. Store the key as a Secret (More → Secrets). It's encrypted at rest and is write-only — nothing, not even an agent, can ever read the value back.
  2. Write a function that uses it through ctx.secrets.ref('NAME') — a marker that works only in that run. The real value is swapped in by the platform on the way out, only for the hosts you allowed — the code never sees it, and text that arrives from outside can't ask for it:
// function: chargeCustomer
const res = await ctx.fetch("https://api.stripe.com/v1/charges", {
  method: "POST",
  headers: { Authorization: "Bearer " + ctx.secrets.ref("STRIPE_KEY") },  // filled server-side
  body: JSON.stringify({ amount: params.amount }),
});
return { charged: res.status === 200 };   // only THIS returns to the agent
  1. Grant the agent invokeFunction and let it call chargeCustomer.

The key is decrypted only inside the throwaway sandbox that runs the function, injected straight into the outbound request, and only the function's return value ({ charged: true }) comes back to the agent. The API key is never in the agent's prompt, its context, or its transcript.

Someone without the Use secrets permission is refused when they save or arm an agent that holds or reaches a secret, and the refusal says whom to ask (see §6 for agents in groups).

Because a function can do anything (charge a card, hit a paid API), invoking a function pauses for your approval in Ask first mode. Switch the agent to Full autonomy only when you trust it to run its functions unattended.

12. Example: a contact form answered by an agent

Here is everything above working together — a real pattern you can build today.

  1. Build the agent (“Contact Concierge”) and give it a skill, contact-triage, with an FAQ reference, a Python classifier, and a Node script — plus a webhook, the web ability, and the email ability.
  2. Put a form on your site that POSTs the fields to the agent's webhook URL:
await fetch("https://app.serenitiesai.com/api/agents/webhook/<token>", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ name, email, subject, message }),
});

On each submission the agent runs its skill end to end:

  • Reads the skill, then runs classify.py (Python) → category, urgency, priority.
  • Uses web_fetch to pull live UK bank-holiday data, then runs schedule.js (Node) to work out the next working day for a reply.
  • Reads the FAQ and policy references for the facts.
  • Writes a tailored answer and email_sends it to the person — grounded only in your FAQ.

The visitor gets a real, on-brand answer by email in a couple of minutes; you get a full transcript of every step in the dashboard.

13. Your own AI and your code

Agents are fully available over MCP — Claude Code, Codex, or any MCP client can build, run, and manage them with the aiAgent_* tools. Backend functions can hand work to agents in one line: ctx.agents.enqueue('Agent name or id', task, data). Skills are the open SKILL.md standard, so anything you author here is portable.

  • Webhook — a secret URL. POST JSON to it from anywhere (a contact form, another app) and the body becomes the agent's task.
  • From your own AI over MCP — Claude, ChatGPT or any MCP client starts a task, waits for its result in one call, and passes on your answer when the agent asks you a question.
  • From a function — a function that calls ctx.agents.enqueue starts a task for the agent (§2).
  • Continue a failed task (§1) — the AI chat and MCP do the same with aiAgent_continueRun.
  • An agent's to-do (§2) — the AI chat and your own AI over MCP add a task and change one with agentTasks_add and agentTasks_update.
  • Your own AI keys in functions — the keys you add under Your AI work in functions through ctx.ai.generate.