fix(tools): adversarial policy exempt list and /status display#2471
Merged
fix(tools): adversarial policy exempt list and /status display#2471
Conversation
Add exempt_tools to AdversarialPolicyConfig with a default list of internal agent operations (memory_save, memory_search, read_overflow, load_skill, schedule_deferred). The gate skips LLM validation for these tools, preventing false denials from policies like "Do not write files". Add AdversarialPolicyInfo to RuntimeConfig and a with_adversarial_policy_info() builder method. /status now shows adversarial gate state (provider, policy count, fail_open) when the feature is enabled. Closes #2469, #2467.
This was
linked to
issues
Mar 30, 2026
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
exempt_toolsfield toAdversarialPolicyConfigwith a default list of internal agent operations (memory_save,memory_search,read_overflow,load_skill,schedule_deferred). The gate now skips LLM validation for these tools, preventing false denials from policies like"Do not write files"./statusnow shows adversarial gate state (provider,policy_count,fail_open) when[tools.adversarial_policy] enabled = true.Changes
crates/zeph-tools/src/config.rs:exempt_tools: Vec<String>field withdefault_exempt_tools()returning 5 internal tool namescrates/zeph-tools/src/adversarial_policy.rs:PolicyValidator::new()acceptsexempt_tools; early-returnAllowat start ofvalidate()for exempt toolscrates/zeph-core/src/agent/state/mod.rs:AdversarialPolicyInfostruct + field onRuntimeConfig(behindpolicy-enforcerfeature)crates/zeph-core/src/agent/builder.rs:with_adversarial_policy_info()builder methodcrates/zeph-core/src/agent/mod.rs:Adv gate:line inhandle_status_command()src/runner.rs: passexempt_toolsto validator; populate and applyAdversarialPolicyInfoTest plan
cargo nextest run --workspace --features full --lib --bins)cargo +nightly fmt --checkpassescargo clippy --workspace --features full -- -D warningspasses"Do not write files"no longer blocksmemory_save/statusshowsAdv gate:line when adversarial_policy is enabled