If you do not have CSPs configured, they do not interfere with botBrains. If you have some in place, you must update them when integrating botBrains. If you don’t know what CSPs are, you likely don’t have them configured.CSPs require deep browser understanding and configuring a single character wrong can trip you up. We are here to help-reach out to support@botbrains.io or via live chat on platform.botbrains.io.
What are CSPs?
Content Security Policies (CSPs) are security measures implemented by web browsers to prevent various types of attacks, particularly cross-site scripting (XSS) and data injection attacks. They work by allowing servers to specify exactly which sources of content browsers should consider trustworthy for loading resources like scripts, stylesheets, images, fonts, and more. Servers apply CSPs through HTTP response headers or HTML meta elements, creating a security layer that blocks potentially malicious content from executing.How do I know if we use CSPs?
Check if your server returns this header on the main HTML document served:Why do I need to change CSPs when integrating botBrains?
When integrating botBrains (via the HTML/JS snippet), your CSPs may block our functionality. Because we run in your domain context, strict CSPs can prevent script execution, API communications, or dynamic content generation. You must update your CSP directives to explicitly allow botBrains to operate correctly.Main Endpoints
We bundle our dependencies with pinned versions, so botBrains loads no scripts from third parties. We list exact hosts and only target botBrains-owned systems to reduce the surface for data exfiltration in a possible XSS incident. Your CSP must allow communication with the following endpoints:https://api.botbrains.io- Primary API for back-end communicationhttps://chat.botbrains.io- Used for chat functionality and script loadinghttps://files.botbrains-cdn.com- Files and images shared in conversations, and their previewshttps://ec.botbrains-cdn.com- Event capture for product analytics, which enforces that data is only sent to botBrainshttps://o4507142511984640.ingest.de.sentry.io- Error reports of the chat bubble, sent to botBrains’ error monitoring in the EUdata:...- Used to load image and audio data
Recommended CSP Configuration
In addition to your current rules, add these directives:unsafe-inlinefor CSS cannot be changed currently. Reach out to support@botbrains.io if this is a deal-breaker.unsafe-inlineforscript-srccan be replaced by'nonce-{SERVER-GENERATED-NONCE}'if you add a nonce to the loader script:<script nonce='{SERVER-GENERATED-NONCE}'>$botbrains = []; ...</script>.
Explanation of Directives
The wildcard* matches multi-level domains. For example, *.example.com won’t match example.com but will match any subdomain, including nested subdomains (for example, two.one.example.com).