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

# Sight AI

> Forward outreach and collaboration emails to your Sight AI Outreach Agent. Send manually from a ticket or auto-detect with rules, and sync replies and status back over webhook.

## What Sight AI adds to Halo

Sight AI (trysight.ai) connects your inbox to the Sight AI Outreach Agent. It is webhook-driven (no cron sync, no knowledge ingest):

| Capability | What it does |
| - | - |
| **Manual send** | A Sight AI panel in the inbox right-rail lets an operator forward a ticket's message to the Outreach Agent. |
| **Automatic detection** | AI-evaluated rules in Settings > Inbox Views auto-forward matching inbound emails. |
| **Inbound webhooks** | `outreach.reply_sent`, `outreach.conversation_status_changed`, and `outreach.contact_suppressed` events update the ticket. |

Connect at **Integrations > Sight AI**.

## Setup

### 1. Create an OAuth app in Sight AI

In Sight AI, open **Integrations > Developers > OAuth apps** and create a client with this redirect URI:

```
https://<your-halo-domain>/api/integrations/sight_ai/callback
```

Copy the `client_id` (and `client_secret` if your app is a confidential client).

### 2. Set environment variables

```
SIGHT_AI_CLIENT_ID=...
SIGHT_AI_CLIENT_SECRET=...   # only if your OAuth app is confidential
```

`NEXT_PUBLIC_APP_URL` must point at the Halo deployment (used to build the redirect URI and the webhook subscription URL).

### 3. Connect

Click **Connect Sight AI**. Halo uses OAuth 2.1 Authorization Code + PKCE. Requested scopes (space-separated):

* `inbox:write` - push messages into the Outreach Agent inbox
* `webhooks:write` - create the webhook subscription
* `webhooks:read` - list/verify subscriptions

### 4. Pick a site

Sight AI tokens are team-scoped, but outreach actions are per-site. On the integration page, select the site whose Outreach Agent should receive forwarded messages. Saving the site creates the outreach webhook subscription at Sight AI and stores the signing secret (encrypted). The webhook subscription is recreated automatically if you switch sites.

## Webhook

The outreach webhook subscription is created programmatically when you select a site (no manual setup in Sight AI). The endpoint:

```
https://<your-halo-domain>/api/integrations/sight_ai/webhook
```

Verification uses HMAC-SHA256 over `${timestamp}.${raw_body}` with the per-subscription signing secret and a 300-second timestamp window. The header format is `t=<unix>,v1=<hex>`.

### Events

| Event | What Halo does |
| - | - |
| `outreach.reply_sent` | Records the triage outcome on the linked ticket and adds an internal note. |
| `outreach.conversation_status_changed` | Updates the Sight AI status marker on the ticket (`resolved`, `declined`, `awaiting_human`). |
| `outreach.contact_suppressed` | Flags the contact's recent tickets so Halo stops emailing them. |

Tickets are correlated by `tickets.metadata.sight_ai.conversationIds`.

## Automatic detection

In **Settings > Inbox Views**, enable **Sight AI outreach detection** and add plain-language rules (for example: "guest blog post pitches", "SEO link exchange requests", "collaboration offers"). When an inbound email matches any enabled rule, Halo forwards it to the Outreach Agent and skips its own AI auto-reply so the Sight AI agent owns the thread. Detection only runs when Sight AI is connected with a selected site.

## Environment variables

| Variable | Required | Purpose |
| - | - | - |
| `SIGHT_AI_CLIENT_ID` | yes | OAuth client id from Sight AI. |
| `SIGHT_AI_CLIENT_SECRET` | if confidential | OAuth client secret (omit for PKCE-only public clients). |
| `NEXT_PUBLIC_APP_URL` | yes | Halo deployment URL (redirect URI + webhook URL). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.