Przejdź do treści
Biblioteka skilli
Bezpieczeństwo · Automatyzacja

secure-credential-handoff

/secure-credential-handoff

Przekazuje sekret, na przykład hasło lub token, do polecenia powłoki tak, by nie trafił do transkrypcji rozmowy ani do kontekstu modelu.

Repozytorium
claude-toolkit ↗
Licencja
MIT
Ostatnia zmiana repozytorium
29.10.2026

Ocena i bezpieczeństwo

95/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść30 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 29.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Przekazuje sekret, na przykład hasło lub token, do polecenia powłoki tak, by nie trafił do transkrypcji rozmowy ani do kontekstu modelu.

Oryginalny opis (EN)

Pattern for getting a secret (password, API token, key) into a shell command Claude runs, without the plaintext ever entering the conversation transcript or Claude's own context. Use whenever a task needs Claude to authenticate against something — log into a dev server, call an API, touch a database — and the user would rather not paste the credential directly into chat. Not project-specific; applies wherever Claude runs shell commands.

Jak działa

  1. The problem with "just export it in .bashrc"
  2. The pattern: a dedicated file, sourced explicitly, every time
  3. Verifying presence without ever reading the value
  4. What this does and doesn't buy you
Sekcje z nagłówków SKILL.md, w oryginale · 62 linii, 595 słów
Podgląd SKILL.md
---
name: secure-credential-handoff
description: Pattern for getting a secret (password, API token, key) into a shell command Claude runs, without the plaintext ever entering the conversation transcript or Claude's own context. Use whenever a task needs Claude to authenticate against something — log into a dev server, call an API, touch a database — and the user would rather not paste the credential directly into chat. Not project-specific; applies wherever Claude runs shell commands.
---

Project-agnostic technique for keeping secrets out of the conversation transcript.

## The problem with "just export it in `.bashrc`"

It looks like it should work and quietly doesn't.
Claude's Bash tool spawns a fresh **non-interactive, non-login** shell per command (in practice `bash -c "<command>"`).
`~/.bashrc` only auto-loads for *interactive* shells;
`~/.bash_profile`/`~/.profile` only for *login* shells — neither condition holds here, so an `export` sitting in either file is invisible to every command Claude runs, guard clauses or not.
(Most distro `.bashrc` files also short-circuit non-interactive shells explicitly near the top — `case $- in *i*) ;; *) return;; esac` — which looks like the cause if you go looking, but isn't the real one: the file often isn't even being read at all.)

Confirm this on your own setup before trusting either explanation:

```bash
# Does a value from ~/.bashrc reach a plain Bash-tool-style invocation at all?
bash -c 'printf "%s" "$SOME_VAR"' | wc -c   # 0 even after `export SOME_VAR=x` in .bashrc
bash -ic 'printf "%s" "$SOME_VAR"' | wc -c  # forcing interactive mode picks it up —
                                             # proves the value's fine, the sourcing isn't
```

## The pattern: a dedicated file, sourced explicitly, every time

Skip shell startup files entirely.
Use one small, permission-locked file and `source` it inline as part of the same command that needs it — never as a separate step, since shell state doesn't persist between Claude's tool calls anyway.

**Setup — the user runs this themselves**, not Claude, so the plaintext never passes through anything Claude reads or writes:

```bash
umask 077
echo 'export MY_SECRET="the-actual-value"' > ~/.some-task.env
chmod 600 ~/.some-task.env
```

**Usage — Claude sources it inline, every command that needs it:**

```bash
source ~/.some-task.env && curl -u "user:$MY_SECRET" https://example.local/api/...
```

## Verifying presence without ever reading the value

Prove the mechanism works before relying on it for anything real — length or exit-code checks only, never a plain `cat`/`grep` of the file or a bare `echo $VAR`:

```bash
len=$(bash -c 'source ~/.some-task.env && printf "%s" "$MY_SECRET"' | wc -c)
echo "length: $len"   # nonzero and plausible — never the value itself

grep -q '^export MY_SECRET=' ~/.some-task.env && echo "line present" || echo "line missing"
```

**The one command shape that defeats this entirely**: a bare `grep 'PATTERN' file` (no `-q`, no `-c`) prints whichever line matches — including its content.
If that happens, treat the value as burned immediately and rotate it — there's no un-printing a transcript line, and no amount of care afterward changes that it already happened.

## What this does and doesn't buy you

This keeps a secret out of the conversation transcript and out of anything Claude displays, which is a real, worthwhile property on its own.
It is **not** a security boundary against Claude itself: anything reachable via `$VAR` in a command Claude writes is a value Claude could choose to print, the same way any other command it runs executes on its own judgment as the only backstop.
Treat it as hygiene and convenience — reducing accidental exposure and keeping secrets out of durable logs — not as isolation from a misbehaving or compromised agent.

If the actual requirement is a hard boundary (Claude must never be *able* to use the raw credential, only a narrower capability), this pattern is the wrong tool — hand over a short-lived, scoped token instead of a durable credential, or have a separate process perform the privileged action and hand back only its result.
That's real infrastructure, not a config file, so reach for it only when the stakes actually call for it.

Wersje

W bazie nie ma innych skilli o nazwie secure-credential-handoff.

Migawka bazy z 13.11.2026 · wersja paczki 309ee2d07b34 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 2 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100op-secrets
    Pozwala używać 1Password z Claude Code tak, by sekrety nie trafiały do czatu, transkryptu ani historii powłoki, przez referencje op://.
  • 1001password
    Pozwala korzystać z 1Password w Claude Code tak, by sekrety nie trafiały do czatu, transkryptu, wiersza poleceń ani historii powłoki, także przy kluczach API i plikach .env.
  • 1001password
    Pobiera poświadczenia (klucz API, token, hasło, certyfikat) najpierw ze zmiennych środowiskowych, a potem z 1Password przez op, gdy zadanie wymaga sekretu.
  • 100envault
    Pozwala agentowi używać kluczy API, tokenów i haseł wyłącznie przez nazwę, bez wglądu w jawną wartość, zanim padnie prośba o sekret lub zapis do pliku .env.
  • 100secure-input
    Zbiera od użytkownika hasło lub klucz przez bezpieczny formularz, a agent przenosi plik bez odczytywania wartości.
  • 100secret-hygiene
    Wyjaśnia, gdzie trzymać klucz API, hasło lub ciąg połączenia w repozytorium i co zrobić, gdy wpadł do commita.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.