The Canon Boundary Guard PreToolUse hook re-surfaces the compact classification frame fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/xxyoudeadpunkxx/canon-boundary-guard-codex/llms.txt
Use this file to discover all available pages before exploring further.
references/frame.md immediately before matched write tools execute. It does not block the tool call, rewrite the requested operation, or decide project policy. Its sole job is to put the provenance classification layer back into the instruction stream at the moment a write may happen.
Hook Configuration
The hook is defined inplugins/canon-boundary-guard-codex/hooks/hooks.json. The full contents of that file are shown below.
matcher— a pipe-separated pattern that targets theapply_patch,Write, andEdittools. The hook fires before any tool whose name matches one of these values.type—"command"instructs Codex to run the value ofcommandas a subprocess.command— the Python script path, using${PLUGIN_ROOT}as a runtime-resolved variable pointing to the installed plugin directory.timeout— the hook runner will wait at most5seconds for the script to complete before proceeding without its output.statusMessage—"Provenance frame"is the label shown in the Codex UI or event stream while the hook is running.
Enabling the Hook
Plugin-bundled hooks are off by default. To enable them, add the following to your Codexconfig.toml:
/hooks to review and trust the bundled hook in UIs that support it. In editor integrations where /hooks is not available, approve the hook when Codex shows the trust prompt.
Plugin hooks are non-managed hooks and do not run until trusted. Restarting Codex after enabling the feature flags is required for the change to take effect.
What the Hook Injects
The hook script emits a JSON object to stdout. Codex reads two fields from that object:hookSpecificOutput.additionalContext— the model-visible context path forPreToolUse. The contents offrame.mdare injected here, making them available to the model before the write tool executes.systemMessage— a root-level field that makes the hook activity visible in the UI or event stream, independent of whether the model-visible path is surfaced in the UI.
references/frame.md. The duplication is intentional — additionalContext targets the model; systemMessage targets the operator-facing UI.
If your system requires
python3 instead of python, adjust the hook command in your local plugin copy or configure an equivalent hook in your Codex config.toml.inject_frame.py Reference
Source walkthrough, output shape, and fallback behavior of the hook injection script.
Fallback Behavior
What happens when the frame file is missing or the hook cannot run.