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
simlock config prints gateway.token and alert secrets in plain text #1097
simlock config prints the daemon's config as written, secrets included: gateway.token (the worker's join token), and each gateway.alerts.destinations[] entry's url and secret. simlock config get gateway does the same for one key.
A coding agent ran simlock config on a worker to check a setting. The join token landed in its tool output, which is the agent's transcript. Since then we forbid agents to run simlock config at all.
This is deliberate today. config.get is admin-role and returns the config as written (src/core/config.ts:416), and only the startup log line and daemon.started go through redactConfig (src/core/config.ts:481). The reasoning is that the output is as sensitive as config.json. For an agent that isn't true: a transcript is kept, synced and shared far more widely than a 0600 file.
What you expected
simlock config and simlock config get print [redacted] in place of every secret by default, the way redactConfig already does for the log. Seeing the real value takes an explicit flag, such as --show-secrets. config.get over the socket and HTTP could redact the same way, so no frontend prints a secret by accident.
How to reproduce
On a worker, simlock config set gateway.token <a join token>.
simlock config
The output contains the token in plain text. simlock config get gateway.token prints it too.
Environment
Simlock 0.4.0, worker joined to a gateway, macOS. Current main (795733b) behaves the same: src/cli/commands/config.ts writes client.getConfig() unchanged.
Logs and evidence
The leaked value is a secret, so it isn't reproduced here.
Maintainer decision: secrets are hidden by default.
simlock config and simlock config get <key> print [redacted] in place of every secret: gateway.token, and each gateway.alerts.destinations[] entry's url and secret. The masking is the same as redactConfig already does for the log.
config.get over the socket and HTTP redacts the same way by default, so no frontend prints a secret by accident.
--show-secrets on the CLI (showSecrets: true on config.get, admin role as today) returns the real values.
Confirmed on main (bcedd2f), worker and gateway. The expectation is the maintainer's decision above.
e2e/config-secrets.test.ts › "simlock config and config get print [redacted] for gateway.token and every alert destination's url and secret, and --show-secrets prints the real values", branch bug/1097-repro.
Decision, not a defect. Both config.get handlers return the live config unredacted: src/daemon/dispatcher.ts:835 and src/gateway/dispatcher.ts:375. The CLI prints the answer as is (src/cli/commands/config.ts:20, :32). ADR 0035 §6 says so ("config.get keeps answering admins with the config as written"), and it still binds ("Accepted — not yet implemented"). The maintainer's comment changes it, so §6 needs a superseding ADR before or with the fix. HTTP and MCP have no config.get route or tool today. Only the socket and the uplink carry it.
Simplest fix
One PR. A local prototype passed the test and broke only the test under Risk.
config.get input: z.object({ showSecrets: z.boolean().optional() }), and bump DAEMON_PROTOCOL_VERSION.
Both handlers: input.showSecrets === true ? config : redactConfig(config).
getConfig(input = {}) in simlock-client. Add --show-secrets to config and config get.
Update the config.ts:416 comment, EVENTS.md:146 and the config section of reference/cli.mdx.
Alternatives rejected
Redact only in the CLI: socket clients and the gateway's view of a worker would still get the secrets.
Delete the secret keys instead of masking them: then "unset" and "set" look the same, unlike redactConfig.
Risk
src/daemon/main.test.ts:526 asserts "config.get still returns it". Invert it. Nothing else needs the secrets: config set reads config.json directly, the gateway's worker view keeps only downloads and lease (src/contract/worker-view.ts:110), and the console and MCP never call config.get.
The gateway handler holds the contract type GatewayConfig, not core Config, so redactConfig needs a type it accepts.
Maintainer decision on the triage's ADR question: no new ADR. The fix PR amends ADR 0035 §6 in place, so that config.get redacts secrets by default and showSecrets: true returns the config as written. The fix follows the triage's proposed fix.
Activity
V3RON commentedon Oct 31, 2026
Maintainer decision: secrets are hidden by default.
simlock configandsimlock config get <key>print[redacted]in place of every secret:gateway.token, and eachgateway.alerts.destinations[]entry'surlandsecret. The masking is the same asredactConfigalready does for the log.config.getover the socket and HTTP redacts the same way by default, so no frontend prints a secret by accident.--show-secretson the CLI (showSecrets: trueonconfig.get, admin role as today) returns the real values.Written by an agent.
V3RON commentedon Oct 31, 2026
Reproduction
Confirmed on
main(bcedd2f), worker and gateway. The expectation is the maintainer's decision above.e2e/config-secrets.test.ts› "simlock config and config get print [redacted] for gateway.token and every alert destination's url and secret, and --show-secrets prints the real values", branchbug/1097-repro.Root cause
Decision, not a defect. Both
config.gethandlers return the live config unredacted:src/daemon/dispatcher.ts:835andsrc/gateway/dispatcher.ts:375. The CLI prints the answer as is (src/cli/commands/config.ts:20,:32). ADR 0035 §6 says so ("config.getkeeps answering admins with the config as written"), and it still binds ("Accepted — not yet implemented"). The maintainer's comment changes it, so §6 needs a superseding ADR before or with the fix. HTTP and MCP have noconfig.getroute or tool today. Only the socket and the uplink carry it.Simplest fix
One PR. A local prototype passed the test and broke only the test under Risk.
config.getinput:z.object({ showSecrets: z.boolean().optional() }), and bumpDAEMON_PROTOCOL_VERSION.input.showSecrets === true ? config : redactConfig(config).getConfig(input = {})insimlock-client. Add--show-secretstoconfigandconfig get.config.ts:416comment,EVENTS.md:146and theconfigsection ofreference/cli.mdx.Alternatives rejected
redactConfig.Risk
src/daemon/main.test.ts:526asserts "config.get still returns it". Invert it. Nothing else needs the secrets:config setreadsconfig.jsondirectly, the gateway's worker view keeps onlydownloadsandlease(src/contract/worker-view.ts:110), and the console and MCP never callconfig.get.GatewayConfig, not coreConfig, soredactConfigneeds a type it accepts.Written by an agent.
V3RON commentedon Oct 31, 2026
Maintainer decision on the triage's ADR question: no new ADR. The fix PR amends ADR 0035 §6 in place, so that
config.getredacts secrets by default andshowSecrets: truereturns the config as written. The fix follows the triage's proposed fix.Written by an agent.
fix(config): reject a subcommand after a leading --show-secrets (#1097)
fix(config): config.get redacts secrets unless showSecrets is asked (c…