# Live Defense Agent API

See how the live Defense Agent uses its install key to connect to AgentProof, fetch signed rules, and report traffic, events and routes.

The [live Defense Agent](/docs/live-defense-agent/) uses these routes to talk to AgentProof from your app. The package makes the calls for you. Owners and admins set up the connection in **Settings > Live protection**.

## Connect your app

1. Open **Settings > Live protection**.
2. Press **Add install key**.
3. Enter a **Name**.
4. Press **Add key**.
5. Press **Copy** to copy the key.
6. Set `AGENTPROOF_LIVE_KEY` in your app's environment.

An install key starts with `apl_` and works only on the `/api/live/` routes.

## Routes the package calls

| Method | Path | What the package does there |
|---|---|---|
| POST | `/api/live/hello` | Checks in with AgentProof. |
| GET | `/api/live/rules` | Fetches the current signed ruleset. |
| POST | `/api/live/events` | Sends events in batches. |
| POST | `/api/live/routes` | Sends route information for the website project's map. |
| POST | `/api/live/traffic` | Sends traffic summaries in batches. |

## Revoke an install key

In **Settings > Live protection**, find the key and press **Revoke**, then **Confirm revoke**. If your app still needs to connect, give it a new install key.

## Related pages

- [Live Defense Agent](/docs/live-defense-agent/) Install the package and see what it reports.
- [Route maps](/docs/route-maps/) Send your app's routes to AgentProof.
- [AgentProof API](/docs/api/) Read about account API tokens.
