# Automated client reports

> How to send clients a regular security report with Vigil. An agent builds the report from recorded patrols and events, publishes it and you share a link.

Source: https://vigilsecure.net/docs/examples/client-reports/

**The scenario.** Every Monday your clients expect a report on the past week: were the
patrols done, what came through the gate, what went wrong. Today a manager spends Monday
morning assembling them from registers and spreadsheets.

## How Vigil represents it

| The real world                   | In Vigil                                                                                         |
| -------------------------------- | ------------------------------------------------------------------------------------------------ |
| The evidence                     | Messages already recorded in chats: beacon scans, patrol requests, vehicles, people, voice notes |
| The person who writes the report | An [agent](https://vigilsecure.net/docs/concepts/agents.md)                                                               |
| "Every Monday at 07:00"          | The agent's schedule                                                                             |
| The report                       | An [artifact](https://vigilsecure.net/docs/concepts/artifacts.md): a self-contained page                                  |
| Sending it to the client         | A **share link**, which opens that one report without a Vigil account                            |
| House style                      | The agent's instructions, or an organization [skill](https://vigilsecure.net/docs/concepts/skills.md)                     |

The report is built from what was recorded when it happened, so nobody has to remember or
retype anything.

## Set it up

1. Make sure the agent can see the evidence. An agent reads the chats it is in. If your
   patrols are requested by the same agent, it already has them. Include it when you create
   each gate chat whose traffic belongs in a report, because the console cannot yet add an
   agent to a chat that already exists.
2. Give the agent a role that can publish artifacts. The manager role can. For the
   coverage section it also needs **See device locations**, which the admin role has.
3. Write the report into its instructions:

   ```text
   Every Monday at 07:00, publish a weekly report for each site, covering Monday to
   Sunday of the week before.

   Each report has:
   - A heading with our company name, the site, the client and the dates.
   - Patrols: one row per patrol with the start time, the guard, beacons scanned out of
     the total and the duration. Then every missed beacon.
   - Coverage: for each night, when the first guard signed in and the last signed out.
   - Gate: vehicles and people in and out per day, and any expired licence discs.
   - Incidents: anything guards reported by text or voice note that needs the client's
     attention, in one or two sentences each.

   Write plainly. Do not include identity numbers. Times are South African time.
   When the reports are published, tell me in our chat.
   ```

4. Message the agent once to start it: "Set up your schedules from your instructions."
   Schedules are created by the agent itself, so nothing happens until you ask. Check the
   agent's **Schedules** tab to see them.

## What happens each week

1. **Monday 07:00.** The agent's schedule falls due. For each site it reads the week's
   patrol requests, scans, sign-ins and gate entries, and builds a page.
2. It publishes each page as an artifact titled, for example, `Rosebank Mall: 30 November
   to 6 December`, and tells you in your chat.
3. You open **Artifacts**, read the report, and choose **Share**. You label the link `Acme
   Property, weekly`, set it to expire in 30 days and send it to the client.
4. The client opens the link in a browser. They need no account and see only that report.

If you spot a mistake, ask the agent to correct and republish the report. The link the
client already has shows the corrected version.

## One-off reports

You do not need a schedule to get a report. Ask in a chat:

> Publish a report on the incident at the depot on Saturday night: the timeline from the
> gate chat and the guards' voice notes, and the patrols before and after.

Or build one at your own desk with
[your own AI assistant](https://vigilsecure.net/docs/setup/use-vigil-with-ai.md#connect-your-own-ai-assistant), which
can publish artifacts too.

## Keep client data safe

- A share link is public to whoever holds it. Send it only to the client, give it an
  expiry and revoke it when the contract ends.
- Leave personal details out of client reports unless the client needs them. Say so in the
  agent's instructions.
- Review a new report format yourself for the first few weeks before you rely on it.

## Related

- [Artifacts](https://vigilsecure.net/docs/concepts/artifacts.md)
- [Guard patrols](https://vigilsecure.net/docs/examples/guard-patrols.md)
- [Gate access control](https://vigilsecure.net/docs/examples/gate-access-control.md)
