Use OpenCode hooks to check brin before installing packages
OpenCode's hooks system lets you intercept tool calls before they execute. Use a PreToolUse hook to check brin before any package install command runs.
The hook reads x-brin-verdict and x-brin-score from curl response headers for a fast, lightweight check. If the verdict is suspicious or dangerous, the command is blocked. If brin is unreachable, the hook allows the command through.