# Connect your own bot as an external AI agent

Let a chatbot you already built answer your Prospect inbox, save customer details and hand over to your team.

Source: https://support.rework.com/article/prospect-external-ai-agents

Already have a chatbot of your own? An external AI agent lets it answer your Prospect inbox. Each time a customer writes, Prospect sends the conversation to your bot's web address, and your bot replies with a message and, if it wants, a few actions such as saving the customer's details or handing over to your team.

Your team keeps working in one inbox: the bot's replies appear like any AI agent's, and everything it does is written into the thread.

## Before you start

- External agents live under **Settings** › **AI Agents** and are admin-only.
  
- You need a developer (or an AI coding assistant) to run your bot behind an **https** address that can answer Prospect's requests. The editor gives them everything they need, including ready-to-copy code.
  

## Create an external agent

1. Go to **Settings** › **AI Agents** and click the arrow next to **New Agent** **(1)**. The main button still creates a regular AI agent.
   
2. Choose **New external agent** **(2)**.
   

![AI Agents page: (1) the arrow next to New Agent, (2) New external agent in its menu, (3) an external agent in the list with its External tag and Connected status](https://storage.googleapis.com/reworkv3-public/success/261015/dzXfj4kxkmhpxLHOmsT5md3rnK5hLFjesSUqEn0aERH1Bi4i0XUPxyjQ5seFEimO/img.yN8YyMeSlSZEoEeCFW6OhLqchAqfTX2r4vhRCZ9ZyTCHAGgHuuK89QBJVXre2Y5X.png)

Once saved, your agent shows in the list with an **External** tag and its connection status **(3)**: **Connected**, **Not responding** or **Not checked**.

The editor is a single page. **Setup steps** **(1)** on the left tracks what's done and takes you to each step.

1. Under **Identity**, pick an avatar and give the agent a **Name** **(2)**. This is the name your team sees next to the bot's replies.
   
2. Optionally pick **Default for services** **(3)**. Picking a service turns its AI auto-reply on and makes this agent the one that answers there.
   

![External agent editor: (1) Setup steps, (2) Name, (3) Default for services, (4) the Let AI build it card](https://storage.googleapis.com/reworkv3-public/success/261015/CUBKVlnRIsOXkVbVvbWHvQ34fMM3hifqefS1OPRaSbNEK3YZA8zCuUINykzgBtzC/img.UMwoo3tbedfIzZAQ3APrcae1qPXUABoCrPJMOJJtiNesBB4ZFy9ttcJvjwyTgdU2.png)

The **Let AI build it** card **(4)** is covered in _Build the bot's side_ below.

## Connect your bot

1. In **Endpoint**, paste your bot's **Endpoint URL** **(1)**. It must start with https.
   
2. Set the **Timeout** **(2)**: how many seconds Prospect waits for your bot to answer, from 1 to 30.
   
3. Click **Save** at the top right. Prospect checks the new address straight away, and you can check it again any time with **Check connection** **(3)**. The result shows next to the button with the response time.
   

![Endpoint step: (1) Endpoint URL, (2) Timeout, (3) Check connection with the Connected status](https://storage.googleapis.com/reworkv3-public/success/261015/BW1QqzcR1yN10xdK6gNMPGkYkDfxPRiKigvFXNf1loJJCHCLp8LDyD3LpKZqM5MG/img.i8IIHUIoastvE1ujCq6JXDn98D5b6XjepzQmePKtVSZ5Nhxwk1Z8iDEAgqb4Ere3.png)

The check sends your bot a test request with a code it must send back. If the status says **Not responding**, the reason shows right next to it.

## Keep the signing secret

Every request Prospect sends is signed, so your bot can tell it really comes from Prospect.

1. After the first save, the **Signing secret** step shows the secret **(1)**. Click **Copy** and give it to whoever runs your bot.
   
2. The secret is shown only once. If it's lost, click **Rotate signing secret** **(2)** to get a new one. The old secret stops working at once, so update your bot right after.
   

![Signing secret step: (1) the secret, shown once, with its Copy button and warning, (2) Rotate signing secret](https://storage.googleapis.com/reworkv3-public/success/261015/ktNqbBqgEErk4NzzRmzFKbjspzTDohnl0BbnJb4HOF9Efvdad00OWOe1p6lbeyX5/img.qwifJ6aeqEVGgEcYCGIK5Qkige1ieGfTQwo0FaaBOKkqKRCSlh9ZKOTBMq1e9qzV.png)

## Choose what the bot may do

Your bot answers each message with a reply and, optionally, a list of actions. Only the actions you switch on in **What the bot may do** run; anything else is skipped and noted in the conversation.

![What the bot may do: (1) the Handoff switch, (2) People, (3) Flows, (4) AI agents, (5) SLA router, (6) Update Profile with the fields the bot may update](https://storage.googleapis.com/reworkv3-public/success/261015/uwQYeCI5YXibiZiU0D7RF7ePMpsw2NLPf0IfkfJ3ximE1QxIaBESTbApz2gUDntw/img.LAWJosjCcFokSd2sgAwFe7LAZFzWBToJ9sXUTTXj4VgCz4ChiWKZPQxskqMV7gUF.png)

| 
Action

 | 

What it lets your bot do

 |
| --- | --- |
| 

**Handoff** **(1)**

 | 

Hand the conversation to a teammate, a flow, another AI agent or the SLA router.

 |
| 

**Update Profile** **(6)**

 | 

Save details the customer shares, such as name, phone or email. Use **Fields the AI may update** to limit which fields; leave it empty to allow all.

 |
| 

**Update Stage**

 | 

Move the customer to another lifecycle stage, within the stages you pick.

 |
| 

**Send Canned Response**

 | 

Send a canned response that's allowed for AI in the inbox's service, with its files.

 |
| 

**Start Flow**

 | 

Start one of the flows you allow, for example to send a form.

 |

When **Handoff** is on, decide who the bot may hand to:

- **People** **(2)**: **Any member of the inbox**, or **Only these people** that you pick.
  
- **Flows** **(3)**: the flows it may start. Only flows published with an AI agent trigger can be picked. The same list is used by **Start Flow**.
  
- **AI agents** **(4)**: other AI agents it may pass the conversation to.
  
- **SLA router** **(5)**: turn on **Hand to the SLA router** to let the bot pass conversations to your inbox's routing rules. With it on, a message your bot fails to answer goes there too, so no customer is left waiting.
  

**Send as multiple messages**, further down, lets your bot's reply go out as several short messages, up to **Max messages**.

## Build the bot's side

The **Developer guide** step holds everything your developer needs:

- Working sample code in **Node.js** or **Python** **(1)** that checks the signature, answers the connection check and replies to customers. Each block has a **Copy** button **(2)**.
  
- An example of what Prospect sends, what your bot answers, and the details each action needs.
  

![Developer guide step: (1) the Node.js and Python switch, (2) the Copy button on the sample code, (3) Copy guide in the Let AI build it card](https://storage.googleapis.com/reworkv3-public/success/261015/HxeET4Uc64Wx7sw9lvvwvx8xRt6wGkkRf7jIrF6Jtx8xVAofBwo5aZVxLYkeqO31/img.auLJCp573dVbewNlXs0ajQ5OyvNx8Gy8xXFNzahcrnC0O31jjV9TgItcpGmNEasJ.png)

Using ChatGPT, Claude or Cursor? Click **Copy guide** **(3)** and paste it into your AI assistant. It describes this agent's address and actions so the assistant can write the bot's side for you. The signing secret is never included.

A few things your bot should know:

- Each request includes the recent conversation, the customer's fields, and the people, flows, stages and canned responses it may use. Your bot should only use what's listed there.
  
- Files the customer sent come as short-lived links: read them while answering, don't store them.
  
- Replying with no message and no actions means the bot stays silent on that message.
  

## Test the agent

The **Test** panel on the right sends messages to your bot for real, marked as a test, so you see exactly what customers would get. Actions are checked but never carried out.

1. Type as the customer and press Enter **(1)**.
   
2. Each action your bot asked for shows as a card, such as **Updated profile** **(2)** or **Handed off to a human agent** **(3)**. An action that would be refused shows why.
   
3. Your bot's reply appears below **(4)**. Click the status line **(5)** to see the response time and, for your developer, the exact request sent and response received.
   

![Test panel: (1) the customer's message, (2) Updated profile card, (3) Handed off to a human agent card, (4) the bot's reply, (5) the status line with response time](https://storage.googleapis.com/reworkv3-public/success/261015/j5f6167bBiPo9xmxhjvTOsFOVbMQuXpiMBHkQRaU7qt69TlksncDKmyQHOtjSFIA/img.d9psb3mz46XvzBr3LePV0vDdG71sjHShRru0xK0NDxXysXGe9w6BJNlzTmhhUOy5.png)

The test uses the action settings you're editing and the endpoint as last saved, so save a new address before testing it.

## Put it to work

Use **Default for services** in the editor to make the agent answer a whole inbox, or pick it for a single conversation from the assignment panel, the same way as any AI agent. See [AI agents](https://support.rework.com/article/prospect-ai-agents) for the inbox settings, such as pausing the AI when a person replies.

In the conversation, your team sees what the bot did, right in the thread:

![Conversation in the inbox: (1) the bot updated the customer's name and email, (2) the bot handed off to a teammate, (3) the bot's reply, (4) the assigned teammate and the external agent in the assignment panel](https://storage.googleapis.com/reworkv3-public/success/261015/fU2bn8BWGIW0WovLmIrlIbPsWB2E2irydO9PBUgonfQKc6hdGshlpnfj1g2QryqU/img.LK24rtwJnyX0WV1OfxTkE4vKpPFtMhvuNXX1bodfhzzYdMcqm5H4Len788Ovczi6.png)

- Saved details and stage changes show as entries **(1)**, and hand-overs say who received the conversation **(2)**.
  
- The bot's reply goes to the customer like any AI reply **(3)**, and the panel shows who's assigned and which agent answers **(4)**.
  
- If the bot asks to hand over a conversation that someone already owns, nothing changes hands, and an entry says who already has it.
  
- If your bot can't be reached, times out or sends an answer Prospect can't read, the reason is noted in the conversation.
  

## Good to know

- An agent stays the type it was created as: an external agent can't become a regular AI agent, or the other way round.
  
- Prospect waits at most the **Timeout** you set, up to 30 seconds. A bot answer can carry up to 5 messages and 10 actions.
  
- External agents can't be used in a flow's AI agent block, and don't offer AI reply suggestions to your team, since those run on a model in Prospect.
  
- Your bot runs on your side, so its replies don't use your AI usage credits.
