Follow-up from PR #304 (#238) review.
Problem
denied_command_patterns (shipped in #238) only blocks. Rolling out a broader pattern org-wide is risky without first measuring its false-positive rate against real traffic — a bare or slightly-too-greedy pattern degrades into model retry loops rather than clean failures.
Proposal
Add an action: warn variant (audit-only), mirroring the guardrails enforce / warn precedent:
action: block (default, today's behavior) — deny the call + emit guardrail_check (source: platform, decision: blocked).
action: warn — allow the call but emit guardrail_check (source: platform, decision: warned) with the same pattern/layer/message attribution.
Operators ship a new pattern to a workspace layer as warn, watch the guardrail_check (source: platform) events for false positives, then promote it to block (and/or the system layer) once it's clean. Pairs with the "trial in a workspace layer first" operator guidance added to docs/security/platform-policy.md in #304.
Shape
agentspec.CommandFilter currently carries {pattern, message}. Options:
- add an optional
action field (block | warn, default block) to CommandFilter, or
- a parallel
warn_command_patterns list.
The action-field approach keeps one list and mirrors the output-filter {pattern, action} shape already in agentspec.
Acceptance criteria
Out of scope
- Per-skill
deny_commands warn mode (separate concern).
Follow-up from PR #304 (#238) review.
Problem
denied_command_patterns(shipped in #238) only blocks. Rolling out a broader pattern org-wide is risky without first measuring its false-positive rate against real traffic — a bare or slightly-too-greedy pattern degrades into model retry loops rather than clean failures.Proposal
Add an
action: warnvariant (audit-only), mirroring the guardrailsenforce/warnprecedent:action: block(default, today's behavior) — deny the call + emitguardrail_check(source: platform,decision: blocked).action: warn— allow the call but emitguardrail_check(source: platform,decision: warned) with the same pattern/layer/message attribution.Operators ship a new pattern to a workspace layer as
warn, watch theguardrail_check(source: platform) events for false positives, then promote it toblock(and/or the system layer) once it's clean. Pairs with the "trial in a workspace layer first" operator guidance added todocs/security/platform-policy.mdin #304.Shape
agentspec.CommandFiltercurrently carries{pattern, message}. Options:actionfield (block|warn, defaultblock) toCommandFilter, orwarn_command_patternslist.The
action-field approach keeps one list and mirrors the output-filter{pattern, action}shape already inagentspec.Acceptance criteria
action: warnon a platform pattern allows the call and emitsguardrail_check(source: platform,decision: warned) with full attribution.action: block/ omitted preserves today's deny behavior.PlatformCommandGuard.Matchsurfaces the action so the hook can branch allow-vs-deny.Out of scope
deny_commandswarn mode (separate concern).