The usual answer to "keep secrets away from the model" is a gateway: put a proxy between your applications and the model API, and scrub requests on the way out. It is a good control for applications you build.
A coding agent like Claude Code usually talks to its model provider directly, from wherever it runs. Its requests never pass through your gateway, so the gateway never sees the API key in the log file the agent just opened, the customer email in the CSV it sampled, or the private key it cat-ed while debugging TLS.
The only place that sees all of that is the agent itself, at the moment a tool returns. That is where we put the redaction.
We are not the first to put redaction in a hook. Projects such as secretgate and redact-hook do it too, and if you want this on your own laptop, one of them may be all you need. What we add is aimed at a team handing boxes to agents: the hook can be installed by the platform rather than by each user, it fails closed before a tool runs instead of falling back to the unredacted result, and secrets are never kept, so they are never put back.