Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#1755 vault put prompts for the secret before validating the vault name exists

Opened by skunk-ape · 8/20/2026· Shipped 8/20/2026

Summary

swamp vault put <vault> <key> prompts for the secret value before validating that <vault> exists. When the vault name is mistyped, the user has already typed a real credential into a prompt for a destination that was never going to accept it — and the output gives them no way to tell whether it was stored somewhere.

Nothing is actually written, so this is a UX and confidence problem rather than a data-loss one. But "did my API key just go somewhere I didn't intend?" is not a question a secrets command should leave open.

Reproduction

$ swamp vault put hermes-secret anthropic-key
Enter value for anthropic-key:
<user types a real API key>

Error: Vault not found: hermes-secret. Available vaults: hermes-secrets

The error itself is good — it names the problem and lists the valid vaults. It just arrives one step too late.

Why it matters more than it looks

The user who hit this had to inspect .swamp/secrets/ by hand to satisfy themselves that nothing had been written:

$ find .swamp/secrets -name '*.enc'
.swamp/secrets/local_encryption/hermes-secrets/anthropic-key.enc
.swamp/secrets/local_encryption/hermes-secrets/worker-token-hermes-vm.enc

That is a reasonable thing to want confirmed and an unreasonable way to have to confirm it.

The doubt compounds when the key already exists in the correctly-named vault, because the corrected command then says:

$ swamp vault put hermes-secrets anthropic-key
Enter value for anthropic-key:
Secret 'anthropic-key' already exists in vault 'hermes-secrets'. Overwrite? [y/N]

Read immediately after a failed put, "already exists" looks like evidence that the failed attempt landed. It is not — it is the pre-existing value — but distinguishing the two requires knowing the implementation.

Suggested fix

Resolve and validate the vault before prompting for any value. The existing error text and "Available vaults" hint are already right; they just need to fire earlier.

Scope looks small: only the interactive prompt path is affected. The positional-argument, KEY=VALUE, and stdin forms already fail without collecting anything separately, since the value arrives with the invocation.

A near-miss suggestion (hermes-secrethermes-secrets) would be a nice extra, but ordering is the substantive fix.

Environment

  • swamp 20260820.011410.0-sha.23de2d5a
  • macOS 15 (arm64), local_encryption vault
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/20/2026, 11:25:20 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/20/2026, 10:28:54 PM
Editable. Press Enter to edit.

stack72 commented 8/20/2026, 11:25:46 PM

Thanks @skunk-ape for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.