File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
content/copilot/tutorials Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 394394
395395COMMAND=" $( echo " $TOOL_ARGS_RAW " | jq -r ' .command // empty' ) "
396396
397- # ---------------------------------------------------------------------------
398- # Demo-only deny rule for safe testing.
399- # This blocks a harmless test command so you can validate the deny flow.
400- # Remove this rule after confirming your hooks work as expected.
401- # ---------------------------------------------------------------------------
402- if echo " $COMMAND " | grep -q " COPILOT_HOOKS_DENY_DEMO" ; then
403- deny " Blocked demo command (test rule). Remove this rule after validating hooks."
404- fi
405-
406397deny () {
407398 local reason=" $1 "
408399
@@ -431,6 +422,15 @@ deny() {
431422 exit 0
432423}
433424
425+ # ---------------------------------------------------------------------------
426+ # Demo-only deny rule for safe testing.
427+ # This blocks a harmless test command so you can validate the deny flow.
428+ # Remove this rule after confirming your hooks work as expected.
429+ # ---------------------------------------------------------------------------
430+ if echo " $COMMAND " | grep -q " COPILOT_HOOKS_DENY_DEMO" ; then
431+ deny " Blocked demo command (test rule). Remove this rule after validating hooks."
432+ fi
433+
434434# Privilege escalation
435435if echo " $COMMAND " | grep -qE ' \b(sudo|su|runas)\b' ; then
436436 deny " Privilege escalation requires manual approval."
You can’t perform that action at this time.
0 commit comments