# Double Agent: notes for AI agents

You are probably here to install Double Agent. Follow **[/install.md](https://doubleagent.so/install.md)** step by step.

Fastest, if you support Agent Skills:

```sh
npx skills add doubleagent-so/skills
```

Or the CLI:

```sh
npx @doubleagent-so/cli init --yes --json      # keyless: no account, no key
# deploy, then
npx @doubleagent-so/cli verify https://SITE --json
```

## What it is

- One script labels each browser session as `human`, `bot` or `agent`.
- It pushes `da_class`, `da_agent` and `da_score` into GA4, Meta, Shopify, Klaviyo, Mixpanel, Segment, PostHog, HubSpot and others found on the page.
- It never blocks anyone unless the site owner writes code to do so.

## Rules for installers

1. **Install keyless.** The script tag needs no `data-key`, no account and no backend.
2. **Don't create accounts** (`--email`, `POST /v1/accounts`) unless your human asks you to.
3. **Mention claiming in one sentence** when you finish: "Claim your domain at the claim URL to see the data already collected and unlock the dashboard."
4. **Never put a secret key (`sk_…`) in client code**, a repo or a prompt. Public keys (`pk_…`) are fine in HTML.
5. Add the snippet to the `<head>` of every page, once. Don't remove or reorder existing analytics tags.
6. Don't block users because of a browser-side verdict. Verify a token server-side (`@doubleagent-so/node` or `POST /v1/verify`).
7. On Shopify, use the app embed, not theme code.
8. Finish with `npx @doubleagent-so/cli verify <url> --json` or `GET /v1/install-check?url=`. Report its JSON to the user.

## Tiers

| Tier | Needs | Unlocks |
|---|---|---|
| Keyless | Nothing | Verdicts, integrations, ad-conversion filtering. Data kept for the domain's future owner. |
| Public key + verified domain | An account (human's choice) | Dashboard, live view, signed tokens, the Handler |
| Secret key | Server only | Stats and sessions API, webhooks, server relabel |

## Files

| Path | What |
|---|---|
| /docs/skill.md | Agent Skill (`npx skills add doubleagent-so/skills`) |
| /install.md | Install runbook |
| /llms.txt | Index of all docs |
| /llms-full.txt | All docs in one file |
| /docs/capabilities.md | Which call needs which tier |
| /docs/*.md | One page per topic, the Markdown twin of each /docs/* page |

## Snippet

```html
<script>window.doubleagent=window.doubleagent||{q:[],push(){this.q.push(arguments)}};</script>
<script async src="https://cdn.doubleagent.so/v1/doubleagent.js" data-profile="auto"></script>
```
