disclaw/dist/runtime/env.d.ts
Nick Tabeling ca461d0da6
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
fix(env): remove CI=true from sanitizedEnv, breaks Claude Code OAuth login
2026-04-09 13:18:25 +02:00

22 lines
No EOL
1,001 B
TypeScript

/**
* Sanitized environment builder for Claude Code child processes.
*
* Removes secrets from the inherited process environment before passing it to
* spawned subprocesses, so an agent cannot exfiltrate credentials via env vars.
*/
/**
* Returns a sanitized copy of `process.env` suitable for passing to a spawned
* Claude Code child process.
*
* - Removes all keys in the static blocklist.
* - Removes all keys matching the pattern blocklist.
* - Sets `CI=true` and `DISCLAW_AGENT=1` as runtime markers.
* - Merges `extra` last so callers can inject agent-specific variables
* (e.g. `DISCLAW_AGENT_NAME`) and override any of the defaults.
* - Removes any keys listed in `additionalBlocklist` (from `disclaw.yaml`
* `env_blocklist` field) after applying `extra`.
*
* This function is pure: it never mutates `process.env`.
*/
export declare function sanitizedEnv(extra?: Record<string, string>, additionalBlocklist?: string[]): NodeJS.ProcessEnv;
//# sourceMappingURL=env.d.ts.map