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
Harden safety, executor, and CI; dedup shell quoting
Five targeted hardening fixes from the code review, no behavioral
rewrites:
- ci: add GitHub Actions workflow (typecheck, lint, build, test on
Node 18/20/22). The suite is fully offline, so no API keys/credits
are used.
- executor: wire a per-step wall-clock timeout into the setup path so a
hung command (stuck install, stdin prompt, unreachable registry) can
no longer block forever. Generous per-type defaults, overridable via
SETUPR_STEP_TIMEOUT_MS; timeouts surface a clear terminated message.
- safety: remove dead-code ternary (force ? confirm : confirm) — high
risk now plainly always confirms and --force cannot bypass it.
Normalize forceCanSkipConfirmation to `risk === "medium"` in both
safety.ts and engine.ts so the two agree.
- safety: tighten secret detection to match inline KEY=value credential
assignments and recognizable secret value literals instead of bare
words, removing false-positive confirmations (e.g. `npm i next-auth`).
- refactor: extract the duplicated shellQuote helper into
src/util/shell.ts and import it in security, verification, and product.
- docs: document the safety threat model in SECURITY.md (best-effort
denylist + best-effort redaction, not a sandbox).
Adds 9 regression tests (186 total). typecheck, lint, build, and the
full suite pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: SECURITY.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,3 +16,35 @@ Please do not open a public issue for a suspected vulnerability. Email the maint
16
16
## Secret Handling
17
17
18
18
Never commit API keys, Telegram tokens, OAuth credentials, database files, `.env` files, or local user exports. Use `.env.example` for placeholders only.
19
+
20
+
Secrets are redacted on a best-effort basis (`redactText`/`redactObject` in `src/core/engine.ts`) before commands, history, and logs are persisted. This targets common token shapes and `NAME=value` credential assignments — it is not a guarantee that no secret will ever reach a log file.
21
+
22
+
## Threat Model
23
+
24
+
Setupr runs real shell commands on your machine with your full user privileges. The command-safety
25
+
layer (`src/agent/safety.ts`) is a **best-effort, defense-in-depth guard, not a sandbox.** It
26
+
classifies each planned command and decides whether to allow, confirm, or block it:
27
+
28
+
-**Block (cannot be bypassed by `--force`)** — clearly destructive or hostile patterns such as
0 commit comments