Tool Call Consent
When the Bot Provider configures a Toolset that requires user consent, the SDK automatically pops up a consent modal before the agent runs the tool, asking the user to make a decision for each tool call before execution continues.
No extra wiring is required — ToolCallConsentGate is built into the
<Chatbot> component.
Three Decisions
| Decision | Description |
|---|---|
| Allow for This Chat | Approve this call and auto-approve every subsequent call to the same tool for the rest of this conversation |
| Allow Once | Approve only this call |
| Deny | Reject this call; you may add an optional reason so the agent knows why it was denied |
Auto-skip Rules
The SDK does not show the modal and handles the call directly in two cases:
alreadyAllowed: true— the backend marked it as already authorized (e.g. an earlier turn chose Allow for This Chat); autoALLOW_ONCE.- Allow for This Chat within this batch — once a tool has been granted Allow for This Chat in the same batch, later calls to the same toolset / toolName are auto
ALLOW_ALWAYS.
Usage
No configuration is needed — as long as the Bot Provider's Toolset has consent enabled, the SDK handles it automatically:
<Chatbot
config={{
apiKey: 'your-api-key',
botProviderEndpoint: 'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}',
}}
customChannelId="your-channel-id"
/>
Two-step Deny
To avoid accidental clicks, Deny is a two-step submit:
- First Deny click — expands the Reason input, and the button changes to Send Deny.
- Second Send Deny click — actually submits the rejection (Reason may be left empty).
Theming
The modal follows the Chatbot's --asg-color-* design tokens by default, so no
extra setup is needed.
In addition, since 0.2.61, the modal's accent color (tool-name highlight,
primary button, focus ring) automatically follows the brand color you set via
theme — the resolution order is chatbot.primaryComponent.mainColor →
chatbot.mainColor → userMessage.backgroundColor, and the text painted on the
accent comes from the corresponding secondaryColor. So once you set a brand
color through theme, the consent modal usually needs no manual CSS-variable
overrides.
If you still need to override individual colors, set the CSS variables on any parent element:
.my-chatbot-wrapper {
--asgard-consent-modal-bg: #0f172a;
--asgard-consent-modal-accent: #6366f1;
--asgard-consent-modal-danger: #ef4444;
}
| CSS variable | Purpose | Fallback |
|---|---|---|
--asgard-consent-modal-bg | Modal background | --asg-color-surface |
--asgard-consent-modal-border | Border color | --asg-color-border |
--asgard-consent-modal-title | Title / primary text color | --asg-color-text-primary |
--asgard-consent-modal-muted | Secondary text color | --asg-color-text-secondary |
--asgard-consent-modal-accent | Accent color (Allow for This Chat button) | --asg-color-primary |
--asgard-consent-modal-danger | Danger color (Deny button) | --asg-color-error |
--asgard-consent-modal-input-bg | Deny Reason input background | --asg-color-bg |