# iOS Sensitive Data in NSLog / os_log

> Detects sensitive data passed to NSLog, print, or os_log that ends up in device logs accessible via Xcode/Console.

- Skill: `zakirkun/ios-sensitive-data-in-nslog-os-log` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/ios-sensitive-data-in-nslog-os-log`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/ios-sensitive-data-in-nslog-os-log/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/ios-sensitive-data-in-nslog-os-log

---


# iOS Sensitive Data in Logs

## Overview
iOS device logs (accessible via Xcode Console, `idevicesyslog`, and Crash Reports) can be read by:
- Developers with physical device access
- Malicious apps with log access entitlements
- Anyone who can read the device logs via iTunes backup

Logging passwords, tokens, PII, or financial data is a compliance violation.

## Remediation
- Remove all NSLog/print calls in production builds using macros
- Use `os_log` with `%{private}` format specifier for sensitive data
- Build with `DEBUG` flag guard: `#if DEBUG ... NSLog(...) ... #endif`

