export type SafetyAssessment = {
    /**
     * If set, this approval is for an apply_patch call and these are the
     * arguments.
     */
    applyPatch?: ApplyPatchCommand;
} & ({
    type: "auto-approve";
    /**
     * This must be true if the command is not on the "known safe" list, but
     * was auto-approved due to `full-auto` mode.
     */
    runInSandbox: boolean;
    reason: string;
    group: string;
} | {
    type: "ask-user";
}
/**
 * Reserved for a case where we are certain the command is unsafe and should
 * not be presented as an option to the user.
 */
 | {
    type: "reject";
    reason: string;
});
export type ApplyPatchCommand = {
    patch: string;
};
export type ApprovalPolicy = 
/**
 * Under this policy, only "known safe" commands as defined by
 * `isSafeCommand()` that only read files will be auto-approved.
 */
"suggest"
/**
 * In addition to commands that are auto-approved according to the rules for
 * "suggest", commands that write files within the user's approved list of
 * writable paths will also be auto-approved.
 */
 | "auto-edit"
/**
 * All commands are auto-approved, but are expected to be run in a sandbox
 * where network access is disabled and writes are limited to a specific set
 * of paths.
 */
 | "full-auto";
/**
 * Tries to assess whether a command is safe to run, though may defer to the
 * user for approval.
 *
 * Note `env` must be the same `env` that will be used to spawn the process.
 */
export declare function canAutoApprove(command: ReadonlyArray<string>, workdir: string | undefined, policy: ApprovalPolicy, writableRoots: ReadonlyArray<string>, env?: NodeJS.ProcessEnv): SafetyAssessment;
/**
 * If not already an absolute path, resolves `candidatePath` against `workdir`
 * if specified; otherwise, against `process.cwd()`.
 */
export declare function resolvePathAgainstWorkdir(candidatePath: string, workdir: string | undefined): string;
export type SafeCommandReason = {
    reason: string;
    group: string;
};
/**
 * If this is a "known safe" command, returns the (reason, group); otherwise,
 * returns null.
 */
export declare function isSafeCommand(command: ReadonlyArray<string>): SafeCommandReason | null;
