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
[Feature Request] Strip ambient credential variables a plugin knows about, not only declared @internal items #1144
@internal keeps a secret-zero out of the child process, but only for items the schema declares. A credential that is already in the environment under another name reaches the app unchanged. Ask: let plugins declare the credential env vars they use, so varlock run strips them too, and/or add a way to strip named vars from the child (for example a root decorator or varlock run --strip VAR).
Motivation
With the 1Password plugin, the documented setup declares the token as OP_TOKEN (@type=opServiceAccountToken, internal by default). But the op CLI and 1Password's own docs use OP_SERVICE_ACCOUNT_TOKEN, so hosts and shells often carry that name too. Repro on 1.21.0:
OP_SERVICE_ACCOUNT_TOKEN=dummy varlock run -- sh -c 'env | grep ^OP_'# OP_SERVICE_ACCOUNT_TOKEN=dummy
The app, and anything it spawns, can read every vault that token opens, while the schema looks like it keeps the secret-zero internal.
Declaring it yourself works (OP_SERVICE_ACCOUNT_TOKEN= with @internal @optional removes it from the child), but you have to know that name, and the same applies to every plugin's credential variables (AWS keys, Vault tokens, and so on).
Proposed Solution
A plugin can register the ambient credential variables it knows about (OP_SERVICE_ACCOUNT_TOKEN, OP_CONNECT_TOKEN for 1Password), and varlock treats them as @internal whenever that plugin is loaded, unless the schema explicitly declares them non-internal.
Optionally a generic mechanism, e.g. # @stripFromChild(OP_SERVICE_ACCOUNT_TOKEN, AWS_SECRET_ACCESS_KEY) or varlock run --strip, for tokens no plugin knows about.
varlock load could warn when a known credential variable is present but not declared.
Alternatives
Declare each such variable as @internal @optional in every schema (works today, easy to forget).
Wrap the app with env -u (outside varlock, and does nothing for auto-load).
Additional Information
Related to the secret-zero guidance in the 1Password plugin docs and the @internal item decorator.
Activity
pullfrog commentedon Sep 28, 2026