Security — Foundations Skill
Purpose
Route Keychain Services implementation tasks to the minimum required
Security Knowledge Contracts. v1 scope is general (non-biometric-bound)
Keychain item CRUD for kSecClassGenericPassword and
kSecClassInternetPassword items — accessibility levels, access-group
sharing, and storing structured/Codable data. No SecAccessControl
biometric binding, no AutoFill/credential-provider extensions, no iCloud
Keychain sync, no certificate/key/identity item classes.
Routing
Load only the contracts relevant to the task. All paths relative to knowledge/security/.
- Calling
SecItemAdd,SecItemCopyMatching,SecItemUpdate,SecItemDelete, constructing a query dictionary, or interpreting anOSStatus/errSec*result -> keychain-item-crud.md - Choosing a
kSecAttrAccessible*value (.WhenUnlocked,.AfterFirstUnlock,.WhenPasscodeSetThisDeviceOnly, aThisDeviceOnlyvariant, or the deprecated.Always/.AlwaysThisDeviceOnly) -> keychain-accessibility-levels.md - Setting
kSecAttrAccessGroup, enabling Keychain Sharing, or sharing an item between apps/extensions from the same team -> keychain-access-groups-and-sharing.md - Encoding/decoding a
Codablestruct into or out ofkSecValueData, or choosing betweenJSONEncoderandNSKeyedArchiver-> storing-structured-data-in-keychain.md
Never load more than the contracts relevant to the specific question.
Stop Conditions
Stop and report if the requested topic has no matching Knowledge
Contract in knowledge/security/ — do not guess or fall back to general
knowledge. Biometric-bound access control (SecAccessControlCreateWithFlags,
kSecAttrAccessControl, .biometryCurrentSet/.biometryAny,
kSecUseAuthenticationContext) is owned by the local-authentication
Skill's knowledge.local-authentication.keychain-biometric-binding
contract, not this one — route there instead. Password AutoFill /
credential provider extensions, iCloud Keychain sync
(kSecAttrSynchronizable), and non-password Keychain item classes
(certificates, cryptographic keys, identities) are deferred, not yet
built — report that explicitly rather than answering from general
knowledge (see docs/architecture/domain-map.md).
