> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate agent assist

> Add an on-demand Voiceflow assistant to your contact-center staff workspace. A teammate asks a question about the current case, receives policy guidance or a proposed…

Add an on-demand Voiceflow assistant to your contact-center staff workspace. A teammate asks a question about the current case, receives policy guidance or a proposed reply, and decides what to send. The customer stays with the human.

This guide connects an existing assistant to a signed-in staff application. It does not configure automatic call listening, live transcription or proactive suggestions.

## Before you begin

- A working read-only staff-facing Voiceflow agent, such as the [Agent assist example](/docs/guides/agent-assist), and a test Environment you can publish.
- A contact-center workspace that permits a staff application, embedded panel or approved link. Confirm its extension and authentication requirements with your administrator.
- A developer who can add an authenticated server route and read a case through the staff member's existing permissions. A shared widget key is not case-level authorization.
- A fictional case, two test staff accounts with different case access, and a teammate who will review the proposed reply.

## Connect the staff assistant

### 1. Prepare the staff-facing agent

#### Studio

Open [Agent studio](https://creator.voiceflow.com), choose the staff assistant's project and test Environment, then open **Agent**. Confirm it answers the staff member, labels proposed customer replies, and uses the approved policy sources. This example supplies case context through the staff application's server and uses a read-only policy assistant.

Northstar Support Desk agent instructions for staff policy guidance and draft replies — Keep policy guidance and proposed customer replies distinct in the staff assistant.

Publish the tested assistant to the dedicated Environment. Give your developer its project ID and Environment alias; the developer obtains the API credential through your approved secret-management process. Do not paste credentials into a ticket or agent instructions.

#### Developer

Obtain the ready staff assistant's project ID, test Environment alias and server-side API credential. Its instructions must treat case text as reference data, answer the staff member, and leave customer messages to human review. Confirm the Environment has a Published version before calling it; a Studio preview is not that release.

If you manage the agent headlessly, use [Get agent](/docs/api-reference/agent/get-agent) to inspect the existing instructions and tools. Preserve those fields when making a targeted update, then [publish the test Environment](/docs/api-reference/environment/publish-environment). This guide begins with a working assistant; it does not create one from an empty project.

### 2. Authorize staff and load the case on your server

#### Studio

Have your developer deploy the [server starter](/docs/examples/contact-center-assist/assist.mjs) and [client helper](/docs/examples/contact-center-assist/client.mjs) connected to your staff sign-in and case-permission checks. Hand over the approved case fields and permitted staff roles. Ask for the staff application URL, a case you may access, a case you may not access, and confirmation that the server targets your published test Environment.

Before proceeding, open that URL as a test staff member. It must require sign-in and refuse a case outside that staff member's access. A Studio Run screenshot cannot verify those permissions.

#### Developer

Download [assist.mjs](/docs/examples/contact-center-assist/assist.mjs) and [client.mjs](/docs/examples/contact-center-assist/client.mjs). Mount the handler as `POST /api/agent-assist` in your existing staff application. The server needs Node.js 22 or later and these server-only settings:

```js title="Wire the existing staff and case authorization"
import { createAssistHandler } from './assist.mjs';

export const POST = createAssistHandler({
  projectID: process.env.VF_PROJECT_ID,
  environmentAlias: process.env.VF_ENVIRONMENT_ALIAS,
  apiKey: process.env.VF_API_KEY,
  requireStaff,
  loadCaseForStaff,
});
```

Supply the two adapters from your application:

- **`requireStaff(request)`** verifies your existing staff session and returns its principal, or `null`. Apply your application's CSRF protection to this route when authentication uses cookies.
- **`loadCaseForStaff(staff, caseId)`** checks that staff member's access and reads the case from your contact-center backend. Return `{ id: caseId, context: "Approved case summary" }`, or `null` when access is denied. Exclude unnecessary personal data and provider credentials.

These are required adapters, not functions supplied by Voiceflow. The handler ignores browser-supplied case context, creates a fresh Voiceflow conversation for each request, sends `launch`, and streams the staff question plus authorized context. It keeps both the project credential and runtime session key on the server. The starter supplies case text; it does not propagate staff authorization into agent tool calls. Use the read-only assistant specified above.

### 3. Add the staff panel or approved application link

#### Studio

Ask your contact-center administrator to add the authenticated staff application to the case workspace using its supported extension mechanism. If embedded applications are unavailable, use an approved link to the same signed-in application. Confirm it opens the intended test case and never sends a customer reply automatically.

Your developer must provide a working panel or URL before you can complete this step. The Creator captures here show the assistant configuration, not a built-in provider panel.

#### Developer

Use your provider's supported application extension or an approved link to your staff application. Pass only a case identifier from the workspace; the server checks access and loads the data. Wire your staff question form to the client helper:

```js title="Display a proposed reply for staff review"
import { askAssist } from './client.mjs';

async function suggest(caseId, question, output) {
  output.textContent = '';
  try {
    for await (const text of askAssist({ caseId, question })) {
      output.textContent += text;
    }
  } catch {
    output.textContent = 'Suggestion unavailable. Continue in your normal workspace.';
  }
}
```

The helper parses complete SSE events, renders only text traces, and treats an error event or missing end event as failure. Keep the output labelled as a suggestion. Use `textContent`; do not interpret case or model text as HTML. Do not connect this handler to a public customer widget or the customer's active phone session.

### 4. Verify assistance and access boundaries

Open fictional case `CC-1042` as an authorized staff member and ask a question whose answer requires its approved context. Confirm that the suggestion refers to that case and remains a draft until the staff member sends it.

Then repeat with the unauthorized staff account. It must receive an access denial without a Voiceflow request. Switch to a second case and verify that the first case's context does not appear. Finally, make the assistant unavailable in the test configuration: the staff member must still be able to use the normal contact-center workspace.

## Completion check

A signed-in teammate can request a suggestion for an authorized case, review it and continue the customer conversation. An unauthorized case is blocked, case context does not carry across requests, and an assistance failure leaves the staff workflow available. Use [Test and launch your integration](/docs/guides/integrations/contact-centers/test-connection) to release the integration.
