Skip to main content
Glama

Review iOS security

review_swift_security

Identify security defects in a Swift project before shipping: hardcoded secrets, insecure data storage, disabled ATS, weak hashes, and unsafe JavaScript evaluation.

Instructions

Check a Swift project for security defects: hardcoded API keys, tokens, and passwords in source; credentials written to UserDefaults instead of the Keychain; App Transport Security disabled; cleartext http:// endpoints; TLS server trust accepted without evaluation; MD5 and SHA-1; Keychain items with over-permissive accessibility; non-cryptographic randomness used for nonces and salts; secrets written to logs; and string interpolation into evaluated JavaScript. Use before shipping, during a security review, or when handling credentials.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the Swift project root (the folder containing Package.swift or the .xcodeproj).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
scoreYes0-100 defect density. 100 = no findings. penalty = 10*blockers + 3*serious + 1*minor; capacity = files*10. Comparable across runs on ONE project, not between projects.
countsYes
issuesYesEvery finding, most severe first.
summaryYesOne-line plain-language result.
suggestionsYesPrioritized next actions, deduplicated by rule — not a restatement of every issue's fix.
files_checkedYesSwift files actually scanned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.7.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly lists the security checks the tool performs, which makes its behavior transparent—an agent knows exactly what to expect the tool to scan for. It does not mention side effects or performance, but for a static analysis/review tool, this level of detail is more than adequate. The description adds significant value beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but each clause is information-dense and serves a purpose: it lists specific security checks that distinguish the tool and guide the agent. It starts with the primary action and then enumerates the checks. While it could be tightened, the structure is logical and each item adds value, especially for an agent deciding whether to invoke it. It's more than minimal but not bloated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the tool's purpose, usage context, and a comprehensive checklist of what it detects. Since an output schema exists (indicated in context), the description does not need to describe return values. The tool is a security review for Swift projects, and the description covers the main use cases and expectations. Nothing critical is missing for a correct invocation—only the exact output format is left to the schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully describes the single parameter 'path' with a clear definition ('Absolute path to the Swift project root...'). Schema description coverage is 100%, so the baseline is 3. The description does not add extra semantics about the parameter itself; it focuses on the tool's functionality. Hence, it neither improves nor degrades the parameter clarity—it stays at baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb+resource ('Check a Swift project for security defects') and then enumerates a specific checklist of defect types (hardcoded keys, ATS disabled, etc.). This precisely distinguishes it from sibling review tools like review_swift_concurrency or review_swift_architecture, which focus on other concerns. An agent can immediately infer what this tool does and what it does not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states usage contexts: 'Use before shipping, during a security review, or when handling credentials.' This gives clear when-to-use guidance. However, it does not explicitly mention when NOT to use it or alternative tools, so it misses the full 'when-not/alternatives' criteria for a 5. Still, the context is strong and unambiguous.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.