Menu

I fed seven verdict shapes to my agent's tool gate. Three of them let the call through.
πŸ“°

I fed seven verdict shapes to my agent's tool gate. Three of them let the call through.

DEV Community: securityΒ·QingfengΒ·about 18 hours ago
#wDMcC7FQ
#devtosecurity#devto#dev#deny#allow
Long article (1315 words) β€” no AI summary yet.
Reading 0:00
15s threshold

TL;DR

exit 0 answers "did the evaluator run" , not "may this call proceed" . A gate that forwards the exit status is not a gate.

I generated seven stub evaluators covering the shapes a real policy CLI takes β€” allow, deny, no-rule-matched, deny-then-crash, crash-with-no-output, silence, and a binary that is not there β€” and ran all seven through two wrapper styles.

The naive wrapper failed open on three of them : deny-with-exit-0, no-rule-matched, and silent-with-exit-0. In all three the tool call went ahead and the log said the hook had run.

The fix is small: only an explicit allow allows, deny and error stay distinguishable, and "no verdict" never inherits the default.

The two values that get conflated

Every hook-based gate has two separate results coming back from the policy evaluator:

the decision β€” allow / deny / nothing matched

the process status β€” did the evaluator itself run to completion

The first lives in stdout (usually JSON). The second is the exit code.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.