AI integration

Most ConsentLoop installs will be done by an AI pair — Claude, Cursor, Copilot, or an autonomous agent. The product is designed for that: one obvious API, machine-readable contracts, and nothing that requires reading source code to get right.

Point your assistant at the contracts

ArtifactURL / pathUse
llms.txt/llms.txtIndex + integration rules (llmstxt.org format)
llms-full.txt/llms-full.txtThe entire documentation as one plain-text file — paste into any context window
JSON Schema/consentloop.schema.jsonValidate configs; editor autocomplete via $schema
TypeScript typesconsentloop/dist/index.d.tsFully JSDoc’d — agents can read intent, not just shape

One-shot prompt

Paste this into your assistant inside your project:

Add cookie consent to this project using ConsentLoop (npm: consentloop, docs: https://consentloop.dev/llms-full.txt).
Requirements:
1. Categories: necessary (required), analytics, marketing.
2. Gate every existing analytics/marketing script with type="text/plain" + data-consent + data-consent-src.
3. Enable googleConsentMode if Google tags are present, and load ConsentLoop before them.
4. Add a "Cookie settings" footer link calling ConsentLoop.showPreferences().
5. GDPR defaults: keep showRejectAll on; do not preselect optional categories.
If this is a React app, use @consentloop/react's ConsentProvider and ConsentGate instead of data-attributes for embeds.

Why agents get it right first try

Driving the widget in E2E / browser agents

// Playwright — the widget lives in an open shadow root under #consentloop
const root = page.locator("#consentloop");
await root.locator('[data-a="accept-all"]').click();

// or skip the UI entirely:
await page.evaluate(() => window.ConsentLoop.acceptAll());

// assert state
const accepted = await page.evaluate(() => window.ConsentLoop.acceptedCategories());

Config validation in CI

// validate-consent.mjs — run in CI with your schema validator of choice
import { readFileSync } from "node:fs";
import Ajv from "ajv";

const schema = JSON.parse(readFileSync("node_modules/consentloop/schema.json", "utf8")); // or fetch /consentloop.schema.json
const valid = new Ajv({ allowUnionTypes: true }).compile(schema)(myConfig);

MCP & automation

Because state is a readable first-party cookie and every transition emits a DOM event (consentloop:consent, consentloop:change…), monitoring agents can observe consent without any SDK. The adapter contract is two plain HTTP calls — trivial for an agent to implement against your backend.