Skill

Securely Manage Environment Variables

Security skill enforcing secure-by-default environment variable handling in Claude Code sessions using Varlock, never exposing secrets.

Works with github1passwordaws

84
Spark score
out of 100
Updated 28 days ago
Version @varlock/vite-integr

Add to Favorites

Why it matters

Ensure sensitive environment variables and secrets are never exposed in Claude Code sessions. This skill provides a secure-by-default workflow for managing, validating, and auditing secrets, keeping them out of logs, context, and code.

Outcomes

What it gets done

01

Validate secrets without exposing them in terminal output or context.

02

Load and mask sensitive values from .env files using a defined schema.

03

Integrate with external secret managers like 1Password and AWS Secrets Manager.

04

Enforce security rules to prevent secrets from appearing in logs, diffs, or commands.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-varlock | bash

Overview

Varlock Security Skill

A security skill enforcing secure-by-default environment variable and secrets handling in Claude Code sessions via the Varlock CLI, ensuring secret values never enter the assistant's context or logs. Use it in any Claude Code session touching real API keys, database credentials, or other secrets - it replaces raw .env inspection with schema-validated, masked access.

What it does

Varlock Security Skill provides secure-by-default environment variable management for Claude Code sessions, built around the Varlock CLI. Its core principle is that secrets must never appear in terminal output, Claude's input/output context, log files or traces, git commits or diffs, or error messages - and the skill enforces this through four hard rules for Claude itself: never echo secrets (no echo $SECRET, cat .env | grep SECRET, or printenv | grep API - use varlock load --quiet to validate without exposing values), never read .env directly (read the safe .env.schema instead, or use varlock load which shows masked values), always validate through Varlock rather than shell tests that could leak a value into an error message, and never inline secrets into commands (use varlock run -- <command> or an environment variable reference instead of pasting a live key into a curl command).

When to use - and when NOT to

Use it whenever a Claude Code session needs to work with environment variables or secrets without exposing their values, when a task involves validating, loading, or auditing secrets while keeping them out of logs/diffs/assistant context, or when you want a secure-by-default workflow instead of direct .env inspection. Any workflow that would require Claude to see a raw secret value is exactly what this skill exists to prevent.

Inputs and outputs

Installation runs a reviewed installer script (curl -sSfL https://varlock.dev/install.sh downloaded to a temp file, inspected, then executed with --force-no-brew) and adds ~/.varlock/bin to PATH. varlock init generates a .env.schema from an existing .env, or one can be created manually. The schema defines type, validation, requiredness, and sensitivity per variable using annotations like @type=enum(...), @type=port, @type=url @required, and @type=string(startsWith=sk_) @required @sensitive - so NODE_ENV or a Stripe publishable key can be marked non-sensitive while DATABASE_PASSWORD or a Stripe secret key are marked sensitive and masked. Running varlock load shows masked output like API_KEY sensitive └ ▒▒▒▒▒ instead of the real value.

Integrations

Wraps common workflows that would otherwise expose secrets - validation (varlock load), and running a command with secrets injected but not visible (varlock run -- curl ...) - so existing scripts and commands can use real secret values without those values ever passing through Claude's context.

Who it's for

Developers running Claude Code sessions in codebases with real API keys, database credentials, or other secrets who need a structural guarantee - not just discipline - that those values never leak into the assistant's context, logs, or git history.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.