agentleFS
crissmoldovancrissmoldovan/agent-skills/skills/secure-credential-setup/SKILL.md

secure-credential-setup

Skill2 starsChanged 47 days agoMITView on GitHub

Get an API key, token or password into a secret store without the value ever appearing in the transcript: one credential at a time, one exact copy-pasteable terminal command for the user to run, then verification that it authenticates without printing it. Symptoms: where do I put this key, set up my API token, add it to .env / the keychain / the secret manager, here's my key (don't paste it back), the tool says unauthorized and no credential is configured.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 10 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Place API keys, tokens, and other secrets without asking the user to paste values into chat.

    line 12
  2. Distinctive:

    Never request a secret in chat.

    line 25
  3. Distinctive:

    Read safe terminal entry patterns before composing a placement command.

    line 28
  4. Distinctive:

    Ask for one credential only: Do not batch multiple secret prompts.

    line 36
  5. Distinctive:

    Wait for confirmation: Do not provide the next credential command yet.

    line 42
  6. Distinctive:

    Verify without disclosure: Check entry presence and a harmless provider authentication endpoint.

    line 43
  7. Distinctive:

    Use the consuming provider's harmless authenticated read to prove validity.

    line 66
  8. Very specific:

    Placeholder stored as secret: never ask users to edit * inside a command.

    line 86
  9. Distinctive:

    Shell history leakage: never put a literal secret in command arguments.

    line 87
  10. Distinctive:

    Presence mistaken for validity: always run a harmless auth probe.

    line 88
  11. Distinctive:

    Leaky diagnostics: never print prefixes, lengths, hashes, or raw bodies that might echo request credentials.

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Secure credential setup

Place API keys, tokens, and other secrets without asking the user to paste values into chat. Request one credential at a time, give one exact terminal placement command, wait for completion, then verify presence and authentication without printing the secret. The domain skill decides which credential and harmless API probe are required; this skill owns safe placement mechanics.

When to Use

  • A task needs an API key, token, password, or workspace-specific credential.
  • Several accounts/workspaces require distinct credentials.
  • The user asks where to put a secret or wants a copy-pasteable command.
  • A previous setup may have stored the command or placeholder as the secret.

Never request a secret in chat. Do not use this workflow to transmit credentials to another person, rotate/revoke keys, or scrape credentials from disk.

Read safe terminal entry patterns before composing a placement command.

Procedure

  1. Identify scope first. Name the provider, account/workspace, purpose, and exact destination. Use a neutral profile identifier; never let two trust boundaries share an ambiguous key.
  2. Ask for one credential only. Do not batch multiple secret prompts.
  3. Give one complete command. It must start from the normal shell prompt, request hidden input after launch, write/update one named secret-store entry, unset temporary state, and print only a non-secret success sentence.
  4. Explain the two stages. Say explicitly: paste the command once and press Enter; wait for its prompt; then paste only the secret and press Enter.
  5. Wait for confirmation. Do not provide the next credential command yet.
  6. Verify without disclosure. Check entry presence and a harmless provider authentication endpoint. Never print value, prefix, suffix, length, hash, or encoded form.
  7. Diagnose safely. Distinguish absent entry, malformed placement, wrong workspace, expired/revoked key, and insufficient scope. Overwrite a malformed entry; do not log or inspect its value.
  8. Repeat one profile at a time. Each trust boundary gets a distinct variable or secret-store service.
  9. Require explicit profile selection. Runtime code must not fall back from one workspace's credential to another.

macOS Keychain

trap 'stty echo' INT TERM EXIT; printf "Paste the <PROFILE> API key, then press Enter: "; stty -echo; IFS= read -r API_KEY; stty echo; trap - INT TERM EXIT; printf '\n'; security add-generic-password -U -a "$USER" -s "<provider>-api-key-<profile>" -w "$API_KEY" >/dev/null; unset API_KEY; echo "<PROFILE> key saved in macOS Keychain."

Presence check only:

security find-generic-password -a "$USER" -s "<provider>-api-key-<profile>" >/dev/null 2>&1

Use the consuming provider's harmless authenticated read to prove validity. Presence alone is not success.

Usage Examples

Set up the API key for this workspace safely. Give me one exact terminal command,
never ask for the key in chat, wait for me to place it, then verify authentication
without printing any secret metadata.
Configure two workspace credentials. Request them one at a time, store them under
separate neutral profiles, verify each before asking for the next, and require an
explicit profile in runtime code.

Pitfalls

  • Command stored as secret: explain the two-stage paste before the command.
  • Placeholder stored as secret: never ask users to edit *** inside a command.
  • Shell history leakage: never put a literal secret in command arguments.
  • Presence mistaken for validity: always run a harmless auth probe.
  • Leaky diagnostics: never print prefixes, lengths, hashes, or raw bodies that might echo request credentials.
  • Process-list exposure on macOS: security -w "$API_KEY" briefly passes the value to the Keychain CLI. State this limitation where other local users can inspect process arguments; use an approved native/enterprise secret-store UI instead when that threat model applies.
  • Cross-workspace fallback: authentication success does not prove the chosen workspace is intended.
  • Batching: request and verify one credential before discussing the next.

Verification

  • Secret never appeared in chat, arguments, source, logs, or clipboard output.
  • Destination identifies the intended provider/profile/trust boundary.
  • User received one exact command at a time and understood the two stages.
  • Presence check emitted no secret data.
  • Harmless live authentication succeeded for each profile.
  • Runtime selection requires an explicit profile when multiple keys exist.
  • Temporary shell state was unset.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.