How to embed governed conversational insights in a product you already ship
When a user asks a question your documentation already covers, they often wait on a ticket, or they get a reply with no source. Adding a new window and a new login creates a second identity for security to review, and it
When a user asks a question your documentation already covers, they often wait on a ticket, or they get a reply with no source. Adding a new window and a new login creates a second identity for security to review, and it pulls people out of the product they already use.
STEWARD sits inside that product and gives them AI-powered conversational insights from your own material, with a source on every answer. There is no new ID. The surface takes your colours and type. Live reads, if you turn them on, go out under the session the user already has.
Account, source, key, snippet
You can create a free account in about 3 clicks. Then create a product, connect a GitHub repository or a Google Drive folder, and sync it. Mint a publishable key and list every origin the browser will send. Paste the official snippet into a page on one of those origins.
From a free account to a working embed, plan on about 20 minutes. The same path is on screen in 90 seconds, at the free quick start.
The official snippet
Load the bundle once.
<steward-chat widget-title="Ask STEWARD"></steward-chat>
<script src="https://cdn.steward.link/steward-chat.min.js"></script>
<script>
(async function () {
await customElements.whenDefined('steward-chat');
const widget = document.querySelector('steward-chat');
widget.apiKey = 'stw_pk_live_...'; // your publishable key
})();
</script>
The bundle is about 236 kB minified, about 71 kB gzipped, with no peer dependencies. It already knows the data plane, so you set no endpoint. Declare UTF-8 on the page. There is no npm package.
Wait for customElements.whenDefined('steward-chat') before you touch properties. If you assign apiKey too early, the upgrade resets it to null. The first send then goes out with no key, and STEWARD refuses it.
Set apiKey as a JavaScript property. The widget ignores an api-key attribute. Use a publishable stw_pk_ key. A secret stw_sk_ key never goes in the page.
In the default mode, a launcher button in the bottom-right corner opens the panel. A side panel or an inline embed is also available. The widget keeps its DOM and styles in Shadow DOM. Theme it through the documented hooks so it matches the host product, not by poking at its internals.
Origins and public keys
A publishable key is public. It ships in your page, where anyone can read it. Allowed origins bind browsers. A script outside a browser can send any Origin, so anyone holding the key can talk to that product and spend the account's insight credits.
Write each origin the way the browser sends it: scheme, host, and any port, with no path, no trailing slash, and no wildcard. https://example.com and https://www.example.com are two origins. Add your local dev origin as well, such as http://localhost:5173. A new key, and any change to its origins, takes effect within about 12 seconds.
The console shows a publishable key once, at mint time. STEWARD keeps only a fingerprint. If you lose the key, or it is misused, revoke it and mint another.
If the first question fails, wait those 12 seconds, then confirm the page is on an allowed origin, the key is a publishable one, and the source has finished a successful sync. A request STEWARD refuses before it reaches the product leaves no trace.
Same login, same permissions
Answers from your documents work for a signed-out visitor.
To let answers draw on the user's own data in your API, turn on the application API in the product's configuration, give it a base URL and an OpenAPI spec, and name the paths STEWARD is allowed to call. Then, after whenDefined, assign the same session token your frontend already sends to widget.authToken. Use null when the user is signed out.
STEWARD forwards that token as Authorization: Bearer on every live call, and never parses, validates, or stores it. The token is not written to the trace. Your API keeps deciding what that login can see. Every live call is a GET. STEWARD reads. The person decides. It does not book, send, approve, or change a record.
Keep the refresh token in your auth layer. Only the short-lived session token belongs on the widget. Renew it before it expires, because STEWARD reads it at send time and your API uses it mid-answer.
An empty allowlist for API paths admits every path under the base URL. Name the read endpoints you mean to expose.
What you see after the first question
Open the page from an allowed origin and ask something your documents already cover. The answer streams in, and the widget lists the documents found. In the console, Traces holds the full record of the turn: the sources, any live reads, and the stop reason.
STEWARD answers only from the material it was given, and it says so when the answer is not there. That refusal is recorded like any other turn.
Model calls run on Amazon Bedrock, inside AWS. STEWARD holds no API key for any model provider. Your content is not used to train models. STEWARD sees only what you connect and authorize.
STEWARD is free to start. You can create your free account here:
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.