api-key-handling

Enforce safe API key retrieval in Wolfram Language using NBAccess`NBGetAPIKey.

3|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/transreal/claudecode --skill api-key-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-key-handling
Source: https://github.com/transreal/claudecode/tree/main/Claude%20Directives/skills/api-key-handling
Command: npx skills add https://github.com/transreal/claudecode --skill api-key-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents accidental exposure or unsafe handling of API keys and other credentials when writing Wolfram Language code that calls Anthropic or OpenAI services.

Core Features & Use Cases

  • Correct API key retrieval: Fetches keys through NBAccess rather than reading credentials directly from storage.
  • Provider-appropriate patterns: Uses the right provider identifiers and optional PrivacySpec when obtaining keys for different call paths.
  • Implementation safety guardrails: Avoids hardcoding keys, prevents leaking key fragments in error messages, and ensures notebook outputs do not print secret values.

Quick Start

When implementing credential-related changes, ask the AI to rewrite your Wolfram Language code to retrieve keys using NBAccess`NBGetAPIKey with the appropriate provider name and PrivacySpec, following the API key security rules.

Frequently Asked Questions about api-key-handling

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

FAQPage Schema
How do I safely manage API keys in Wolfram Language code?

Safely manage API keys in Wolfram Language by retrieving them through NBAccess`NBGetAPIKey with an appropriate provider name and PrivacySpec, avoiding hardcoded credential strings or direct storage access to prevent accidental leakage.

What is the best way to prevent credential leakage when calling Anthropic or OpenAI from Wolfram notebooks?

Prevent credential leakage when calling Anthropic or OpenAI from Wolfram notebooks by enforcing a safe retrieval pattern using NBAccess`NBGetAPIKey, which restricts direct credential store access and prevents secret values from printing in notebook outputs or error messages.

Does NBAccess work with PrivacySpec for OpenAI and Anthropic API key retrieval?

Yes, NBAccess works with PrivacySpec for OpenAI and Anthropic API key retrieval, allowing you to fetch provider-specific credentials securely while ensuring secret fragments do not leak into error messages or notebook outputs.

Why should I not hardcode API keys directly in my Wolfram code?

Hardcoding API keys directly in Wolfram code risks accidental exposure through notebook outputs, shared files, or error messages, whereas using NBAccess`NBGetAPIKey enforces a safe retrieval and usage pattern that keeps credentials protected.

Can I use direct credential store access for API keys in Wolfram Language LLM integrations?

No, direct credential store access is forbidden for API keys in Wolfram Language LLM integrations, requiring you to use NBAccess`NBGetAPIKey instead to maintain consistent security guardrails across Anthropic and OpenAI calling flows.