Files
Heimdall/.agents/skills/secure-env-secrets/SKILL.md
T

2.9 KiB

name, description
name description
secure-env-secrets Store or retrieve a user-provided secret as a local environment variable outside repositories, without exposing its value in commands or output. Does not configure CI or remote services.

Secure local environment secrets

Use this skill only for secrets the user supplied or explicitly authorized you to retrieve. Keep values outside repositories and never repeat them in commentary, tool output, logs, diffs, or a final response.

Choose scope and storage

  • Prefer the operating system credential store or an existing secret manager, and expose a value only to the process that needs it.
  • A secret in an environment variable is available to same-user processes and is not a secure store. Do not add secrets to global shell startup files by default.
  • If the user needs persistence and no credential store is available, use a user-owned directory outside every repository, with directory permissions 0700 and file permissions 0600. Explain that permissions restrict other accounts but do not encrypt the file. Avoid synced/shared locations unless requested.
  • Keep a persistent file inert data (for example, base64-encoded values keyed by validated variable names); do not source a file containing arbitrary shell code. Load a requested value only in the shell/process that needs it, without printing it.

Read or write safely

  1. Establish the variable name, intended scope (one command, one shell, or persistent local use), and destination. Ask only for details that change the safe implementation.
  2. Before writing, check for an existing value without displaying it. Preserve it unless the user explicitly requests replacement; do not silently delete credentials.
  3. Accept the secret through a masked prompt or credential-store protected input. Never place it in a command string, here-document, argument, URL, exported helper variable, or ordinary prompt. If the interface would expose input through tool history/output, ask the user to enter it locally and continue with metadata-only checks.
  4. Resolve and verify the destination is outside all involved repositories. Create owner-only directories and set owner-only file permissions before writing.
  5. Disable shell tracing and avoid commands that dump environment or variable values. Expose the variable only for the requested operation.
  6. Verify presence and permissions without printing or deriving information from the value. Report only the variable name, storage scope/path, and set/unset state.

Never use env, printenv, set, echo "$SECRET", shell tracing, or a diff to inspect secret values. Do not place secrets in project .env files, Compose definitions, source code, CI workflows, or test fixtures. This skill does not configure remote CI, cloud, registry, or account secrets.

If a value appears in output or is committed, stop using it and tell the user it should be rotated. Do not rotate credentials in an external service unless separately authorized.