Skip to content

fix(tools): adversarial policy exempt list and /status display#2471

Merged
bug-ops merged 1 commit intomainfrom
2469-adversarial-policy-exempt
Mar 30, 2026
Merged

fix(tools): adversarial policy exempt list and /status display#2471
bug-ops merged 1 commit intomainfrom
2469-adversarial-policy-exempt

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 30, 2026

Summary

Changes

  • crates/zeph-tools/src/config.rs: exempt_tools: Vec<String> field with default_exempt_tools() returning 5 internal tool names
  • crates/zeph-tools/src/adversarial_policy.rs: PolicyValidator::new() accepts exempt_tools; early-return Allow at start of validate() for exempt tools
  • crates/zeph-core/src/agent/state/mod.rs: AdversarialPolicyInfo struct + field on RuntimeConfig (behind policy-enforcer feature)
  • crates/zeph-core/src/agent/builder.rs: with_adversarial_policy_info() builder method
  • crates/zeph-core/src/agent/mod.rs: Adv gate: line in handle_status_command()
  • src/runner.rs: pass exempt_tools to validator; populate and apply AdversarialPolicyInfo

Test plan

  • 7408 tests pass (cargo nextest run --workspace --features full --lib --bins)
  • cargo +nightly fmt --check passes
  • cargo clippy --workspace --features full -- -D warnings passes
  • Live: policy "Do not write files" no longer blocks memory_save
  • Live: /status shows Adv gate: line when adversarial_policy is enabled

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.
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels Mar 30, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 30, 2026 21:08
@bug-ops bug-ops merged commit ee95a1d into main Mar 30, 2026
27 checks passed
@bug-ops bug-ops deleted the 2469-adversarial-policy-exempt branch March 30, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

1 participant