browserserviceskit-integration

browserserviceskit-integration is a cursor rule for Cursor from duckduckgo/apple-browsers. It costs 0 tokens per session (2,328 once invoked), scanned A, original, Apache-2.0.

Integration rules for BrowserServicesKit, a shared library used by DuckDuckGo's iOS and macOS browser apps. It covers privacy protection and data management that should be handled through the library.

In plain words
What is it for?
Use it when adding content blocking, privacy configuration, or persistent data handling to either browser app.
Why use it?
It keeps common browser behavior consistent across platforms and directs privacy-related work through the project's shared components.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/duckduckgo/apple-browsers/browserserviceskit-integration
Clone the repo
git clone --depth 1 https://github.com/duckduckgo/apple-browsers

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for browserserviceskit-integration

README.md
[![agentmods](https://agentmods.dev/badge/rules/duckduckgo/apple-browsers/browserserviceskit-integration.svg)](https://agentmods.dev/rules/duckduckgo/apple-browsers/browserserviceskit-integration)
Your own site
<a href="https://agentmods.dev/rules/duckduckgo/apple-browsers/browserserviceskit-integration"><img src="https://agentmods.dev/badge/rules/duckduckgo/apple-browsers/browserserviceskit-integration.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,328 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.02328
Opus 5 $0.00000 $0.01164
Sonnet 5 $0.00000 $0.00466
Haiku 4.5 $0.00000 $0.00233

Measured 5d ago against content hash 95d0b9527dd1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

browserserviceskit-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/browserserviceskit-integration.mdc · 444 lines

How it starts

The opening of the file, as written. The whole thing — 444 lines — stays where its author put it; the contents beside it link to each section on GitHub.

BrowserServicesKit Integration Guide

Overview

BrowserServicesKit is the core shared library providing essential browser functionality to both iOS and macOS DuckDuckGo applications. It ensures consistent behavior and code reuse across platforms while maintaining privacy as the primary focus.

Core Modules and Usage

Privacy & Protection

Always use BrowserServicesKit for privacy-related functionality:

// ✅ CORRECT - Content blocking integration
import BrowserServicesKit
import ContentBlocking

final class PrivacyManager {
    private let contentBlockingManager = ContentBlockingManager.shared
    
    func enableContentBlocking(for webView: WKWebView) {
        contentBlockingManager.enable(for: webView)
    }
    
    func updateBlockingRules() async {
        await contentBlockingManager.updateRules()
    }
}

// ✅ CORRECT - Privacy configuration
import PrivacyConfig

final class PrivacyFeatureManager {
    private let privacyConfig = PrivacyConfiguration.shared
    
    func isFeatureEnabled(_ feature: PrivacyFeature) -> Bool {
        return privacyConfig.isEnabled(feature)
    }
}

Data Management

Use BrowserServicesKit for all data persistence:

// ✅ CORRECT - Bookmarks management
import Bookmarks

final class BookmarkService {
    private let bookmarkManager = BookmarkManager.shared
    
    func saveBookmark(_ bookmark: Bookmark) async {
        await bookmarkManager.save(bookmark)
    }
    
    func fetchBookmarks() async -> [Bookmark] {
        return await bookmarkManager.fetchAll()
    }
}

// ✅ CORRECT - Secure credential storage
import SecureVault

final class CredentialManager {
    private let secureVault = SecureVault.shared
    
    func storeCredential(_ credential: WebsiteCredential) async throws {
        try await secureVault.store(credential)
    }
    
    func retrieveCredentials(for domain: String) async throws -> [WebsiteCredential] {
        return try await secureVault.credentials(for: domain)
    }
}

Read the full file on GitHub · 444 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 444 lines · 0 tokens per session scan A 95d0b9527dd1

Subscribe to this mod's changes

browserserviceskit-integration is a cursor rule published in the GitHub repository duckduckgo/apple-browsers (251 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,328 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.