Sessions
Allowed actions
Control which actions and components an agent may declare.
allowedActions control which actions and components an agent may declare in the browser. Your server sets them when creating a createAgentTask session. The React SDK only receives a clientToken and cannot widen the list.
How allowedActions apply per task type:
| Task type | allowedActions |
|---|---|
EXPLORE_MEMORIES | Optional. Allowlist of component names, such as renderPieChart. Absent means unrestricted. |
EXPLORE_PRODUCT | Optional. Allowlist of action and component names, such as setTheme and renderPieChart. Absent means unrestricted. |
MEMORY_CHAT | Not supported |
MEMORY_SEARCH | Not supported |
STREAMING_CHAT_COMPLETION | Not supported |
STRUCTURED_CHAT_COMPLETION | Not supported |
How they work
The names you list are the only ones the webapp may declare when it starts the task. If the client declares a name that is not on the list, task creation fails.
- Explore Memories uses
allowedActionsfor components only (renderPieChart,renderTimeseriesChart). - Explore Product uses
allowedActionsfor both actions (setTheme,applyFilter) and components.
Leave the field off when any declared name should be allowed.
Examples
EXPLORE_MEMORIES
{
createAgentTask: {
taskType: 'EXPLORE_MEMORIES',
allowedActions: ['renderPieChart', 'renderTimeseriesChart'],
},
}EXPLORE_PRODUCT
{
createAgentTask: {
taskType: 'EXPLORE_PRODUCT',
allowedActions: ['setTheme', 'applyFilter'],
},
}See Sessions for full request bodies per task type.