audit-xcode-security-settings
Audit Xcode Security Settings
Assess an Xcode project's security posture and progressively enable security build settings and entitlements — from broadly applicable warnings through Enhanced Security hardening.
Tool Preferences
When XcodeGlob, XcodeGrep, XcodeRead, XcodeLS, and XcodeUpdate tools are available, ALWAYS use them. Do not fall back to Bash filesystem tools (ls, find, cat, grep) to learn about the project. They trigger extra permission prompts and bypass project scoping.
Tool names may carry an MCP server prefix. These tools are hosted by an MCP server whose name varies by environment (xcode-mcp, xcode-tools, xcode, etc.), so their fully qualified names look like mcp__<server>__XcodeGlob. Some harnesses register short aliases (just XcodeGlob); others only expose the prefixed form. Do not hardcode a specific server name. On the first call, use whichever form the available-tool registry advertises — look up the prefix once, then reuse it for the rest of the session. If a short-name call fails with an unknown-tool error, do not guess at the prefix: look it up in the registry and retry with the full name.
- XcodeGlob for file discovery —
findis forbidden for files inside the project. - XcodeGrep for content search —
grep/rgis forbidden for files inside the project. - XcodeRead for file contents —
cat/Readis forbidden for files registered in the project. - XcodeLS for directory listing —
lsis forbidden for any path inside the project. - XcodeUpdate for in-place edits of project-registered text files (xcconfig files, source files) — same
filePath/oldString/newString(+ optionalreplaceAll) signature as the built-inEdittool, but accepts Xcode workspace-relative paths.Editis forbidden for files registered in the project. Do not useXcodeUpdate/Edit/plutilto add or update.entitlementskeys — useAddEntitlement. - AddEntitlement for adding or updating a target's entitlements — pass
targetName,entitlementKey,entitlementValueType(bool/string/int/stringArray/dictionary), and the value. Always prefer it for entitlement changes; it adds or updates only and cannot remove keys. - XcodeListTargets for enumerating targets — do not parse
project.pbxprojmanually. Returns each target'sPRODUCT_TYPE_IDENTIFIERand role flags (IS_AGGREGATE,IS_TEST_TARGET,IS_APP_EXTENSION,SUPPORTS_HOSTING_TESTS) directly.
Project root and name are already in the system prompt context. Do NOT run ls to "verify" the project layout before starting. The system prompt already tells you the working directory and the project structure.