class Gem::CredentialStore::MacOSBackend

Stores credentials in the macOS Keychain via the security command line tool. security has no way to read a password from stdin as raw bytes for add-generic-password, so #set uses +security -i+ (batch/interactive mode, one tokenized command per stdin line) to keep the secret off argv and out of ps output.

A newline would start a second command in the +security -i+ batch, and +security find-generic-password -w+ prints any non-printable byte back as a hex string rather than the original value, so a non-ASCII secret would round-trip corrupted. Those are the limits Gem::CredentialStore#set enforces for every backend, so the caller falls back to file storage rather than storing something that cannot be read back.