> ## 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.

# Use agent assist with Amazon Connect

> Add Voiceflow agent assist to Amazon Connect's staff workspace. Authorize case context and review suggested answers before replying.

## Overview

Run the staff panel as a Per-contact Standard application in the Connect agent workspace. It reads the contact ID from the workspace, checks staff access and loads approved contact attributes automatically. Staff choose a task and review the result in the panel.

Both the interface and server remain in your staff host; Voiceflow runs the published read-only assistant. This walkthrough is on demand. It does not listen to calls, ingest a live transcript or send a customer reply automatically.

<a id="requirements"></a>

## Prepare the staff deployment

Gather the assistant, staff identity and provider permissions once.

| Requirement | Owner and readiness check |
| --- | --- |
| Published read-only assistant | Voiceflow owner supplies approved Knowledge, project ID, Published test Environment alias and a server API credential. Start with [Build an agent assist assistant](/docs/guides/agent-assist). |
| Protected staff host | Developer supplies HTTPS, existing staff sign-in, CSRF, body/rate limits and iframe-compatible SSO. [Shared setup](/docs/guides/integrations/contact-centers/agent-assist#connect-the-staff-assistant) defines these adapters. |
| Connect workspace and third-party apps | Administrator supplies a supported Region/instance and permission to register and assign a Per-contact Standard application. |
| Authorized contact attributes | Flow owner populates `case_reference`, `reason_for_contact` and `product`. Server uses an IAM role with `connect:GetContactAttributes`; staff assignment service verifies the contact and supplies its initial contact ID. |
| Acceptance cases | Administrator supplies two sandbox staff accounts with different access and two known cases/contacts. Use fictional data. |

Download and extract the [starter bundle](/docs/examples/support-platforms-starter.zip). Keep `support-platforms`, `contact-center-assist` and `amazon-connect` as sibling directories. The app reuses your host’s verified staff session; platform registration alone does not create one. Test SSO in the actual embedded browser.

<a id="installation"></a>

## Install the staff entry

Connect the server, generate the platform app and open a sandbox interaction.

### 1. Connect the provider reader

Install `@aws-sdk/client-connect` in your existing Node.js 22+ staff server, then use the supplied Connect factory:

```js title="Mount the Connect staff routes"
import { ConnectClient, GetContactAttributesCommand } from '@aws-sdk/client-connect';
import { createConnectRoutes } from './support-platforms/providers.mjs';
import { requireStaff, verifyCsrf, authorizeContact } from './staff-adapters.mjs';

export const handleAssistRequest = createConnectRoutes({
  projectID: process.env.VF_PROJECT_ID,
  environmentAlias: process.env.VF_ENVIRONMENT_ALIAS,
  apiKey: process.env.VF_API_KEY,
  connectClient: new ConnectClient({ region: process.env.AWS_REGION }),
  GetContactAttributesCommand,
  instanceId: process.env.CONNECT_INSTANCE_ID,
  requireStaff, verifyCsrf, authorizeContact,
});
```

`requireStaff` verifies the host session and tenant. `authorizeContact(staff, contactId, { signal })` checks the trusted assignment/case service for this instance and returns the **initial contact ID**, or `null`. The loader refuses unauthorized contacts before any AWS read. Do not return the browser ID unchanged without an access check. The server owns the Region, instance and IAM role; the browser receives no AWS credentials.

Mount `handleAssistRequest` at both same-origin POST paths: `/api/agent-assist` and `/api/agent-assist/context`. Apply a 32 KiB body limit, bounded authentication/provider reads and staff rate/concurrency limits. `verifyCsrf` applies the host’s policy to both routes. Keep Voiceflow and provider credentials on the server.

### 2. Build and install the platform app

Replace `https://staff.example` with your staff host’s HTTPS origin, without a path. From the extracted archive root:

```bash title="Build the Per-contact workspace page"
npm install --prefix support-platforms
node support-platforms/setup.mjs amazon-connect https://staff.example
```

The command creates `assist-build/amazon-connect/`: `panel.html`, `panel.css`, a bundle containing the tested `@amazon-connect/app@1.0.15` entry, and `SETUP.md`. Serve the three panel files together at `https://staff.example/support-platforms/amazon-connect/panel.html`, behind staff sign-in. No script replacement or separate SDK bundling is needed.

In **Connect console → Integrations → Add integration**, choose **Standard application**, enter that HTTPS access URL and select **Per contact** scope. Associate the pilot instance, grant the application to the pilot security profile and use only approved iframe origins/permissions. Open it from the workspace Apps launcher during an assigned test contact and complete staff sign-in. If the menu is absent, check [regional availability and prerequisites](https://docs.aws.amazon.com/connect/latest/adminguide/3p-apps.html).

Use `Cache-Control: no-store` and a restrictive CSP permitting the actual workspace and SSO ancestors. The setup command refuses to overwrite an existing build directory; append a new output directory after the origin when rebuilding.

### 3. Check context and choose a task

The saved ticket/contact ID appears automatically. Wait for **Case context ready** and inspect **Approved case context**. A denied context check leaves tasks disabled and starts no Voiceflow request. Each later task reloads its snapshot on the server.

| Task | Expected result |
| --- | --- |
| **Find policy** | Policy source, applicable conditions and missing facts for staff. |
| **Draft reply** | Customer-facing wording only, for human review; no invented approval or completed action. |
| **Suggest next step** | One useful check, its reason and any escalation condition. |
| **Summarize** | Facts, recorded actions and unresolved work from the available snapshot. |

The question box is optional for these four actions. Use it to focus a task, or enter a question and choose **Ask assistant**. No task runs just because a ticket/contact opens. Configure the assistant to honor the selected task’s output format; if a reply contains internal guidance, edit or regenerate it before using it.

<a id="case-context"></a>

## Configure case context

Follow the workspace selection while keeping authorization on the server.

The browser entry reads `event.context.scope.contactId` only when the [workspace scope is `contact`](https://docs.aws.amazon.com/agentworkspace/latest/devguide/integrate-with-contact-data.html). Idle scope keeps the task controls disabled. Create binds the new contact; destroy clears the ID, approved snapshot and answer, and discards late results. No manual case ID or **Finish case** step is required.

The backend checks contact entitlement and calls [GetContactAttributes](https://docs.aws.amazon.com/connect/latest/APIReference/API_GetContactAttributes.html) with the trusted initial contact ID. Only `case_reference`, `reason_for_contact` and `product` enter the snapshot. These attributes do not include a live transcript or full CRM case. If a CRM record is needed, resolve the reference and recheck that record’s staff/tenant access on the server before adding approved fields. A case reference alone is not authorization.

Connect results remain in the staff panel. **Copy suggestion** copies completed text for review in the normal workspace; no Connect composer insertion, after-contact save, customer send or call control is supplied. The **Summarize** task covers only the available attributes unless your authorized loader supplies an interaction excerpt.

| Boundary | Required behavior |
| --- | --- |
| Workspace ID | Automatic selection only; never permission to read the record. |
| Server snapshot | Check staff/tenant access before the preview and every answer. |
| Result | Discard late output after a switch; enable copy only after completion. |

Changing the case or task focus clears the previous result. Every task starts a fresh Voiceflow conversation; follow-up facts must come from the refreshed snapshot or current question. The host must unload/reset the panel on logout and account changes. Aborting browser consumption does not prove remote work stopped or transcripts were deleted; set expiry and retention with the owning teams.

<a id="testing"></a>

## Test the staff workflow

Prove automatic context, human review and recovery before expanding the pilot.

### 1. Verify the automatic context and all four tasks

Open an allowed sandbox interaction without typing an ID. Use an unopened-item case delivered 12 days ago with an approved 30-day policy. Confirm the visible ID and approved snapshot, then run each task with an empty question. Check facts, policy sources and explicit missing information. Summaries must not claim coverage beyond the loaded snapshot.

### 2. Test the platform lifecycle and draft action

Launch the app while idle: task controls must remain disabled. Open it for a contact, start a task and end that contact while the response is streaming. The answer and context must clear and late text must not reappear. Repeat with a second contact and confirm no first-contact facts carry over.

### 3. Prove denial and recover from failure

Use the second staff account for a record it cannot access: no context or answer may appear and no runtime request may start. Test an expired session, denied provider read, interrupted stream and unavailable assistant. Partial output must disappear and remain unavailable for copying or insertion. Restore the service and retry manually; normal support must remain usable.

### The panel or context does not load

Check installation, embedded sign-in and the approved provider reader.

Confirm the generated URL, app assignment, exact iframe ancestors and staff session. For 401, sign in again. For 403, check CSRF, tenant mapping and record access without weakening them. For 413, narrow the approved snapshot. For 502, inspect a redacted server correlation record for provider/runtime failures. Retry context by reopening/reloading the app after recovery; do not expose the panel publicly to bypass SSO.

### The suggestion is incomplete or uses the wrong case

Check the loaded snapshot and current workspace instance before using the result.

Compare the visible ID and approved fields with the actual interaction. Reopen the app to obtain a fresh binding. Check the server’s account/instance configuration and published Voiceflow Environment. Test the switch during a response again; a successful network abort alone does not prove late results are discarded. Review model output against sources before using it.

<a id="release-and-maintenance"></a>

## Release and maintain assistance

Record the accepted build, permissions and rollback before broadening access.

### 1. Release to the pilot group

Release first to the pilot group. Record the staff-host build, field allowlist, platform registration, tested staff identities and Voiceflow Environment/release. Repeat the allowed/denied interaction check through that released entry. Assign owners for policy freshness, identity/token lifecycle, app/SDK updates, retention and incidents; rerun [quality evaluation](/docs/guides/channels/agent-assist/evaluate-assistance) after changes.

### 2. Restore the reviewed deployment

Remove the security-profile grant or disassociate the integration before deleting it. Restore the recorded host build and reviewed Voiceflow release, then repeat a fresh-session check.

Local review can use `node support-platforms/fixture-server.mjs` and `http://127.0.0.1:4397/fixture-sign-in?platform=amazon-connect`. These clearly labelled fictional SDK/model fixtures exercise binding, task buttons and cleanup; they do not establish live installation, provider permissions, SSO or answer quality. Complete those checks in the actual sandbox before release.

For business-system tools, [Import help articles](/docs/guides/integrations/contact-centers) and Human agent hand-off, use the canonical Integration manuals.
