Codex.Approvals (Codex SDK v0.3.0)
View SourceApproval helpers invoked by the auto-run pipeline when actions require consent.
Supports both synchronous and asynchronous approval workflows via pluggable hooks.
Summary
Functions
Reviews a tool invocation given the configured policy or hook.
Types
Functions
@spec review_tool(term(), map(), map(), keyword()) :: review_result()
Reviews a tool invocation given the configured policy or hook.
Parameters
policy_or_hook- StaticPolicy struct, hook module, or nilevent- Tool call event (must contain:tool_nameand:call_id)context- Approval contextopts- Optional keyword list with:timeout(default: 30_000ms)
Returns
:allow- approve the operation{:deny, reason}- deny with reason{:async, ref}or{:async, ref, metadata}- async approval pending
Telemetry
Emits the following events:
[:codex, :approval, :requested]- when approval is requested[:codex, :approval, :approved]- when synchronously approved[:codex, :approval, :denied]- when denied[:codex, :approval, :timeout]- when async approval times out