/** What `makeUndumpable` could do on this platform. */ export type Undumpable = { undumpable: true; how: string; } | { undumpable: false; why: string; }; /** Which platform `makeUndumpable` acts for; this process's by default. */ export interface MakeUndumpableOptions { platform?: NodeJS.Platform; } /** * Keeps other processes of the same user out of this one's memory, for a * process holding secrets beside programs it does not trust, such as a * daemon keeping API keys while agents run as its own user. Call it once, at * start, before the process holds a secret: it cannot be undone. * * On Linux it clears the process's dumpable flag, so no process but root's * can ptrace it or read `/proc//mem` or `/proc//environ`, and it * leaves no core dump; it checks the flag took. On macOS it denies debuggers * the right to attach, which stops `lldb` and `ptrace`, though not root; a * Bun signed with the hardened runtime, as released, refuses them already, * and this keeps a locally built or re-signed one the same. * Elsewhere it does nothing and says why. It throws when the call fails * where it should work, since a caller relying on it must not carry on * unguarded. * * Children are not covered: the flag returns with each program they run, so * the programs it spawns can be ptraced as usual. */ export declare function makeUndumpable(opts?: MakeUndumpableOptions): Promise;