You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide: env-var secret exposure — fd/stdin injection or defer #31
sc run hands decrypted secrets to the child via environment variables, observable by same-user processes, crash dumps, and wrappers (documented P28 boundary; audit known-boundary finding). Does fd/stdin secret injection get specified now as an alternative or additional mode, or stay deferred with recorded rationale?
fd/stdin secret injection stays deferred, with rationale. Env-var injection remains the contract for all three surfaces (sc run, sc work --with-secrets, sc ws run --with-secrets — one shared helper, secret_env, crates/repo/src/secrets.rs:330).
Rationale (recorded, not implied):
The security claim is mostly illusory against the boundary's named adversary. P28's threat model names same-user processes — but a same-user adversary reads the identity key file and .sc/ directly and decrypts everything; no injection mechanism changes that. What fd/stdin injection actually removes is accidental propagation — env dumps, inheritance by grandchildren — hygiene, not attack surface.
Env stays the default mode forever regardless. Non-env modes require child cooperation (a program reading $API_KEY cannot read fd 3), so fd/stdin could only ever be an additional opt-in mode. Deferring an additive mode has no lock-in cost.
The right convention is not yet decidable. An SC_SECRETS_FD pipe (KEY=VALUE lines) vs a systemd-LoadCredential-style credentials dir is a consumer-driven choice, and no real consumers exist yet; the credentials-dir shape additionally writes plaintext to disk (tmpfs only on Linux), colliding with the zero-plaintext-on-disk discipline. Windows lacks fd-inheritance parity — the platform story is part of the same open contract.
Revisit triggers: real committed-secret use in agent sessions, or an observed env-leak incident class (agents dumping env into logs/committed files) — at which point the fd-pipe mode is the presumptive shape, and the accident-hygiene argument sharpens specifically because sc work/sc ws run hand secrets to agents, which are notorious env-dumpers.
docs/THREAT-MODEL.md keeps P28's wording ("authorized local process context, NOT strong isolation"); ADR-0039's deferred-not-a-bug stance is reaffirmed by this decision.
Activity
tonibergholm commentedon Jul 10, 2026
Resolution
fd/stdin secret injection stays deferred, with rationale. Env-var injection remains the contract for all three surfaces (
sc run,sc work --with-secrets,sc ws run --with-secrets— one shared helper,secret_env,crates/repo/src/secrets.rs:330).Rationale (recorded, not implied):
.sc/directly and decrypts everything; no injection mechanism changes that. What fd/stdin injection actually removes is accidental propagation — env dumps, inheritance by grandchildren — hygiene, not attack surface.$API_KEYcannot read fd 3), so fd/stdin could only ever be an additional opt-in mode. Deferring an additive mode has no lock-in cost.SC_SECRETS_FDpipe (KEY=VALUE lines) vs a systemd-LoadCredential-style credentials dir is a consumer-driven choice, and no real consumers exist yet; the credentials-dir shape additionally writes plaintext to disk (tmpfs only on Linux), colliding with the zero-plaintext-on-disk discipline. Windows lacks fd-inheritance parity — the platform story is part of the same open contract.Revisit triggers: real committed-secret use in agent sessions, or an observed env-leak incident class (agents dumping env into logs/committed files) — at which point the fd-pipe mode is the presumptive shape, and the accident-hygiene argument sharpens specifically because
sc work/sc ws runhand secrets to agents, which are notorious env-dumpers.docs/THREAT-MODEL.mdkeeps P28's wording ("authorized local process context, NOT strong isolation"); ADR-0039's deferred-not-a-bug stance is reaffirmed by this decision.