Universal opt out

From mukul975/Privacy-Data-Protection-Skills · View interactive version

Universal opt out is an AI agent skill from the GitHub repository mukul975/Privacy-Data-Protection-Skills. Universal opt-out mechanism implementation across US state privacy laws. Covers Global Privacy Control (GPC) signal technical implementation, state-by-state recognition requirements, browser detection methods, authenticated vs unauthenticated handling, and compliance testing.

How to use this skill

Skill file

Universal Opt-Out Mechanism Implementation

Overview

A universal opt-out mechanism is a browser or device-level signal that communicates a consumer's privacy preferences to websites and online services. The Global Privacy Control (GPC) is the leading universal opt-out mechanism, supported by major browsers (Firefox, Brave, DuckDuckGo) and browser extensions (Privacy Badger, Disconnect). Multiple US state privacy laws now require businesses to recognize and honor these signals.

GPC is defined in the Global Privacy Control specification (published by the GPC project), transmitted via the Sec-GPC: 1 HTTP header and the navigator.globalPrivacyControl JavaScript API.

State-by-State Requirements

| State | Law | Signal Required | Effective Date | Scope |

|-------|-----|-----------------|---------------|-------|

| California | CCPA/CPRA | Yes | Jan 1, 2023 | Sale + Sharing |

| Colorado | CPA | Yes | Jul 1, 2024 | Targeted ads + Sale |

| Connecticut | CTDPA | Yes | Jan 1, 2025 | Targeted ads + Sale |

| Montana | MTDPA | Yes | Oct 1, 2025 | Targeted ads + Sale |

| Texas | TDPSA | Not required | N/A | N/A |

| Virginia | VCDPA | Not required | N/A | N/A |

| Oregon | OCPA | Not required | N/A | N/A |

| Kentucky | KPPA | Not required | N/A | N/A |

GPC Technical Specification

HTTP Header

Sec-GPC: 1

The Sec-GPC header is a structured header with a bare item value of 1 (true) or absent (no preference expressed). The Sec- prefix indicates it is a fetch metadata header set by the browser, not by JavaScript.

JavaScript API

navigator.globalPrivacyControl  // boolean: true or undefined

The navigator.globalPrivacyControl property returns true if the user has enabled GPC in their browser or extension, or undefined if GPC is not active.

Detection Code

function detectGPC() {
    // Check JavaScript API
    const jsGPC = navigator.globalPrivacyControl === true;

    // The HTTP header is checked server-side
    // This function covers client-side detection only

    return {
        gpcEnabled: jsGPC,
        timestamp: new Date().toISOString(),
        userAgent: navigator.userAgent,
    };
}

Server-Side Detection (Node.js/Express example)

function checkGPCHeader(req) {
    const gpcHeader = req.headers['sec-gpc'];
    return gpcHeader === '1';
}

app.use((req, res, next) => {
    if (checkGPCHeader(req)) {
        req.gpcOptOut = true;
        // Apply opt-out before rendering page
        res.locals.suppressThirdPartyTags = true;
        res.locals.suppressCrossSiteBehavioralAds = true;
    }
    next();
});

Implementation Architecture

Layer 1: Signal Detection

HTTP Request Arrives
  │
  ├─► Server-Side Check
  │     └─ Parse Sec-GPC header from request
  │
  ├─► Client-Side Check (for SPAs)
  │     └─ Read navigator.globalPrivacyControl
  │
  └─► Combined Result
        ├─ GPC detected = true → Apply opt-out
        └─ GPC not detected → Normal processing

Layer 2: Scope Determination

| State | Sale Opt-Out | Sharing Opt-Out | Targeted Ads Opt-Out | Profiling Opt-Out |

|-------|-------------|-----------------|---------------------|-------------------|

| California | Yes | Yes | Implied (sharing = cross-context behavioral ads) | No (separate) |

| Colorado | Yes | N/A | Yes | No (separate) |

| Connecticut | Yes | N/A | Yes | No (separate) |

| Montana | Yes | N/A | Yes | No (separate) |

Layer 3: Consumer Identity Resolution

Authenticated Consumer (logged in):

Unauthenticated Consumer (not logged in):

Layer 4: Enforcement

Upon detecting GPC signal, the system must:

  1. Suppress third-party advertising tags before page render:
  1. Allow first-party processing:
  1. Update server-side systems:

Compliance Rules by State

California (CPPA Regulations §7025)

Colorado (4 CCR 904-3, Rule 5.11)

Connecticut (§42-520(a)(6))

Montana (§30-14-2808(3))

Testing Protocol

Test 1: GPC Signal Detection

Test 2: Tag Suppression

Test 3: Authenticated vs. Unauthenticated

Test 4: No Pop-Up or Interstitial

Test 5: Conflict Resolution

Liberty Commerce Inc. Implementation

Technology stack: Consent management platform (CMP) with GPC signal handler, tag management system (TMS) with server-side control, privacy operations dashboard.

Architecture:

  1. Edge proxy detects Sec-GPC: 1 header on incoming requests
  2. Request metadata includes gpc_opt_out: true flag
  3. TMS evaluates flag before injecting any tags
  4. CMP state updated for session/account
  5. Server-side data sharing pipeline checks flag before transmitting to third parties
  6. Compliance dashboard reports GPC detection rates and opt-out volume

Key Regulatory References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.