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.
npx agentmods add rules/duckduckgo/apple-browsers/ios-tracker-blocking-implementationgit clone --depth 1 https://github.com/duckduckgo/apple-browsersWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.06178 |
| Opus 5 | $0.00000 | $0.03089 |
| Sonnet 5 | $0.00000 | $0.01236 |
| Haiku 4.5 | $0.00000 | $0.00618 |
Grade A, and why
ios-tracker-blocking-implementation 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 919 lines — stays where its author put it; the contents beside it link to each section on GitHub.
iOS Tracker Blocking Implementation Guide
Overview
This document provides a comprehensive overview of how content blocking has been implemented on iOS to protect user privacy and block tracking attempts. Our implementation uses a dual-approach strategy that combines the efficiency of WebKit's native content blocking with the flexibility of JavaScript-based protection.
Implementation Strategy:
- Primary Layer: Content Blocker Rules (WebKit native, compiled to bytecode)
- Secondary Layer: JavaScript injection with Tracker Radar data (gap coverage + surrogates)
Content Blocker Rules
Architecture Overview
Content Blocker Rules form the primary layer of our tracker blocking implementation. These rules are converted from our Tracker Radar dataset into Apple's Content Blocker Rules format and compiled by WebKit into efficient bytecode for optimal performance.
Key Characteristics:
- ✅ High Performance: Rules are compiled to bytecode by WebKit
- ✅ Low Memory Footprint: Optimized for mobile devices
- ✅ Battery Efficient: Minimal CPU overhead
- ❌ Limited Flexibility: Cannot support complex logic or surrogates
- ❌ No Runtime Modification: Rules are static once compiled
Implementation Details
ContentBlockerRulesManager
The ContentBlockerRulesManager is responsible for converting Tracker Radar data into Apple's Content Blocker format and managing the rule compilation process.
import WebKit
import BrowserServicesKit
final class ContentBlockerRulesManager {
private let trackerDataManager: TrackerDataManager
private let compilationQueue = DispatchQueue(label: "content-blocker-compilation", qos: .utility)
init(trackerDataManager: TrackerDataManager) {
self.trackerDataManager = trackerDataManager
}
/// Converts Tracker Radar data to Content Blocker Rules format
func generateContentBlockerRules() async throws -> [WKContentRuleList] {
return try await withCheckedThrowingContinuation { continuation in
compilationQueue.async {
do {
let trackerData = self.trackerDataManager.embeddedTrackerData
let rules = self.convertToContentBlockerFormat(trackerData)
let ruleList = try self.compileRules(rules)
continuation.resume(returning: [ruleList])
} catch {
continuation.resume(throwing: error)
}
}
}
}
/// Converts TrackerData to Apple's Content Blocker Rules JSON format
private func convertToContentBlockerFormat(_ trackerData: TrackerData) -> [[String: Any]] {
var rules: [[String: Any]] = []
for (domain, tracker) in trackerData.trackers {
for rule in tracker.rules ?? [] {
let contentBlockerRule: [String: Any] = [
"trigger": [
"url-filter": rule.rule,
"resource-type": rule.resourceTypes,
"if-domain": rule.whitelist?.compactMap { "*\($0)" }
].compactMapValues { $0 },
"action": [
"type": "block"
]
]
rules.append(contentBlockerRule)
}
}
return rules
}
/// Compiles rules using WebKit's WKContentRuleListStore
private func compileRules(_ rules: [[String: Any]]) throws -> WKContentRuleList {
let jsonData = try JSONSerialization.data(withJSONObject: rules)
let jsonString = String(data: jsonData, encoding: .utf8)!
return try await withCheckedThrowingContinuation { continuation in
WKContentRuleListStore.default().compileContentRuleList(
forIdentifier: "DuckDuckGoContentBlocker",
encodedContentRuleList: jsonString
) { ruleList, error in
if let error = error {
continuation.resume(throwing: error)
} else if let ruleList = ruleList {
continuation.resume(returning: ruleList)
} else {
continuation.resume(throwing: ContentBlockerError.compilationFailed)
}
}
}
}
}
enum ContentBlockerError: Error {
case compilationFailed
case invalidRuleFormat
case trackerDataUnavailable
}
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.
- today First seen · 919 lines · 0 tokens per session scan A 947527470530
ios-tracker-blocking-implementation is a cursor rule published in the GitHub repository duckduckgo/apple-browsers (252 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 6,178 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.
Other cursor rules, from other repositories
utilities
Lodash 和 Moment.js 工具庫使用規範.
create-ios-release
As an AI assistant helping with iOS app releases, I should guide through the following process for successfully deploying iOS applications to the App Store.
knowledge-management-rule
Comprehensive knowledge management system for capturing, organizing, and applying project knowledge.
203-healthkit-integration-detailed
HealthKit & WorkoutKit 集成规范 - 详细参考.
010-healthkit-workoutkit
010: HealthKit and WorkoutKit integration patterns for iOS health apps.
main-refactoring-rules
ios cursor rules.