Repository navigation
Conversation
Kaap10
force-pushed
the
fix/agent-guard-plugin-guards-discovery
branch
from
October 21, 2026 14:42
cad5280 to
88d986e
Compare
Contributor
Author
|
Hi @potiuk - while auditing Post-modularization (#1087 / #1672), guards live under This PR adds plugin guard discovery, hardens directory deduplication with |
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.
While exploring the
agent-guarddispatcher and auditing how pre-execution hooks discover skill guards across different harnesses, I noticed thatagent_guard.discover_guards()was returning only 1 guard (no_verify_commit.pyfromguards.d/), completely omitting the domain-specific safety guards documented in the README (mention,mark_ready, andsecurity_language).Tracking down the discovery logic,
guard_dirs()was still scanning(root / "skills").glob("*/guards"). Following the modular plugin migration (#1087 / #1672), canonical guards live underplugins/*/skills/*/guards. On checkouts whereskills/*entries are symlinks (or in adopter repositories deploying plugins directly without top-level symlink mirrors), the glob returned empty and the guards silently dropped.Summary
agent_guard.guard_dirs()to discover contributed skill guards underplugins/*/skills/*/guardsin addition toskills/*/guards(retaining backwards compatibility).framework_root()to recognize eitherskills/orplugins/sitting besidetools/agent-guard.d.resolve()so environments exposing both canonical plugin paths andskills/symlinks do not register duplicate guard instances.tools/agent-guard/tests/test_skill_guards.pyandtest_discovery.pywith canonical plugin directories, cross-platform path handling, and new regression unit tests.Type of change
tools/*/withpyproject.toml)prek, workflows, validators)Test plan
ruff checkandruff format --checkpass with zero warnings across all touched files.mypy --platform linux tools/agent-guard/src/agent_guardpasses (Success: no issues found in 3 source files).pytest tools/agent-guard/tests/test_skill_guards.py tools/agent-guard/tests/test_discovery.pypasses cleanly (87 passed, 2 skipped on Windows non-admin symlink privileges).test_plugin_skill_guards_are_discovered()test_guard_dirs_deduplicates_symlinks()agent_guard.discover_guards()discovers all 4 active guards (no_verify_commit,mention,mark_ready,security_language).RFC-AI-0004 compliance
Linked issues
Fixes #1756