The outcome
Ship a useful conversational workflow that cannot act on another user's data or expose backend credentials.
Step by step
A workflow you can repeat.
- 01
Define the user journey, agent capability, authorized resources, shared state schema, model boundary, failure states, and success metrics.
- 02
Create the minimal CopilotKit UI and server-side runtime, keeping provider credentials and privileged service connections outside the browser.
- 03
Authenticate every request and resolve resource ownership on the server rather than trusting thread IDs, tool arguments, or client-supplied state.
- 04
Add one typed read-only tool and visible streaming states, then test malformed input, cross-user access, prompt injection, cancellation, timeout, and backend failure.
- 05
Add tracing, rate and cost limits, retention rules, and support diagnostics before gradually enabling users and monitoring real failure patterns.
Working standard
What good use looks like.
- Authorize resources server-side.
- Keep provider keys off the client.
- Start with read-only tools.
Official references