Skip to main content

Module approval

Module approval 

Expand description

Interactive approval workflow for supervised mode. Provides a pre-execution hook that prompts the user before tool calls, with session-scoped “Always” allowlists and audit logging.

Structs§

ApprovalLogEntry
A single audit log entry for an approval decision.
ApprovalManager
ApprovalRequest
A request to approve a tool call before execution.

Enums§

ApprovalRequirement
ApprovalResponse
The user’s response to an approval request.

Constants§

MAX_REPLACEMENT_LEN
Maximum length of an operator-supplied DenyWithEdit / ReplaceWith replacement, in bytes. The replacement is operator-authored but still untrusted input that becomes a tool result fed back to the model — cap it so a runaway paste can’t blow up the context window.

Functions§

looks_like_secret_key
Heuristic for argument keys that should have their value redacted in human-readable summaries. Matches anywhere in the (lowercased) key: covers api_key, api-key, apiKey, oauth_token, secret, password, auth_token, bearer, client_secret, private_key, etc. Shared conservative heuristic for summary surfaces. A caller must still avoid rendering untrusted composite values by default.
sanitize_tool_replacement
Sanitize an operator-supplied tool-result replacement before it is fed back to the model: drop control characters (except \n, \r, \t) that could corrupt rendering or smuggle terminal escapes, and truncate to MAX_REPLACEMENT_LEN on a char boundary.
summarize_args