tools: with-secrets loader + standards/secrets-handling #18
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ai-collab/agents!18
Loading…
Reference in a new issue
No description provided.
Delete branch "tools/with-secrets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds one sanctioned way for agents to use secrets at runtime, after 3-4 incidents of agents leaking their own env/token files into logs.
tools/with-secrets(Python stdlib, one file):with-secrets NAME=SPEC ... -- cmd. Sources:file:(must be 0600 and owned by you; relative paths resolve under~/.secrets),dotenv:PATH#KEY(parsed, never sourced),bw:ITEM[#FIELD](Vaultwarden viabw, unlocked inside the tool;BW_SESSIONnever reaches the child).NAME@=SPECgives the command a 0600/dev/shmtemp file instead. Every loaded value (plus the bw master password and session) shows up as[REDACTED]in the child's stdout and stderr.--no-maskexecs the command directly;--checkreports what loaded without printing values.tools/test-with-secrets.sh: self-test with dummy values (passes on the Bot box).standards/secrets-handling.md: never source/cat/set -x/argv secrets; use with-secrets; prefer Vaultwarden items named for the consumer and update them in place when you rotate.secrets-and-credentials.md,standards/README.md, and the root README point to it.Already installed on the Bot box as
/home/box/bin/with-secrets. Tested there: masking on stdout and stderr, a value split across writes, dotenv values containing|$\``, temp-file mode and cleanup, exit-code passthrough, refusal of 0644 files, andbw:` lookup by exact item name against warden.valleygeek.net.Known limit (written in
--helpand the standard): masking only catches exact values. A value the command transforms, or one shorter than 4 characters, is not masked.