# Install with a coding agent

> Paste one prompt into Claude Code, Cursor or GitHub Copilot. It fetches the Script Monitoring setup guide and installs the tag with your script URL.

Source: https://docs.scriptmonitoring.com/install/coding-agent/ · Plan: All plans · Updated 2026-10-13

You can let a coding agent install Script Monitoring: copy the prompt from **Developers > Setup**, step 3, **Coding agent**, and paste it into Claude Code, Cursor, GitHub Copilot or a similar tool. The prompt tells the coding agent to fetch our setup guide, detect your framework and add the tag with your team's script URL.

![Setup step 3, Install: choosing AI shows a ready-made prompt for your coding assistant, and Copy prompt copies it.](https://docs.scriptmonitoring.com/videos/install-ai-flow-light.webp)

> Install with AI: paste this prompt into your coding assistant: "Fetch the Script Monitoring installation guide from https://docs.scriptmonitoring.com/ai-setup.md and follow the instructions to add Script Monitoring client-side security monitoring to this project."

## What is the prompt?

The **Coding agent** panel says: "Paste into your coding agent." **Copy prompt** copies one line, with your script URL filled in:

```text
Fetch the Script Monitoring installation guide from https://docs.scriptmonitoring.com/ai-setup.md and follow the instructions to add Script Monitoring client-side security monitoring to this project. Use this script URL: https://<teamID>.cdn.scriptmt.com/sm.js
```

## How do I use it?

1. In the dashboard, open **Developers > Setup**, go to step 3, **Install**, and pick **Coding agent**.
2. Click **Copy prompt**.
3. Open your project in your coding agent and paste the prompt.
4. Review the change before you merge it:
   - the tag (or `ScriptMonitoringScript`, or the `scriptMonitoring()` plugin) is the first script in the `<head>`, with no `async` or `defer`;
   - nothing else in the `<head>` was removed or reordered;
   - if the project has a Content Security Policy, `*.cdn.scriptmt.com` was added to the existing `script-src` and `connect-src`, and nothing was removed.
5. Deploy, load a page and check [Verify it's working](https://docs.scriptmonitoring.com/verify/).

## What does the setup guide tell the coding agent?

[ai-setup.md](https://docs.scriptmonitoring.com/ai-setup.md) is plain Markdown written for coding agents. First it makes the coding agent use your real script URL: it takes it from the prompt, asks you for it (or your team ID from **Developers > Setup**) if it is missing, never guesses one, and checks that the URL returns the script before it changes any file. Then it asks the coding agent to pick the method that fits the project ([Next.js](https://docs.scriptmonitoring.com/install/nextjs/), [Vite](https://docs.scriptmonitoring.com/install/vite/), the [CLI](https://docs.scriptmonitoring.com/install/cli/) for static builds, or [HTML](https://docs.scriptmonitoring.com/install/html/)), keep the tag first and synchronous, add it only once, and extend an existing Content Security Policy instead of replacing it.

## Frequently asked questions

### What does the coding agent read?

The prompt points it at [ai-setup.md](https://docs.scriptmonitoring.com/ai-setup.md), a Markdown guide written for coding agents. It covers Next.js, Vite, static builds with the CLI, plain HTML and Content Security Policy changes.

### Does the prompt contain anything secret?

No. It contains your team's script URL, which is public: every visitor's browser loads it.

### Which coding agents does it work with?

Any coding agent that can fetch a URL and edit your project, such as Claude Code, Cursor or GitHub Copilot. If yours can't fetch URLs, paste the contents of [ai-setup.md](https://docs.scriptmonitoring.com/ai-setup.md) along with your script URL.

## Related

- [Install the script tag](https://docs.scriptmonitoring.com/install/)
- [Verify it's working](https://docs.scriptmonitoring.com/verify/)
