feat: add blocked action rule to L1 prompt guard#4
Open
shazi7804 wants to merge 1 commit intoknostic:mainfrom
Open
feat: add blocked action rule to L1 prompt guard#4shazi7804 wants to merge 1 commit intoknostic:mainfrom
shazi7804 wants to merge 1 commit intoknostic:mainfrom
Conversation
Agents must now stop and ask the user for explicit approval when a tool call is blocked or denied by Knostic Shield, instead of silently rerouting to an alternative approach (e.g. switching from write to exec).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new Blocked Action Rule to the L1 Prompt Guard policy injected into all agents at startup.
Problem
When Knostic Shield blocks a tool call (e.g.
write), agents could silently reroute to an alternative approach (e.g. switching toexec cat >with a heredoc) that achieves the same result without triggering the original block. This defeats the purpose of the security policy.Change
Adds explicit instructions to the L1 system prompt requiring agents to:
The rule explicitly calls out the
write→exec cat >bypass pattern as a concrete example.Before / After
Before:
writeblocked → agent quietly switches toexec cat > fileheredoc without telling the userAfter:
writeblocked → agent stops, explains the block, proposesexecas an alternative, waits for explicit user confirmationReal-world trigger
This fix was prompted by an actual incident where an agent had its
writecall blocked by Knostic (false positive on markdown content), and silently rerouted toexec + heredocto complete the file write — bypassing the block entirely without user awareness.