Skip to content

safekeys/exec-wrapper [built] ​

safekeys exec --token … -- <command> runs a command with secrets injected into its environment and the ambient environment scrubbed. It is the framework-agnostic integration: any harness that can spawn a subprocess works immediately, and the caller receives only an exit code.

Status: built

Why this exists ​

The cleanest "the model never sees plaintext" path is the one where the secret never appears in any argument, output, or transcript the model can read. A wrapper that spawns the consumer as its own child, passes secrets through the child's environment, and returns only an exit code achieves that for every tool that already exists, with no SDK or framework integration required.

Design decisions ​

exec-is-framework-agnostic [accepted] ​

Decision: Ship the exec wrapper as a first-class MVP harness integration.

Rationale: The blueprint lists CLI/exec as one of three MVP integrations precisely because it is framework-agnostic — any harness that can spawn a subprocess works, including ones with no SDK. It is also the cleanest model-never-sees-plaintext path.

minimal-env [accepted] ​

Decision: Give the child a minimal, explicit environment rather than inheriting and augmenting the parent's.

Rationale: Inheritance is the classic leak vector — ambient credentials, tokens, and paths follow the process in silently. Allowlisting inverts the default to deny.

How it works ​

Execute a wrapped command (exec-with-token) ​

The CLI resolves the token and runs the command with injected env.

  1. Receive — CLI receives a token and a command to run after a -- separator.
  2. Send — CLI forwards the resolve request to the local sidecar over its socket.
  3. Setup — Sidecar builds a minimal environment for the child, adds the injected value under its variable name, and spawns the command.
  4. Observe — The command runs; its stdout and stderr are streamed to the caller.
  5. Receive — The caller receives the command's exit code; the value is never printed by the wrapper.