keychain-secure

Store and retrieve credentials in macOS Keychain with GF(3) lifecycle enforcement.

60|13|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/plurigrid/asi --skill keychain-secure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: keychain-secure
Source: https://github.com/plurigrid/asi/tree/main/skills/keychain-secure
Command: npx skills add https://github.com/plurigrid/asi --skill keychain-secure

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides secure credential storage on macOS with GF(3) balance, ensuring a credential's lifecycle (store, retrieve, validate) maintains invariants and avoids leaking secrets via environment variables.

Core Features & Use Cases

  • Secure storage: Encrypted credentials in macOS Keychain
  • GF(3) balance: Balanced lifecycle across store, transport, and validate
  • Cross-language examples: Python and Ruby APIs for managing credentials
  • Use Case: Store an API key securely, retrieve when needed, and rotate safely

Quick Start

Store a credential with security add-generic-password -s "service" -a "$USER" -w "secret" -U, then retrieve with security find-generic-password -s "service" -a "$USER" -w and validate it matches the stored value.

Frequently Asked Questions about keychain-secure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I store API keys and tokens securely on macOS without using environment variables?

Store credentials securely in macOS Keychain using the security command or programmatic APIs. Keychain encrypts secrets on disk and prevents accidental exposure via environment variables, keeping sensitive data isolated from shell history and process inspection.

What does GF(3) balanced credential management mean and why does it matter?

GF(3) balance enforces three lifecycle stages—store, retrieve, and validate—as mandatory steps for every credential operation. This ensures credentials are encrypted at rest, validated before use, and prevents shortcuts that leak secrets or bypass security checks.

Can I rotate credentials stored in macOS Keychain programmatically?

Yes. This Skill provides Python and Ruby APIs to retrieve credentials, validate them, and store updated versions safely. Rotation happens through Keychain without exposing secrets to shell or temporary files.

Does macOS Keychain work with ACL-based access control for multi-user or multi-application scenarios?

Yes. Keychain supports ACL-based access control so you can restrict which applications and users can retrieve specific credentials, enforcing fine-grained permissions across your credential store.

How do I retrieve and use a stored credential in an API call within my application?

Retrieve the credential from Keychain using the security command or language-specific APIs, validate it against stored metadata, then pass it directly to API calls. The Skill provides cross-language examples for Python and Ruby integration.

What happens if I try to use credentials stored in environment variables instead of Keychain?

Environment variables leak secrets through shell history, process listings, and log files. Keychain avoids this by encrypting credentials on disk and loading them only when applications request them with proper validation.