Skip to content

fix(subagent): apply trust-level filtering in filter_skills - #6715

Merged
bug-ops merged 1 commit into
mainfrom
fix/filter-skills-no-trust-filter
Jul 28, 2026
Merged

fix(subagent): apply trust-level filtering in filter_skills#6715
bug-ops merged 1 commit into
mainfrom
fix/filter-skills-no-trust-filter

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • zeph_subagent::filter_skills applied only glob include/exclude patterns — Quarantined and Blocked skills were returned identically to Trusted/Verified ones. filtered_skills_for injects those bodies directly and unconditionally into a freshly-spawned sub-agent's system prompt, with no catalog/annotation surface to fall back on (unlike the main agent's <other_skills> catalog).
  • filter_skills now takes a &HashMap<String, zeph_common::SkillTrustLevel> and drops any skill whose resolved trust is Quarantined/Blocked, logging a warning per exclusion — mirroring the main agent's D1 activation filter (filter_active_skills_by_trust, Proactively-matched Quarantined skill locks the whole turn (and every spawned subagent) out of bash/write/MCP tools #6701). A skill absent from the trust map still falls back to Trusted.
  • filtered_skills_for is now async and resolves the trust map fresh via build_skill_trust_map on every call instead of reading a trust_snapshot cache that is never populated on the slash-command/@mention spawn path — the initial fix was otherwise inert there (caught by impl-critic review, see commit history / review discussion).
  • Breaking change for external callers: filter_skills (a pub crate-root re-export of zeph-subagent) gained a required third parameter.

Closes #6713

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 15320 passed, 0 failed
  • Rustdoc gate (RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler")
  • cargo test --doc -p zeph-subagent — 32 passed
  • New regression tests: skill trust exclusion in filter.rs, end-to-end body-injection test in subagent_commands.rs via a real DB-backed trust row
  • CHANGELOG.md updated ([Unreleased]/Fixed)
  • Testing playbook + coverage-status.md row added (.local/testing/playbooks/subagent-skill-trust-filter.md)

zeph_subagent::filter_skills applied only glob include/exclude patterns,
returning Quarantined and Blocked skills identically to Trusted ones.
filtered_skills_for injects those bodies directly and unconditionally
into a freshly-spawned sub-agent's system prompt, with no catalog/
annotation surface to fall back on.

filter_skills now drops Quarantined/Blocked skills (mirroring the main
agent's D1 activation filter), logging a warning per exclusion. A skill
absent from the trust map still falls back to Trusted.

filtered_skills_for now resolves the trust map fresh on every call
instead of reading a cache that is never populated on the slash-command/
@mention spawn path, where the fix would otherwise have been inert.

Closes #6713
@bug-ops
bug-ops enabled auto-merge (squash) July 28, 2026 21:21
@github-actions github-actions Bot added bug Something isn't working size/L Large PR (201-500 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate labels Jul 28, 2026
@bug-ops
bug-ops merged commit 81e234b into main Jul 28, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/filter-skills-no-trust-filter branch July 28, 2026 21:30
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/L Large PR (201-500 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zeph_subagent::filter_skills applies no trust filter at all

1 participant